doc/developer/ClosedNetwork: Authenticator_getLoginForm.tpl

File Authenticator_getLoginForm.tpl, 4.7 kB (added by Andrew Hodel, 7 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  * Login page
38  *
39  * @package    WiFiDogAuthServer
40  * @subpackage Templates
41  * @author     Andrew Hodel
42  * @author     Max Horváth <max.horvath@freenet.de>
43  * @copyright  2006 Max Horváth, Horvath Web Consulting
44  * @version    Subversion $Id: $
45  * @link       http://www.wifidog.org/
46  */
47
48 *}
49                 <h1>{"Login or Signup here"|_}:</h1>
50                         <p>
51             {$selectNetworkUI}
52             </p>
53                         {if $user_id}
54                             <input type="hidden" name="user_id" id="form_user_id" value="{$user_id}"/>
55                         {else}
56                 {"Username (or email)"|_}:<br/>
57                 <input type="text" name="username" id="form_username" tabindex="1" value="{$username}" size="20" /><br/>
58             {/if}
59             {"Password"|_}:<br/>
60             <input type="password" name="password" id="form_password" tabindex="2" size="20" /><br/>
61
62             <div id="form_errormsg" class="errormsg">
63                         {if $error == null}
64                           &nbsp;
65                         {else}
66                           {$error}
67                         {/if}
68                         </div>
69
70             <input class="submit" type="submit" tabindex="3" name="login_form_submit" value="{"Login"|_}" onclick="return validateForm(this.form);"/>&nbsp;
71             <input class="submitnewaccount" type="submit" tabindex="4" name="form_signup" value="{"Create a free account"|_}" onclick="location.href='{$base_ssl_path}signup.php';" />
72     <script type="text/javascript">
73         <!--
74                 {literal}
75                 var messages = {
76                 {/literal}
77                   empty_form: "{"You must specify your username and password"|_}",
78                   username_required: "{'Username is required.'|_}",
79                   username_invalid: "{'Username contains invalid characters.'|_}",
80                   email_invalid: "{'A valid email address is required.'|_}",
81                   password_empty: "{'A password is required.'|_}",
82                   password_invalid: "{'Password contains invalid characters.'|_}",
83                   password_short: "{'Password is too short, it must be 6 characters minimum'|_}"
84                 {literal}
85                 };
86
87                 document.getElementById("form_username").focus();
88
89                 function validateForm(form) {
90                   if (!isValidUsername(form.username)) {
91                         if (isEmpty(form.username)) {
92                           document.getElementById("form_errormsg").innerHTML = messages.username_required;
93                           return false;
94                         }
95                         else {
96                           if (!isValidEmail(form.username)) {
97                                 document.getElementById("form_errormsg").innerHTML = messages.username_invalid;
98                                 return false;
99                           }
100                         }
101                   }
102
103
104                         if (isEmpty(form.password)){
105                           document.getElementById("form_errormsg").innerHTML = messages.password_empty;
106                         return false;
107                   }
108
109                   return true;
110                 }
111
112                 {/literal}
113         //-->
114     </script>