| 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 | * Sign up page |
|---|
| 38 | * |
|---|
| 39 | * @package WiFiDogAuthServer |
|---|
| 40 | * @subpackage Templates |
|---|
| 41 | * @author Philippe April |
|---|
| 42 | * @author Benoit Gregoire <bock@step.polymtl.ca> |
|---|
| 43 | * @author Max Horvath <max.horvath@maxspot.de> |
|---|
| 44 | * @copyright 2004-2006 Philippe April |
|---|
| 45 | * @copyright 2004-2006 Benoit Gregoire, Technologies Coeus inc. |
|---|
| 46 | * @copyright 2006 Max Horvath, maxspot GmbH |
|---|
| 47 | * @version Subversion $Id$ |
|---|
| 48 | * @link http://www.wifidog.org/ |
|---|
| 49 | */ |
|---|
| 50 | |
|---|
| 51 | *} |
|---|
| 52 | |
|---|
| 53 | {if $sectionTOOLCONTENT} |
|---|
| 54 | {* |
|---|
| 55 | BEGIN section TOOLCONTENT |
|---|
| 56 | *} |
|---|
| 57 | <div id="login_form"> |
|---|
| 58 | <h1>{"I'm having difficulties"|_}:</h1> |
|---|
| 59 | |
|---|
| 60 | <ul> |
|---|
| 61 | <li><a href="{$base_url_path}lost_username.php">{"I Forgot my username"|_}</a></li> |
|---|
| 62 | <li><a href="{$base_url_path}lost_password.php">{"I Forgot my password"|_}</a></li> |
|---|
| 63 | <li><a href="{$base_url_path}resend_validation.php">{"Re-send the validation email"|_}</a></li> |
|---|
| 64 | <li><a href="{$base_url_path}faq.php">{"Frequently asked questions"|_}</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>{"Register a free account with"|_} {$hotspot_network_name}</legend> |
|---|
| 78 | |
|---|
| 79 | <form name="signup_form" method="post" onsubmit="return false" action="{$base_ssl_path}signup.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><input class="submit" type="submit" name="form_submit" value="{"Sign-up"|_}" onclick="if (validateForm(this.form)) this.form.submit()"></td> |
|---|
| 105 | </tr> |
|---|
| 106 | </table> |
|---|
| 107 | </form> |
|---|
| 108 | |
|---|
| 109 | <hr> |
|---|
| 110 | |
|---|
| 111 | <p> |
|---|
| 112 | <b>{"Please note"|_}</b>: |
|---|
| 113 | {"While accounts are free, we <em>strongly</em> suggest that you use your previously created account if you have one."|_} |
|---|
| 114 | </p> |
|---|
| 115 | |
|---|
| 116 | <p> |
|---|
| 117 | {"<b>Your email address must be valid</b> in order for your account to be activated."|_} |
|---|
| 118 | {"A validation email will be sent to that email address."|_} |
|---|
| 119 | {"To fully activate your account you must respond to that email."|_} |
|---|
| 120 | </p> |
|---|
| 121 | |
|---|
| 122 | <p> |
|---|
| 123 | <b>{"Note to free web-based email users"|_}</b>: |
|---|
| 124 | {"Sometimes our validation email ends up in the 'spam' folder of some providers. If you have not received any email with the validation URL 5 minutes after submitting this form, please take a look in the spam folder."|_} |
|---|
| 125 | </p> |
|---|
| 126 | |
|---|
| 127 | <p> |
|---|
| 128 | <b>{"You can also use the following links if you need help"|_}:</b> |
|---|
| 129 | <ul> |
|---|
| 130 | <li><a href="{$base_url_path}lost_username.php">{"I Forgot my username"|_}</a></li> |
|---|
| 131 | <li><a href="{$base_url_path}lost_password.php">{"I Forgot my password"|_}</a></li> |
|---|
| 132 | </ul> |
|---|
| 133 | </p> |
|---|
| 134 | </fieldset> |
|---|
| 135 | |
|---|
| 136 | <div id="form_errormsg" class="errormsg"> |
|---|
| 137 | {if $error != null} |
|---|
| 138 | {$error} |
|---|
| 139 | {/if} |
|---|
| 140 | </div> |
|---|
| 141 | |
|---|
| 142 | <script type="text/javascript"> |
|---|
| 143 | <!-- |
|---|
| 144 | {literal} |
|---|
| 145 | var messages = { |
|---|
| 146 | {/literal} |
|---|
| 147 | username_required: "{'Username is required.'|_}", |
|---|
| 148 | username_invalid: "{'Username contains invalid characters.'|_}", |
|---|
| 149 | 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.'|_}", |
|---|
| 150 | password_empty: "{'A password of at least 6 characters is required.'|_}", |
|---|
| 151 | password_invalid: "{'Password contains invalid characters.'|_}", |
|---|
| 152 | password_twice: "{'You must type your password twice.'|_}", |
|---|
| 153 | password_match: "{'Passwords do not match.'|_}", |
|---|
| 154 | password_short: "{'Password is too short, it must be 6 characters minimum'|_}" |
|---|
| 155 | {literal} |
|---|
| 156 | }; |
|---|
| 157 | |
|---|
| 158 | document.getElementById("form_username").focus(); |
|---|
| 159 | |
|---|
| 160 | function validateForm(form) { |
|---|
| 161 | if (!isValidUsername(form.username)) { |
|---|
| 162 | if (isEmpty(form.username)) |
|---|
| 163 | document.getElementById("form_errormsg").innerHTML = messages.username_required; |
|---|
| 164 | else |
|---|
| 165 | document.getElementById("form_errormsg").innerHTML = messages.username_invalid; |
|---|
| 166 | |
|---|
| 167 | return false; |
|---|
| 168 | } |
|---|
| 169 | |
|---|
| 170 | if (!isValidEmail(form.email)) { |
|---|
| 171 | document.getElementById("form_errormsg").innerHTML = messages.email_invalid; |
|---|
| 172 | return false; |
|---|
| 173 | } |
|---|
| 174 | |
|---|
| 175 | if (!isValidPassword(form.password)) { |
|---|
| 176 | if (isEmpty(form.password)) |
|---|
| 177 | document.getElementById("form_errormsg").innerHTML = messages.password_empty; |
|---|
| 178 | else if (form.password.value.length<6) |
|---|
| 179 | document.getElementById("form_errormsg").innerHTML = messages.password_short; |
|---|
| 180 | else |
|---|
| 181 | document.getElementById("form_errormsg").innerHTML = messages.password_invalid; |
|---|
| 182 | |
|---|
| 183 | return false; |
|---|
| 184 | } |
|---|
| 185 | |
|---|
| 186 | if (isEmpty(form.password_again)) { |
|---|
| 187 | document.getElementById("form_errormsg").innerHTML = messages.password_twice; |
|---|
| 188 | focusElement(form.name, 'password_again'); |
|---|
| 189 | return false; |
|---|
| 190 | } |
|---|
| 191 | |
|---|
| 192 | if (form.password.value != form.password_again.value) { |
|---|
| 193 | document.getElementById("form_errormsg").innerHTML = messages.password_match; |
|---|
| 194 | focusElement(form.name, 'password_again'); |
|---|
| 195 | return false; |
|---|
| 196 | } |
|---|
| 197 | |
|---|
| 198 | return true; |
|---|
| 199 | } |
|---|
| 200 | |
|---|
| 201 | {/literal} |
|---|
| 202 | //--> |
|---|
| 203 | </script> |
|---|
| 204 | {* |
|---|
| 205 | END section MAINCONTENT |
|---|
| 206 | *} |
|---|
| 207 | {/if} |
|---|