3 * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)
\r
4 * Copyright (C) 2002-20011 The Nucleus Group
\r
6 * This program is free software; you can redistribute it and/or
\r
7 * modify it under the terms of the GNU General Public License
\r
8 * as published by the Free Software Foundation; either version 2
\r
9 * of the License, or (at your option) any later version.
\r
10 * (see nucleus/documentation/index.html#license for more info)
\r
14 * Registration form for new users
\r
15 * @license http://nucleuscms.org/license.txt GNU General Public License
\r
16 * @copyright Copyright (C) 2002-20011 The Nucleus Group
\r
17 * @version $Id: createaccount.php 1624 2012-01-09 11:36:20Z sakamocchi $
\r
20 require_once "./config.php";
\r
21 include_libs('ACTION.php',false,false);
\r
23 sendContentType('text/html', 'createaccount');
\r
24 echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";
\r
27 echo "<title>Create Member Account</title>\n";
\r
28 echo "<style type=\"text/css\">@import url(nucleus/styles/manual.css);</style>\n";
\r
31 echo "<h1>Create Account</h1>\n";
\r
33 // show form only if Visitors are allowed to create a Member Account
\r
34 if ( $CONF['AllowMemberCreate'] == 1 )
\r
41 /* already submit */
\r
42 if ( array_key_exists('showform', $_POST) && $_POST['showform'] == 1 )
\r
44 if ( array_key_exists('name', $_POST) )
\r
46 $name = $_POST['name'];
\r
48 if ( array_key_exists('realname', $_POST) )
\r
50 $realname = $_POST['realname'];
\r
52 if ( array_key_exists('email', $_POST) )
\r
54 $email = $_POST['email'];
\r
56 if ( array_key_exists('url', $_POST) )
\r
58 $url = $_POST['url'];
\r
60 // after the from is sent it will be validated
\r
61 // POST data will be added as value to treat the user with care (;-))
\r
64 $message = $a->createAccount();
\r
65 if ( $message != 1 )
\r
67 echo '<p style="font-weight:bold; color:red;">' . $message . "</p>\n";
\r
71 echo '<p>' . _MSG_ACTIVATION_SENT . "</p>\n";
\r
72 echo "<p>Return to <a href=\"{$CONF['IndexURL']}\" title=\"{$CONF['SiteName']}\">{$CONF['SiteName']}</a></p>\n";
\r
79 echo "<form method=\"post\" action=\"createaccount.php\">\n";
\r
81 echo "<dt><label for=\"name\">Login Name (required): </label></dt>\n";
\r
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";
\r
83 echo "<dt><label for=\"realname\">Real Name (required): </label></dt>\n";
\r
84 echo "<dd><input id=\"realname\" name=\"realname\" value=\"{$realname}\" size=\"40\" /></dd>\n";
\r
85 echo "<dt><label for=\"email\">Email (required): </label></dt>\n";
\r
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";
\r
87 echo "<dt><label for=\"url\">URL: </label></dt>\n";
\r
88 echo "<dd><input id=\"url\"name=\"url\" value=\"{$url}\" size=\"60\" /></dd>\n";
\r
89 echo "<input type=\"hidden\" name=\"showform\" value=\"1\" />\n";
\r
90 // add extra fields from Plugins, like NP_Profile
\r
91 $manager->notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '<br />', 'prefield' => '', 'postfield' => '<br /><br />'));
\r
93 // add a Captcha challenge or something else
\r
95 $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
\r
96 echo "<button type=\"submit\" name=\"action\" value=\"createaccount\" />Create Account</button>\n";
\r
103 echo 'Visitors are not allowed to create a Member Account.<br /><br />';
\r
104 echo 'Please contact the website administrator for more information.';
\r