OSDN Git Service

MERGE: リビジョン1992。テンプレート「SHOWLIST_LISTPLUG_TABLE_NAVILIST」の追加
[nucleus-jp/nucleus-next.git] / createaccount.php
index 4e0c99d..0cc16dd 100644 (file)
-<?php\r
-/*\r
- * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
- * Copyright (C) 2002-20011 The Nucleus Group\r
- *\r
- * This program is free software; you can redistribute it and/or\r
- * modify it under the terms of the GNU General Public License\r
- * as published by the Free Software Foundation; either version 2\r
- * of the License, or (at your option) any later version.\r
- * (see nucleus/documentation/index.html#license for more info)\r
- */\r
-\r
-/**\r
- * Registration form for new users\r
- * @license http://nucleuscms.org/license.txt GNU General Public License\r
- * @copyright Copyright (C) 2002-20011 The Nucleus Group\r
- * @version $Id: createaccount.php 1624 2012-01-09 11:36:20Z sakamocchi $\r
- */\r
-\r
-require_once "./config.php";\r
-include_libs('ACTION.php',false,false);\r
-\r
-sendContentType('text/html', 'createaccount');\r
-echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n";\r
-echo "<html>\n";\r
-echo "<head>\n";\r
-echo "<title>Create Member Account</title>\n";\r
-echo "<style type=\"text/css\">@import url(nucleus/styles/manual.css);</style>\n";\r
-echo "</head>\n";\r
-echo "<body>\n";\r
-echo "<h1>Create Account</h1>\n";\r
-\r
-// show form only if Visitors are allowed to create a Member Account\r
-if ( $CONF['AllowMemberCreate'] == 1 )\r
-{\r
-       $name = '';\r
-       $realname ='';\r
-       $email = '';\r
-       $url = '';\r
-       \r
-       /* already submit */\r
-       if ( array_key_exists('showform', $_POST) && $_POST['showform'] == 1 )\r
-       {\r
-               if ( array_key_exists('name', $_POST) )\r
-               {\r
-                       $name = $_POST['name'];\r
-               }\r
-               if ( array_key_exists('realname', $_POST) )\r
-               {\r
-                       $realname = $_POST['realname'];\r
-               }\r
-               if ( array_key_exists('email', $_POST) )\r
-               {\r
-                       $email = $_POST['email'];\r
-               }\r
-               if ( array_key_exists('url', $_POST) )\r
-               {\r
-                       $url = $_POST['url'];\r
-               }\r
-               // after the from is sent it will be validated\r
-               // POST data will be added as value to treat the user with care (;-))\r
-               $a = new ACTION();\r
-               \r
-               $message = $a->createAccount();\r
-               if ( $message != 1 )\r
-               {\r
-                       echo '<p style="font-weight:bold; color:red;">' . $message . "</p>\n";\r
-               }\r
-               else\r
-               {\r
-                       echo '<p>' . _MSG_ACTIVATION_SENT . "</p>\n"; \r
-                       echo "<p>Return to <a href=\"{$CONF['IndexURL']}\" title=\"{$CONF['SiteName']}\">{$CONF['SiteName']}</a></p>\n";\r
-                       echo "</body>\n";\r
-                       echo "</html>\n";\r
-                       exit;\r
-               }\r
-       }\r
-       \r
-       echo "<form method=\"post\" action=\"createaccount.php\">\n";\r
-       echo "<dl>\n";\r
-       echo "<dt><label for=\"name\">Login Name (required): </label></dt>\n";\r
-       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
-       echo "<dt><label for=\"realname\">Real Name (required): </label></dt>\n";\r
-       echo "<dd><input id=\"realname\" name=\"realname\" value=\"{$realname}\" size=\"40\" /></dd>\n";\r
-       echo "<dt><label for=\"email\">Email (required): </label></dt>\n";\r
-       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
-       echo "<dt><label for=\"url\">URL: </label></dt>\n";\r
-       echo "<dd><input id=\"url\"name=\"url\" value=\"{$url}\" size=\"60\" /></dd>\n";\r
-       echo "<input type=\"hidden\" name=\"showform\" value=\"1\" />\n";\r
-       // add extra fields from Plugins, like NP_Profile\r
-       $manager->notify('RegistrationFormExtraFields', array('type' => 'createaccount.php', 'prelabel' => '', 'postlabel' => '<br />', 'prefield' => '', 'postfield' => '<br /><br />'));\r
-       \r
-       // add a Captcha challenge or something else\r
-       global $manager;\r
-       $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));\r
-       echo "<button type=\"submit\" name=\"action\" value=\"createaccount\" />Create Account</button>\n";\r
-       echo "</dl>\n";\r
-       echo "</form>\n";\r
-}\r
-else\r
-{\r
-       echo "<p>\n";\r
-       echo 'Visitors are not allowed to create a Member Account.<br /><br />';\r
-       echo 'Please contact the website administrator for more information.';\r
-       echo "</p>\n";\r
-}\r
-       \r
-echo "</body>\n";\r
-echo "</html>\n";\r
+<?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: createaccount.php 1888 2012-06-17 08:38:54Z sakamocchi $
+ */
+
+// we are using admin stuff:
+$CONF = array();
+$CONF['UsingAdminArea'] = 1;
+
+require_once "./config.php";
+include_libs('ACTION.php');
+
+if ( !Admin::initialize() )
+{
+       /* TODO: something to handling errors */
+       exit;
+}
+
+Admin::action('createaccount');
+exit;