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_libs('ACTION.php',false,false);
23 sendContentType('text/html', 'createaccount');
24 echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
27 echo "<title>Create Member Account</title>\n";
28 echo "<style type=\"text/css\">@import url(nucleus/styles/manual.css);</style>\n";
31 echo "<h1>Create Account</h1>\n";
33 // show form only if Visitors are allowed to create a Member Account
34 if ( $CONF['AllowMemberCreate'] == 1 )
42 if ( array_key_exists('showform', $_POST) && $_POST['showform'] == 1 )
44 if ( array_key_exists('name', $_POST) )
46 $name = $_POST['name'];
48 if ( array_key_exists('realname', $_POST) )
50 $realname = $_POST['realname'];
52 if ( array_key_exists('email', $_POST) )
54 $email = $_POST['email'];
56 if ( array_key_exists('url', $_POST) )
60 // after the from is sent it will be validated
61 // POST data will be added as value to treat the user with care (;-))
64 $message = $a->createAccount();
67 echo '<p style="font-weight:bold; color:red;">' . $message . "</p>\n";
71 echo '<p>' . _MSG_ACTIVATION_SENT . "</p>\n";
72 echo "<p>Return to <a href=\"{$CONF['IndexURL']}\" title=\"{$CONF['SiteName']}\">{$CONF['SiteName']}</a></p>\n";
79 echo "<form method=\"post\" action=\"createaccount.php\">\n";
81 echo "<dt><label for=\"name\">Login Name (required): </label></dt>\n";
82 echo "<dd><input id=\"name\"name=\"name\" value=\"{$name}\" size=\"32\" maxlength=\"32\" /><span style=\"\small\">(only a-z, 0-9)</span></dd>\n";
83 echo "<dt><label for=\"realname\">Real Name (required): </label></dt>\n";
84 echo "<dd><input id=\"realname\" name=\"realname\" value=\"{$realname}\" size=\"40\" /></dd>\n";
85 echo "<dt><label for=\"email\">Email (required): </label></dt>\n";
86 echo "<dd><input id=\"email\"name=\"email\" value=\"{$email}\" size=\"40\" /><span style=\"\small\">(must be valid, because an activation link will be sent over there)</span></dd>\n";
87 echo "<dt><label for=\"url\">URL: </label></dt>\n";
88 echo "<dd><input id=\"url\"name=\"url\" value=\"{$url}\" size=\"60\" /></dd>\n";
89 echo "<input type=\"hidden\" name=\"showform\" value=\"1\" />\n";
90 // add extra fields from Plugins, like NP_Profile
91 $manager->notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '<br />', 'prefield' => '', 'postfield' => '<br /><br />'));
93 // add a Captcha challenge or something else
95 $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
96 echo "<button type=\"submit\" name=\"action\" value=\"createaccount\" />Create Account</button>\n";
103 echo 'Visitors are not allowed to create a Member Account.<br /><br />';
104 echo 'Please contact the website administrator for more information.';