OSDN Git Service

Update history.html
[nucleus-jp/nucleus-jp-ancient.git] / utf8 / createaccount.php
1 <?php\r
2 /*\r
3  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
4  * Copyright (C) 2002-2010 The Nucleus Group\r
5  *\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
11  */\r
12 \r
13 /**\r
14  * Create account form\r
15  *\r
16  * @license http://nucleuscms.org/license.txt GNU General Public License\r
17  * @copyright Copyright (C) 2002-2010 The Nucleus Group\r
18  * @version $Id$\r
19  */\r
20 \r
21 require_once "./config.php";\r
22 //include $DIR_LIBS."ACTION.php";\r
23 include_libs('ACTION.php',false,false);\r
24 \r
25 if (isset ($_POST['showform'])&&$_POST['showform']==1) {\r
26         $showform = 1;\r
27 }\r
28 else {\r
29         $showform = 0;\r
30 }\r
31 ?>\r
32 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">\r
33 <html <?php echo _HTML_XML_NAME_SPACE_AND_LANG_CODE; ?>>\r
34         <head>\r
35                 <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET; ?>" />\r
36                 <title><?php echo _CREATE_ACCOUNT_TITLE ?></title>\r
37                 <style type="text/css">@import url(nucleus/styles/manual.css);</style>\r
38         </head>\r
39         <body>\r
40 \r
41         <h1><?php echo _CREATE_ACCOUNT0; ?></h1>\r
42 <?php\r
43 // show form only if Visitors are allowed to create a Member Account\r
44 if ($CONF['AllowMemberCreate']==1) { \r
45         if (isset($_POST['showform']) && $_POST['showform'] == 1) {\r
46                 include $DIR_LIBS . 'ACTION.php';\r
47                 // after the from is sent it will be validated\r
48                 // POST data will be added as value to treat the user with care (;-))\r
49                 $a = new ACTION();\r
50                 // if createAccount fails it returns an error message \r
51                 $message = '<span style="font-weight:bold; color:red;">' . htmlspecialchars($a->createAccount()) . '</span><br /><br />';\r
52                 if (isset($_POST['name']))\r
53                         $name    = 'value="' . htmlspecialchars($_POST['name']) . '" ';\r
54                 if (isset($_POST['realname']))\r
55                         $realname = 'value="' . htmlspecialchars($_POST['realname']) . '" ';\r
56                 if (isset($_POST['email']))\r
57                         $email  = 'value="' . htmlspecialchars($_POST['email']) . '" ';\r
58                 if (isset($_POST['url']))\r
59                         $url      = 'value="' . htmlspecialchars($_POST['url']) . '" ';\r
60 //              $showform = 1;\r
61 //      } else {\r
62 //              $showform = 0;\r
63                 echo $message;\r
64         }\r
65 ?>\r
66                 <form method="post" action="createaccount.php">\r
67                         <div>\r
68                                 <input type="hidden" name="showform" value="1" />\r
69                                 <input type="hidden" name="action" value="createaccount" />\r
70                                 <?php echo _CREATE_ACCOUNT_LOGIN_NAME; ?>\r
71                                 <br />\r
72                                 <input name="name" size="32" maxlength="32" <?php echo $name; ?>/> <small><?php echo _CREATE_ACCOUNT_LOGIN_NAME_VALID; ?></small>\r
73                                 <br />\r
74                                 <br />\r
75                                 <?php echo _CREATE_ACCOUNT_REAL_NAME; ?>\r
76                                 <br />\r
77                                 <input name="realname" size="40" <?php echo $realname; ?>/>\r
78                                 <br />\r
79                                 <br />\r
80                                 <?php echo _CREATE_ACCOUNT_EMAIL; ?>\r
81                                 <br />\r
82                                 <input name="email" size="40" <?php echo $email; ?>/> <small><?php echo _CREATE_ACCOUNT_EMAIL2; ?></small>\r
83                                 <br />\r
84                                 <br />\r
85                                 <?php echo _CREATE_ACCOUNT_URL; ?>\r
86                                 <br />\r
87                                 <input name="url" size="60" <?php echo $url; ?>/>\r
88                                 <br />\r
89 <?php\r
90                 global $manager;\r
91                 // add extra fields from Plugins, like NP_Profile\r
92                 $data = array(\r
93                         'type'    => 'createaccount.php',\r
94                         'prelabel'  => '',\r
95                         'postlabel' => '<br />',\r
96                         'prefield'  => '',\r
97                         'postfield' => '<br /><br />'\r
98                 );\r
99                 $manager->notify('RegistrationFormExtraFields', $data);\r
100                 // add a Captcha challenge or something else\r
101                 $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));\r
102 ?>\r
103                                 <br />\r
104                                 <br />\r
105                                 <input type="submit" value="<?php echo _CREATE_ACCOUNT_SUBMIT; ?>" />\r
106                         </div>\r
107                 </form>\r
108 <?php\r
109         }       // close else showform ...\r
110 }\r
111 else {\r
112         echo _CREATE_ACCOUNT1;\r
113         echo _CREATE_ACCOUNT2;\r
114 }\r
115 ?>\r
116 </body>\r
117 </html>\r