Location: PHPKode > projects > MembersGear > membersgear/templates/user_login.tpl
{*update by jayesh*}
 <script language="javascript" type="text/javascript" src="{$WEB_URL}/js/functions.js"></script>
 </script>
 {if $msg neq ''}
              <div class="errormsg" align="center">
                  {$msg}
             </div>
 {/if}   
<div id="login">
            <div id="login-top"></div>
            <div id="login-bg">
            <div class="subdiv">
                <div class="userdiv">
                <h1>
                    User Login
                </h1>
                        <table cellpadding="0" cellspacing="5" align="center" style="" id="tablelogin">             
                               <form id="frmlogin" name="frmlogin" method="post" action="?action=dologin">
                                 <tr>
                                    <td class="right-side-text"><label>Username <label class="star">*</label></label></td>
                                    <td class="left-side-text" width="">
                                    <input type="text" name="txtusername"  id="txtusername"  class="txtcss"> 
                                    </td>
                                 </tr>
                                 <tr>
                                    <td class="right-side-text"><label>Password <label class="star">*</label></label></td>
                                    <td class="left-side-text" width="">
                                        <input type="password" name="txtpassword"  id="txtpassword"  class="txtcss">
                                          <input type="hidden" value="{$modUrl}" name="url" id="url" >            
                                          <input type="hidden" value="{$extUrl}" name="exturl" id="exturl">            
                                    </td>
                                 </tr>
                                {if $CAPTCHA_ENABLE_ON_USER_LOGIN_PAGE eq 'true'} 
                                     <tr>
                                          <td class="right-side-text" nowrap="nowrap"><label>Enter Captcha Code <label class="star">*</label></label></td>
                                          <td class="left-side-text">
                                                 <img src="includes/securimage/securimage_show.php?sid={php} echo md5(uniqid(time())); {/php}" id="capchaimg"><br />
                                          </td>
                                     </tr>                
                                     <tr>
                                          <td class="right-side-text"></td>
                                          <td class="left-side-text">
                                                 <input type="text" name="txtSecretCode" id="txtSecretCode" class="txtcss" maxlength="4"/>
                                          </td>
                                     </tr>
                                 {/if}
                                                {*<tr>

                                                    <td class="right-side-text" width="30%"><label>Remember Me</label></td>

                                                   <td class="left-side-text" width="40%">

                                                        <input type="checkbox" name="remember_me" id="remember_me" class="chkcss" value="ON">

                                                    </td>
                                                </tr> *}
                       
                                <tr>
                                    <td class="right-side-text">&nbsp;</td>
                                    <td class="left-side-text" width="">
                                        <input class="small-button" class="btncss" type="submit" value="Login">
                                        <input class="small-button" type="button" value="Reset" onClick="document.frmlogin.reset();return false;">
                                    </td>       
                                </tr> 
                               <tr>
                                    <td class="right-side-text tdusersignup" colspan="2" ><a href="{$WEB_URL}/user_signup.php">New member! Click here to signup</a></td>
                                         
                                </tr>
                        
                        
                            </form>
                           </table>
                </div>
                <div class="forgotpassdiv">
                    <h1>
                            Did you forget your password?
                    </h1>
                            <table cellpadding="0" cellspacing="5" align="center" id="tableforgotpassword">
                                <form name="frmloginforgot" id="frmloginforgot" method="post" action="?action=forgotPassword" onsubmit="return ValidateUsernameOrEmail();">     
                                 <tr> 
                                        <td width="" class="left-side-text" colspan="">
                                             <input type="text" value="Enter Username / Email Address"  onblur="restoreInput(this,'Enter Username / Email Address')" onfocus="return clearInput(this,'Enter Username / Email Address');" class="txtcss" id="txtForgotPasswordValue" name="txtForgotPasswordValue"/>
                                             <input class="big-button" type="submit" value="Get Password">
                                             <!--   <br/><div style="margin-bottom:5px;font-weight:bold;text-align:center;width:100%;">OR</div><br />
                                             <input type="text" value="Enter your Email Address" size="30" onblur="restoreInput(this,'Enter your Email Address');" onfocus="return clearInput(this,'Enter your Email Address');" class="txtcss" id="txtemail" name="txtemail"/><br/>        -->
                                        </td>                       
                                 </tr>                 
                                 <!--<tr>                        
                                     <td class="right-side-text">&nbsp;</td>
                                     <td class="left-side-text" width="" colspan="" style="text-align:center !important;">
                                        <input class="btncss" type="submit" value="Get Password">
                                     </td>
                                 </tr>--> 
                                 </form>          
                            </table>
                </div>
            </div>
            </div>
            <div id="login-bottom"></div>
</div>

