OSDN Git Service

git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk/utf8@906...
[nucleus-jp/nucleus-jp-ancient.git] / createaccount.php
1 <?php\r
2 /*\r
3  * Nucleus: PHP/MySQL Weblog CMS (http://nucleuscms.org/)\r
4  * Copyright (C) 2002-2009 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-2009 The Nucleus Group\r
18  * @version $Id$\r
19  */\r
20
21         require "./config.php";
22         include $DIR_LIBS."ACTION.php";
23         
24         if (isset ($_POST['showform'])&&$_POST['showform']==1) {
25                 $showform = 1;
26         }
27         else {
28                 $showform = 0;
29         }
30 ?>
31 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
32 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja-JP" lang="ja-JP">
33 <head>
34         <meta http-equiv="Content-Type" content="text/html; charset=<?php echo _CHARSET; ?>" />
35         <title><?php echo CREATE_ACCOUNT_TITLE ?></title>
36         <style type="text/css">@import url(nucleus/styles/manual.css);</style>
37 </head>
38 <body>
39
40         <h1><?php echo _CREATE_ACCOUNT0?></h1>
41
42 <?php
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
47                 if ($showform==0) {
48 ?>
49
50         <form method="post" action="createaccount.php">
51
52         <div>
53         <input type="hidden" name="showform" value="1" />
54         <input type="hidden" name="action" value="createaccount" />
55         
56                 <?php echo _CREATE_ACCOUNT_LOGIN_NAME?>
57                 <br />
58                 <input name="name" size="20" /> <small>(only a-z, 0-9)</small>
59                 <br />
60                 <br />          
61                 <?php echo _CREATE_ACCOUNT_REAL_NAME?>
62                 <br />
63                 <input name="realname" size="40" />
64                 <br />
65                 <br />          
66                 <?php echo _CREATE_ACCOUNT_EMAIL?>
67                 <br />
68                 <input name="email" size="40" /> <small><?php echo _CREATE_ACCOUNT_EMAIL2?></small>
69                 <br />
70                 <br />          
71                 <?php echo _CREATE_ACCOUNT_URL?>
72                 <br />
73                 <input name="url" size="60" />
74                 <br />
75                 <?php
76                 // add a Captcha challenge or something else
77                 global $manager;
78                 $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
79                 ?>
80                 <br />
81                 <br />                                          
82                 <input type="submit" value="<?php echo _CREATE_ACCOUNT_SUBMIT?>" />
83         </div>
84
85         </form>
86 <?php
87                 } // close if showfrom ...
88                 else {
89                 // after the from is sent it will be validated
90                 // POST data will be added as value to treat the user with care (;-))
91         
92                 $a = new ACTION();
93
94                 // if createAccount fails it returns an error message 
95                 $message = $a->createAccount();
96
97                 echo '<span style="font-weight:bold; color:red;">'.htmlspecialchars($message).'</span><br /><br />'; 
98 ?>
99         
100                 <form method="post" action="createaccount.php">
101
102         <div>
103         <input type="hidden" name="showform" value="1" />
104         <input type="hidden" name="action" value="createaccount" />
105         
106                 <?php echo _CREATE_ACCOUNT_LOGIN_NAME?> 
107                 <br />
108                 <input name="name" size="20" <?php if(isset($_POST['name'])){echo 'value="'.htmlspecialchars($_POST['name']).'"';}?>/> <small>(only a-z, 0-9)</small>
109                 <br />
110                 <br />          
111                 <?php echo _CREATE_ACCOUNT_REAL_NAME?> 
112                 <br />
113                 <input name="realname" size="40" <?php if(isset($_POST['realname'])){echo 'value="'.htmlspecialchars($_POST['realname']).'"';}?>/>
114                 <br />
115                 <br />          
116                 <?php echo _CREATE_ACCOUNT_EMAIL?>
117                 <br />
118                 <input name="email" size="40" <?php if(isset($_POST['email'])){echo 'value="'.htmlspecialchars($_POST['email']).'"';}?>/> <small><?php echo _CREATE_ACCOUNT_EMAIL2?></small>
119                 <br />
120                 <br />          
121                 <?php echo _CREATE_ACCOUNT_URL?> 
122                 <br />
123                 <input name="url" size="60" <?php if(isset($_POST['url'])){echo 'value="'.htmlspecialchars($_POST['url']).'"';}?>/>
124                 <br />
125                 <?php
126                 // add a Captcha challenge or something else
127                 global $manager;
128                 $manager->notify('FormExtra', array('type' => 'membermailform-notloggedin'));
129                 ?>
130                 <br />
131                 <br />
132                 <input type="submit" value="<?php echo _CREATE_ACCOUNT_SUBMIT?>" />
133
134
135         </form>
136 <?php
137                 }       // close else showform ...
138
139 }
140 else { 
141         echo _CREATE_ACCOUNT1;
142         echo _CREATE_ACCOUNT2;
143 }
144 ?>
145         
146         
147 </body>
148 </html>