-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcreateaccount.php
164 lines (145 loc) · 4.57 KB
/
createaccount.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
/*
* Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
* Copyright (C) 2002-20011 The Nucleus Group
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* (see nucleus/documentation/index.html#license for more info)
*/
/**
* Registration form for new users
* @license http://nucleuscms.org/license.txt GNU General Public License
* @copyright Copyright (C) 2002-20011 The Nucleus Group
* @version $Id$
*/
require_once "./config.php";
//include $DIR_LIBS."ACTION.php";
include_libs('ACTION.php',false,false);
if (isset ($_POST['showform']) && $_POST['showform']==1) {
$showform = 1;
}
else {
$showform = 0;
}
sendContentType('text/html', 'createaccount', _CHARSET);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Create Member Account</title>
<style type="text/css">@import url(nucleus/styles/manual.css);</style>
</head>
<body>
<h1>Create Account</h1>
<?php
// show form only if Visitors are allowed to create a Member Account
if ($CONF['AllowMemberCreate']==1) {
// if the form is shown the first time no POST data
// will be added as value for the input fields
if ($showform==0) {
?>
<form method="post" action="createaccount.php">
<div>
<input type="hidden" name="showform" value="1" />
<input type="hidden" name="action" value="createaccount" />
Login Name (required):
<br />
<input name="name" size="32" maxlength="32" /> <small>(only a-z, 0-9)</small>
<br />
<br />
Real Name (required):
<br />
<input name="realname" size="40" />
<br />
<br />
Email (required):
<br />
<input name="email" size="40" /> <small>(must be valid, because an activation link will be sent over there)</small>
<br />
<br />
URL:
<br />
<input name="url" size="60" />
<br />
<?php
// add extra fields from Plugins, like NP_Profile
$data = array(
'type' => 'createaccount.php',
'prelabel' => '', 'postlabel' => '<br />',
'prefield' => '', 'postfield' => '<br /><br />'
);
$manager->notify('RegistrationFormExtraFields', $data);
// add a Captcha challenge or something else
global $manager;
$data = array('type' => 'membermailform-notloggedin');
$manager->notify('FormExtra', $data);
?>
<br />
<br />
<input type="submit" value="Create Account" />
</div>
</form>
<?php
} // close if showfrom ...
else {
// after the from is sent it will be validated
// POST data will be added as value to treat the user with care (;-))
$a = new ACTION();
// if createAccount fails it returns an error message
$message = $a->createAccount();
echo '<span style="font-weight:bold; color:red;">'.$message.'</span><br /><br />';
?>
<form method="post" action="createaccount.php">
<div>
<input type="hidden" name="showform" value="1" />
<input type="hidden" name="action" value="createaccount" />
Login Name (required):
<br />
<input name="name" size="32" maxlength="32" <?php if(isset($_POST['name'])){echo 'value="'.htmlspecialchars($_POST['name']).'"';}?>/> <small>(only a-z, 0-9)</small>
<br />
<br />
Real Name (required):
<br />
<input name="realname" size="40" <?php if(isset($_POST['realname'])){echo 'value="'.htmlspecialchars($_POST['realname']).'"';}?>/>
<br />
<br />
Email (required):
<br />
<input name="email" size="40" <?php if(isset($_POST['email'])){echo 'value="'.htmlspecialchars($_POST['email']).'"';}?>/> <small>(must be valid, because an activation link will be sent over there)</small>
<br />
<br />
URL:
<br />
<input name="url" size="60" <?php if(isset($_POST['url'])){echo 'value="'.htmlspecialchars($_POST['url']).'"';}?>/>
<br />
<?php
// add extra fields from plugin, like NP_Profile
$data = array(
'type' => 'createaccount.php',
'prelabel' => '', 'postlabel' => '<br />',
'prefield' => '', 'postfield' => '<br /><br />'
);
$manager->notify('RegistrationFormExtraFields', $data);
// add a Captcha challenge or something else
global $manager;
$data = array('type' => 'membermailform-notloggedin');
$manager->notify('FormExtra', $data);
?>
<br />
<br />
<input type="submit" value="Create Account" />
</div>
</form>
<?php
} // close else showform ...
}
else {
echo 'Visitors are not allowed to create a Member Account.<br /><br />';
echo 'Please contact the website administrator for more information.';
}
?>
</body>
</html>