{*////////////////*}        
                 {literal}
                     <script language="JavaScript" type="text/javascript">
                              var mem_login_min_len='{/literal}{$MEMBER_LOGIN_MIN_LENGTH}{literal}';
                              var mem_login_max_len='{/literal}{$MEMBER_LOGIN_MAX_LENGTH}{literal}';
                              var mem_pass_min_len='{/literal}{$MEMBER_PASSWORD_MIN_LENGTH}{literal}'; 
                              var mem_pass_max_len ='{/literal}{$MEMBER_PASSWORD_MAX_LENGTH}{literal}';
                              var mem_user_add_info='{/literal}{$MEMBER_USE_ADDRESS_INFO}{literal}';
                              var mem_generate_user='{/literal}{$MEMBER_GENERATE_USERNAME}{literal}'; 
                              var mem_generate_password='{/literal}{$MEMBER_GENERATE_PASSWORD}{literal}'; 
                              
                              var captcha_enable='{/literal}{$CAPTCHA_ENABLE_ON_USER_LOGIN_PAGE}{literal}'; 
                              
                              var username_not_enter ="{/literal}{$MESSAGE_NO_USERNAME_NORMAL}{literal}";
                              var pass_not_enter ="{/literal}{$MESSAGE_NO_PASSWORD_NORMAL}{literal}";
                              var secretcode_not_enter ="{/literal}{$MESSAGE_INVALID_SECURITY_CODE}{literal}";
                                                            
                              var frmvalidator  = new Validator("frmlogin");
                              frmvalidator.EnableMsgsTogether();
                              frmvalidator.addValidation("txtusername","req",username_not_enter);
                              //frmvalidator.addValidation("txtusername","alnum","Please enter valid Username.");  
                              if(parseInt(mem_login_min_len)<=parseInt(mem_login_max_len))
                              {
                                 // frmvalidator.addValidation("txtusername","minlen=mem_login_min_len","Min length  for Username is "+mem_login_min_len+".");  
                                  //frmvalidator.addValidation("txtusername","maxlen=mem_login_max_len","Max length for Username is "+mem_login_max_len+".");
                              }
                              frmvalidator.addValidation("txtpassword","req",pass_not_enter);
                              if(captcha_enable == 'true')
                                    frmvalidator.addValidation("txtSecretCode","req","Please enter captcha code."); 
                              
                               if(parseInt(mem_pass_min_len)<=parseInt(mem_pass_max_len))
                              {
                                 
                                 //frmvalidator.addValidation("txtpassword","minlen=mem_pass_min_len","Min length  for Password is "+mem_pass_min_len+".");
                                // frmvalidator.addValidation("txtpassword","maxlen=mem_pass_max_len","Max length  for Password is "+mem_pass_max_len+".");
                              }
                              
                              //frmvalidator.EnableMsgsTogether();
                                
                             //var frmvalidator1  = new Validator("frmloginforgot");
//                             alert(document.getElementById('txtForgotPasswordValue').value);
//                             frmvalidator1.EnableMsgsTogether();
//                             frmvalidator1.addValidation("txtForgotPasswordValue","req","Please enter either Username or Email Address to recover your password.","document.getElementById('txtForgotPasswordValue').value != 'Enter your User Name or Email Address'");
 
                     </script>
                     <script language="JavaScript" type="text/javascript">
                            function ValidateUsernameOrEmail()
                            {
                                //if(document.getElementById('txtemail').value == 'Enter your Email Address' && document.getElementById('txtusername1').value == 'Enter your User Name')
                                if(document.getElementById('txtForgotPasswordValue').value == 'Enter Username / Email Address')
                                {
                                    alert('Please enter either Username or Email to recover your password');
                                    document.getElementById('txtForgotPasswordValue').focus();
                                    return false;
                                }
                                //else if(document.getElementById('txtusername1').value != 'Enter your User Name' && document.getElementById('txtemail').value != 'Enter your Email Address')
//                                {
//                                      var pattern = "[^A-Za-z0-9\\s]";
//                                      var error = '';
//                                      var controlfocus = '';
//                                      var flag = 0;
//                                      
//                                      if(document.getElementById('txtusername1').value.search(pattern) >= 0)
//                                      {
//                                            error += 'Please enter valid username'+'\r\n';
//                                            controlfocus = 'txtusername1';
//                                            flag = 1;
//                                      }
//                                      
//                                      if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('txtemail').value))){
//                                             error += 'Please enter valid email address.';
//                                             if(flag == 0)
//                                                    controlfocus = 'txtemail';
//                                      }                                                         
//                                      if(error != '')
//                                      {
//                                            alert(error);
//                                            document.getElementById(controlfocus).focus();
//                                            return false;
//                                      }
//                                } 
//                                else if(document.getElementById('txtusername1').value != 'Enter your User Name')
//                                {
//                                      var pattern = "[^A-Za-z0-9\\s]";
//                                      if(document.getElementById('txtusername1').value.search(pattern) >= 0)
//                                      {
//                                            alert('Please enter valid username.');
//                                            document.getElementById('txtusername1').focus();
//                                            return false;
//                                      }
//                                }
//                                else if(document.getElementById('txtemail').value != 'Enter your Email Address')
//                                {
//                                      if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(document.getElementById('txtemail').value))){
//                                             alert('Please enter valid email address.');
//                                             document.getElementById('txtemail').focus();
//                                             return false;
//                                      }
//                                } 
                                return true;
                            }
                     </script>
{/literal}
    
Return current item: MembersGear