Show
Ignore:
Timestamp:
04/23/06 10:09:18 (7 years ago)
Author:
rob_janes
Message:

* javascript for validating and navigating forms.
* help text (untranslated).
* EVENT_LOGGING enabling/disabling flag.
* use SYSTEM_PATH instead of BASE_URL_PATH and BASE_SSL_PATH where ever appropriate.
* standardize Smarty variables for Network and User info by adding assignSmartyValues($smarty, $self) to Network and User.
* change_password only allowed if logged in.
* non-superadmin can only use change_password to change their own password.
* superadmin can use change_password to change any user password by entering in their password for the old password.
* page_header div defined and positioned in MainUI

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/wifidog-auth/wifidog/templates/sites/signup.tpl

    r955 r1018  
    3535 
    3636/** 
    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  */ 
     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*/ 
    5050 
    5151*} 
     
    5353{if $sectionTOOLCONTENT} 
    5454{* 
    55     BEGIN section TOOLCONTENT 
    56 *} 
    57     <div id="login_form"> 
    58         <h1>{"I'm having difficulties"|_}:</h1> 
    59  
     55BEGIN section TOOLCONTENT 
     56*} 
     57<div id="login_form"> 
     58        <h1>{"I'm having difficulties"|_}:</h1> 
     59 
     60        <ul> 
     61                <li><a href="{$system_path}lost_username.php">{"I Forgot my username"|_}</a></li> 
     62                <li><a href="{$system_path}lost_password.php">{"I Forgot my password"|_}</a></li> 
     63                <li><a href="{$system_path}resend_validation.php">{"Re-send the validation email"|_}</a></li> 
     64                <li><a href="{$system_path}faq.php">{"Frequently asked questions"|_}</a></li> 
     65        </ul> 
     66</div> 
     67{* 
     68END section TOOLCONTENT 
     69*} 
     70{/if} 
     71 
     72{if $sectionMAINCONTENT} 
     73{* 
     74BEGIN 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> 
    60129        <ul> 
    61             <li><a href="{$base_ssl_path}lost_username.php">{"I Forgot my username"|_}</a></li> 
    62             <li><a href="{$base_ssl_path}lost_password.php">{"I Forgot my password"|_}</a></li> 
    63             <li><a href="{$base_ssl_path}resend_validation.php">{"Re-send the validation email"|_}</a></li> 
    64             <li><a href="{$base_ssl_path}faq.php">{"Frequently asked questions"|_}</a></li> 
     130            <li><a href="{$system_path}lost_username.php">{"I Forgot my username"|_}</a></li> 
     131            <li><a href="{$system_path}lost_password.php">{"I Forgot my password"|_}</a></li> 
    65132        </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"> 
    80             {if $SelectNetworkUI} 
    81                 {$SelectNetworkUI} 
    82             {/if} 
    83  
    84             <table> 
    85                 <tr> 
    86                     <th>{"Username desired"|_}:</th> 
    87                     <td><input type="text" name="username" value="{$username}" size="30" id="form_username"></td> 
    88                 </tr> 
    89                 <tr> 
    90                     <th>{"Your email address"|_}:</th> 
    91                     <td><input type="text" name="email" value="{$email}" size="30"></td> 
    92                 </tr> 
    93                 <tr> 
    94                     <th>{"Password"|_}:</th> 
    95                     <td><input type="password" name="password" size="30"></td> 
    96                 </tr> 
    97                 <tr> 
    98                     <th>{"Password (again)"|_}:</th> 
    99                     <td><input type="password" name="password_again" size="30"></td> 
    100                 </tr> 
    101                 <tr> 
    102                     <th></th> 
    103                     <td><input class="submit" type="submit" name="submit" value="{"Sign-up"|_}"></td> 
    104                 </tr> 
    105             </table> 
    106         </form> 
    107  
    108         <hr> 
    109  
    110         <p> 
    111             <b>{"Please note"|_}</b>: 
    112             {"While accounts are free, we <em>strongly</em> suggest that you use your previously created account if you have one."|_} 
    113         </p> 
    114  
    115         <p> 
    116             <b>{"Note to free web-based email users"|_}</b>: 
    117             {"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."|_} 
    118         </p> 
    119  
    120         <p> 
    121             <b>{"You can also use the following links if you need help"|_}:</b> 
    122             <ul> 
    123                 <li><a href="{$smarty.const.BASE_SSL_PATH}lost_username.php">{"I Forgot my username"|_}</a></li> 
    124                 <li><a href="{$smarty.const.BASE_SSL_PATH}lost_password.php">{"I Forgot my password"|_}</a></li> 
    125             </ul> 
    126         </p> 
    127     </fieldset> 
    128  
    129     <div id="help"> 
    130         {if $error} 
    131             <div class="errormsg">{$error}</div> 
    132         {else} 
    133             {"Your email address must be valid in order for your account to be activated"|_}. 
     133    </p> 
     134</fieldset> 
     135 
     136    <div id="form_errormsg" class="errormsg"> 
     137        {if $error != null} 
     138                  {$error} 
    134139        {/if} 
    135     </div> 
     140        </div> 
    136141 
    137142    <script type="text/javascript"> 
    138143        <!-- 
    139             document.getElementById("form_username").focus(); 
     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} 
    140202        //--> 
    141203    </script>