doc/developer/ClosedNetwork: manual_useradd.tpl

File manual_useradd.tpl, 7.1 kB (added by Andrew Hodel, 9 months ago)
Line 
1 {*
2
3 /* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
4
5 // +-------------------------------------------------------------------+
6 // | WiFiDog Authentication Server                                     |
7 // | =============================                                     |
8 // |                                                                   |
9 // | The WiFiDog Authentication Server is part of the WiFiDog captive  |
10 // | portal suite.                                                     |
11 // +-------------------------------------------------------------------+
12 // | PHP version 5 required.                                           |
13 // +-------------------------------------------------------------------+
14 // | Homepage:     http://www.wifidog.org/                             |
15 // | Source Forge: http://sourceforge.net/projects/wifidog/            |
16 // +-------------------------------------------------------------------+
17 // | This program is free software; you can redistribute it and/or     |
18 // | modify it under the terms of the GNU General Public License as    |
19 // | published by the Free Software Foundation; either version 2 of    |
20 // | the License, or (at your option) any later version.               |
21 // |                                                                   |
22 // | This program is distributed in the hope that it will be useful,   |
23 // | but WITHOUT ANY WARRANTY; without even the implied warranty of    |
24 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the     |
25 // | GNU General Public License for more details.                      |
26 // |                                                                   |
27 // | You should have received a copy of the GNU General Public License |
28 // | along with this program; if not, contact:                         |
29 // |                                                                   |
30 // | Free Software Foundation           Voice:  +1-617-542-5942        |
31 // | 59 Temple Place - Suite 330        Fax:    +1-617-542-2652        |
32 // | Boston, MA  02111-1307,  USA       gnu@gnu.org                    |
33 // |                                                                   |
34 // +-------------------------------------------------------------------+
35
36 /**
37 * Manual Useradd Page
38 *
39 * @package    WiFiDogAuthServer
40 * @subpackage Templates
41 * @author     Andrew Hodel
42 * @author     Philippe April
43 * @author     Benoit Grégoire <bock@step.polymtl.ca>
44 * @author     Max Horváth <max.horvath@freenet.de>
45 * @copyright  2004-2006 Philippe April
46 * @copyright  2004-2006 Benoit Grégoire, Technologies Coeus inc.
47 * @copyright  2006 Max Horváth, Horvath Web Consulting
48 * @version    Subversion $Id: manual_useradd.tpl 1310 2008-03-01 22:14:10Z ahodel $
49 * @link       http://www.wifidog.org/
50 */
51
52 *}
53
54 {if $sectionTOOLCONTENT}
55 {*
56 BEGIN section TOOLCONTENT
57 *}
58 <div id="login_form">
59         <h1>{"I'm having difficulties"|_}:</h1>
60
61         <ul>
62                 <li><a href="{$base_url_path}lost_username.php">{"I Forgot my username"|_}</a></li>
63                 <li><a href="{$base_url_path}lost_password.php">{"I Forgot my password"|_}</a></li>
64                 <li><a href="{$base_url_path}resend_validation.php">{"Re-send the validation email"|_}</a></li>
65         </ul>
66 </div>
67 {*
68 END section TOOLCONTENT
69 *}
70 {/if}
71
72 {if $sectionMAINCONTENT}
73 {*
74 BEGIN section MAINCONTENT
75 *}
76 <fieldset class="pretty_fieldset">
77         <legend>{"Manually add a user account for"|_} {$networkName}</legend>
78
79         <form name="signup_form" method="post" onsubmit="return false" action="{$base_ssl_path}manual_useradd.php">
80         <input type="hidden" name="form_request" value="signup">
81                 {if $SelectNetworkUI}
82                         {$SelectNetworkUI}
83                 {/if}
84
85                 <table>
86                         <tr>
87                                 <th>{"Username desired"|_}:</th>
88                                 <td><input type="text" name="username" value="{$username}" size="30" id="form_username" onkeypress="return focusNext(this.form, 'email', event)"></td>
89                         </tr>
90                         <tr>
91                                 <th>{"Your email address"|_}:</th>
92                                 <td><input type="text" name="email" value="{$email}" size="30" onkeypress="return focusNext(this.form, 'password', event)"></td>
93                         </tr>
94                         <tr>
95                                 <th>{"Password"|_}:</th>
96                                 <td><input type="password" name="password" size="30" onkeypress="return focusNext(this.form, 'password_again', event)"></td>
97                         </tr>
98             <tr>
99                 <th>{"Password (again)"|_}:</th>
100                 <td><input type="password" name="password_again" size="30" onkeypress="return focusNext(this.form, 'form_submit', event)"></td>
101             </tr>
102             <tr>
103                 <th></th>
104                 <td>
105                     <div id="form_errormsg" class="errormsg">
106                                         {if $error != null}
107                                                   {$error}
108                                         {/if}
109                                         </div>
110                 <input class="submit" type="submit" name="form_submit" value="{"Sign-up"|_}" onclick="if (validateForm(this.form)) this.form.submit()">
111                 </td>
112             </tr>
113         </table>
114     </form>
115
116     <hr>
117
118     <p>
119         <b>{"Please note"|_}</b>:
120         {"The user account will be created, and all data verification checks will be performed.  There <em>will not</em> be a verification email sent to the address entered."|_}
121     </p>
122
123 </fieldset>
124
125     <script type="text/javascript">
126         <!--
127         {literal}
128                 var messages = {
129         {/literal}
130                   username_required: "{'Username is required.'|_}",
131                   username_invalid: "{'Username contains invalid characters.'|_}",
132                   email_invalid: "{'The email address must be valid (i.e. user@domain.com). Please understand that we also black-listed various temporary-email-address providers.'|_}",
133                   password_empty: "{'A password of at least 6 characters is required.'|_}",
134                   password_invalid: "{'Password contains invalid characters.'|_}",
135                   password_twice: "{'You must type your password twice.'|_}",
136                   password_match: "{'Passwords do not match.'|_}",
137                   password_short: "{'Password is too short, it must be 6 characters minimum'|_}"
138         {literal}
139                 };
140
141         document.getElementById("form_username").focus();
142
143                 function validateForm(form) {
144                   if (!isValidUsername(form.username)) {
145                         if (isEmpty(form.username))
146                           document.getElementById("form_errormsg").innerHTML = messages.username_required;
147                         else
148                           document.getElementById("form_errormsg").innerHTML = messages.username_invalid;
149
150                         return false;
151                   }
152
153                   if (!isValidEmail(form.email)) {
154                         document.getElementById("form_errormsg").innerHTML = messages.email_invalid;
155                         return false;
156                   }
157
158                   if (!isValidPassword(form.password)) {
159                         if (isEmpty(form.password))
160                           document.getElementById("form_errormsg").innerHTML = messages.password_empty;
161                         else if (form.password.value.length<6)
162                           document.getElementById("form_errormsg").innerHTML = messages.password_short;
163                         else
164                           document.getElementById("form_errormsg").innerHTML = messages.password_invalid;
165
166                         return false;
167                   }
168
169                   if (isEmpty(form.password_again)) {
170                         document.getElementById("form_errormsg").innerHTML = messages.password_twice;
171                         focusElement(form.name, 'password_again');
172                         return false;
173                   }
174
175                   if (form.password.value != form.password_again.value) {
176                         document.getElementById("form_errormsg").innerHTML = messages.password_match;
177                         focusElement(form.name, 'password_again');
178                         return false;
179                   }
180
181                   return true;
182                 }
183
184                 {/literal}
185         //-->
186     </script>
187 {*
188     END section MAINCONTENT
189 *}
190 {/if}