3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
4 * Copyright (C) 2002-20011 The Nucleus Group
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 2
9 * of the License, or (at your option) any later version.
10 * (see nucleus/documentation/index.html#license for more info)
14 * Registration form for new users
15 * @license http://nucleuscms.org/license.txt GNU General Public License
16 * @copyright Copyright (C) 2002-20011 The Nucleus Group
17 * @version $Id: createaccount.php 1624 2012-01-09 11:36:20Z sakamocchi $
20 require_once "./config.php";
21 //include $DIR_LIBS."ACTION.php";
22 include_libs('ACTION.php',false,false);
24 if (isset ($_POST['showform']) && $_POST['showform']==1) {
30 sendContentType('text/html', 'createaccount');
32 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
35 <title>Create Member Account</title>
36 <style type="text/css">@import url(nucleus/styles/manual.css);</style>
40 <h1>Create Account</h1>
43 // show form only if Visitors are allowed to create a Member Account
44 if ($CONF['AllowMemberCreate']==1) {
45 // if the form is shown the first time no POST data
46 // will be added as value for the input fields
50 <form method="post" action="createaccount.php">
53 <input type="hidden" name="showform" value="1" />
54 <input type="hidden" name="action" value="createaccount" />
56 Login Name (required):
58 <input name="name" size="32" maxlength="32" /> <small>(only a-z, 0-9)</small>
63 <input name="realname" size="40" />
68 <input name="email" size="40" /> <small>(must be valid, because an activation link will be sent over there)</small>
73 <input name="url" size="60" />
76 // add extra fields from Plugins, like NP_Profile
77 $manager->notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '<br />', 'prefield' => '', 'postfield' => '<br /><br />'));
78 // add a Captcha challenge or something else
80 $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
84 <input type="submit" value="Create Account" />
89 } // close if showfrom ...
91 // after the from is sent it will be validated
92 // POST data will be added as value to treat the user with care (;-))
96 // if createAccount fails it returns an error message
97 $message = $a->createAccount();
99 echo '<span style="font-weight:bold; color:red;">'.$message.'</span><br /><br />';
102 <form method="post" action="createaccount.php">
105 <input type="hidden" name="showform" value="1" />
106 <input type="hidden" name="action" value="createaccount" />
108 Login Name (required):
110 <input name="name" size="32" maxlength="32" <?php if(isset($_POST['name'])){echo 'value="'.i18n::hsc($_POST['name']).'"';}?>/> <small>(only a-z, 0-9)</small>
113 Real Name (required):
115 <input name="realname" size="40" <?php if(isset($_POST['realname'])){echo 'value="'.i18n::hsc($_POST['realname']).'"';}?>/>
120 <input name="email" size="40" <?php if(isset($_POST['email'])){echo 'value="'.i18n::hsc($_POST['email']).'"';}?>/> <small>(must be valid, because an activation link will be sent over there)</small>
125 <input name="url" size="60" <?php if(isset($_POST['url'])){echo 'value="'.i18n::hsc($_POST['url']).'"';}?>/>
128 // add extra fields from plugin, like NP_Profile
129 $manager->notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '<br />', 'prefield' => '', 'postfield' => '<br /><br />'));
130 // add a Captcha challenge or something else
132 $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
136 <input type="submit" value="Create Account" />
141 } // close else showform ...
145 echo 'Visitors are not allowed to create a Member Account.<br /><br />';
146 echo 'Please contact the website administrator for more information.';