Location: PHPKode > projects > MembersGear > membersgear/templates/admin_generate_configuration.tpl
{$ADMIN_HEADER}
<div id="content" class="setdiv">
  {*  <div id="contentdiv">
        <div class="leftdiv">
            <div class="righttop">
                <h2>
                    Welcome To SafelistProX 3.2.1 Control Panel</h2>
            </div>
            <div class="contant divborder">
                The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the
                lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps
                over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown
                fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick
                brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
                The quick brown fox jumps over the lazy dog.
                <div class="link-set clear">
                    <a href="#">read more...</a></div>
            </div>
        </div>
        <div class="rightdiv">
            <div class="righttop">
                <h2>
                    Your Safelist Overview</h2>
            </div>
            <div class="contant divborder">
                The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the
                lazy dog. The quick brown fox jumps over the lazy dog. The quick brown fox jumps
                over the lazy dog. The quick brown fox jumps over the lazy dog. The quick brown
                fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog. The quick
                brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.
                The quick brown fox jumps over the lazy dog.
                <div class="link-set clear">
                    <a href="#">read more...</a></div>
            </div>
        </div>
    </div>  *}
    
    {if $msg neq ''}
            <div class="succmsg" style="width:300px">{$msg}</div>
           {/if} 
    <div id="full-contentdiv">
          <div class="righttop">
                <h2><center>
                    Configuration</h2>                                      
            </center></div>
         <div class="whole-page clear">
        
            <!-- Place your content here -->
              <form method="post" name="configureMessages">
              <div class="formformat">      
                 <table    width="100%"  cellpadding="0" cellspacing="0" >    
                  <tbody>
                  
                        <tr>
                            <td valign="top" style="padding-top: 5px;" colspan="2">

                                <p style="text-align: center"><b>Signup Form Configuration</b>   
                            </td>
                        </tr>
                        <tr>
                           <td class="right-side-text" width="50%"><label>Generate username</label><div class="FieldLabelNote" >(should member site generate username for customer?)</div></td>
                            
                            <td class="left-side-text" width="50%">
                             {if $MEMBER_GENERATE_USERNAME eq 'false' or $MEMBER_GENERATE_USERNAME eq '' }
                                  <input type="checkbox" value="true" class="chkcss" name="generate_login" id="generate_login" style="border-width: 0px;"/>    
                             {else}
                                <input type="checkbox" value="true"class="chkcss" name="generate_login"  id="generate_login" checked style="border-width: 0px;"/>
                                
                              {/if}       
                            </td>
                        </tr>
                         <tr>
                            <td class="right-side-text" width="50%"><label>Generate username Prefix <label class="star">*</label></td>
                           <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255" size="10"  class="txtcss" name="generate_login_prefix"  id="generate_login_prefix" value="{$MEMBER_GENERATE_USERNAME_PREFIX}"/>
                            </td>

                        </tr>
                         <tr>
                          <td class="right-side-text" width="50%"><label>Login minimum length <label class="star">*</label></label></td>
                           <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255"  class="txtcss" size="5"  name="login_min_length" id="login_min_length" value="{$MEMBER_LOGIN_MIN_LENGTH}"/>
                            </td>

                        </tr>
                         <tr>
                             <td class="right-side-text" width="50%"><label>Login maximum length <label class="star">*</label></label></td>
                             <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255"  class="txtcss" size="5"  name="login_max_length"  id="login_max_length" value="{$MEMBER_LOGIN_MAX_LENGTH}"/>
                            </td>
                        </tr>

                         <tr>
                            <td class="right-side-text" width="50%"><label>Generate password</label><div class="FieldLabelNote" >(should Member Site generate password for customer?)</div></td>
                           <td class="left-side-text" width="50%">
                              {if $MEMBER_GENERATE_PASSWORD eq 'false' or $MEMBER_GENERATE_PASSWORD eq ''  }
                                 <input type="checkbox" value="true" class="chkcss" name="generate_password"  id="generate_password" style="border-width: 0px;"/>   
                              {else}
                                   <input type="checkbox" value="true" class="chkcss" name="generate_password"  id="generate_password" checked style="border-width: 0px;"/>
                              {/if}
                            </td>
                        </tr>
                                <tr>

                            <td class="right-side-text" width="50%"><label>Password minimum length <label class="star">*</label></label></td>
                            <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255"   class="txtcss" size="5"  name="pass_min_length" id="pass_min_length" value="{$MEMBER_PASSWORD_MIN_LENGTH}"/>
                            </td>
                        </tr>
                        <tr>
                            <td class="right-side-text" width="50%"><label>Password maximum length <label class="star">*</label></label></td>

                            <td class="left-side-text" width="50%">
                                <input type="text" maxlength="255" size="5"   class="txtcss" name="pass_max_length"  id="pass_max_length" value="{$MEMBER_PASSWORD_MAX_LENGTH}"/>
                            </td>
                        </tr>
                        <tr>
                             <td class="right-side-text" width="50%"><label>Require unique Email</label><div class="FieldLabelNote" >(require unique email address for each member)</div></td>
                            <td class="left-side-text" width="50%">
                            {if $MEMBER_UNIQUE_EMAIL eq 'false' or $MEMBER_UNIQUE_EMAIL eq '' }
                              <input type="checkbox" value="true" class="chkcss" name="unique_email"  id="unique_email" style="border-width: 0px;"/>
                            {else}
                               <input type="checkbox" value="true"  class="chkcss" name="unique_email"  id="unique_email" checked style="border-width: 0px;"/>
                             {/if}  
                            </td>
                        </tr>
                        
                         
                        <tr>
                            <td class="right-side-text" width="50%"><label>Use address Info</label><div class="FieldLabelNote" >(display address fields in the member forms)</div></td>
                           <td class="left-side-text" width="50%"> 
                                <select size="1" class="selectcss"  name="use_address_info" id="use_address_info">
                                  {if $MEMBER_USE_ADDRESS_INFO eq 'invisible'}
                                     <option value="invisible" selected>Invisible</option>
                                  {else}
                                      <option value="invisible">Invisible</option> 
                                   {/if}
                                   {if $MEMBER_USE_ADDRESS_INFO eq 'visible_required'}   
                                     <option  value="visible_required" selected >Visible and Required</option>
                                   {else}
                                      <option  value="visible_required"  >Visible and Required</option>  
                                   {/if}
                                   {if $MEMBER_USE_ADDRESS_INFO eq 'visible_optional'}
                                      <option value="visible_optional" selected>Visible but Optional</option>
                                   {else}
                                      <option value="visible_optional">Visible but Optional</option> 
                                  {/if}        
                                </select>

                            </td>
                        </tr>
                        <tr style="display:none">
                            <td class="right-side-text" width="50%"><label>Display Currency <label class="star">*</label></label><div class="FieldLabelNote" >(currency to be displayed on membership and signup pages
                                                           NOTE - it is display change only - real price/currency change must be
                                                                made in product settings and not all payment processors allow you to
                                                                change currency. Make sure that EACH enabled payment processor will work
                                                                in selected currency.)</div>
                            </td>
                            <td class="left-side-text" width="50%"> 
                                <input type="text" maxlength="255"  class="txtcss" size="6"  name="currency" id="currency"  value="{$MEMBER_CURRENCY}"/>
                            </td>

                        </tr> 
                          <tr>
                            <td class="right-side-text" width="50%"><label>Validate User</label> <label class="star">*</label><div class="FieldLabelNote" >(Activation  email will be sent if this option is set to "true")</div></td>
                           <td class="left-side-text" width="50%"> 
                                <select size="1" class="selectcss"  name="ddluservalidate" id="ddluservalidate">
                                   <option value="0">Select.</option>
                                  {if $MEMBER_USE_VALIDATE_INFO eq 'true'}
                                     <option value="true" selected>Yes</option>
                                  {else}
                                      <option value="true">Yes</option> 
                                   {/if}
                                   {if $MEMBER_USE_VALIDATE_INFO eq 'false'}   
                                     <option  value="false" selected >No</option>
                                   {else}
                                      <option  value="false">No</option>  
                                   {/if}
                                     
                                </select>

                            </td>
                        </tr>
                        
                      
                        <tr>
                            <td valign="top" style="padding-top: 5px;" colspan="2">

                                <p style="text-align: center"><b>Global Configuration</b>   
                            </td>
                        </tr>
                         <tr>
                            <td class="right-side-text" width="50%"><label>Livemode</label></td>
                              <td class="left-side-text" width="50%">
                                 {if $LIVE_MODE eq 'false' or $LIVE_MODE eq '' }
                              <input type="checkbox" value="true" class="chkcss"  name="live_mode"  id="live_mode" style="border-width: 0px;"/>
                            {else}
                               <input type="checkbox" value="true" class="txtcss" name="live_mode" id="live_mode" checked style="border-width: 0px;"/>
                             {/if}  
                            </td>
                        </tr>
                        <tr>
                            <td class="right-side-text" width="50%"><label>Web url <label class="star">*</label></label></td>
                             <td class="left-side-text" width="50%"> 
                                <input type="text" maxlength="255" class="txtcss" size="75" name="wbe_url" id="wbe_url"  value="{$WEB_URL}"/>
                            </td>
                        </tr>
                        <tr>
                             <td class="right-side-text" width="50%"><label>Secure Web url <label class="star">*</label></label></td>
                              <td class="left-side-text" width="50%">  
                                <input type="text" maxlength="255"  class="txtcss"  size="75"  name="web_url_secure" id="web_url_secure" value="{$WEB_URL_SECURE}"/>
                            </td>
                        </tr>
                        <tr>
                             <td class="right-side-text" width="50%"><label>Site title <label class="star">*</label></label></td>
                            <td class="left-side-text" width="50%"> 
                                <input type="text" maxlength="255" size="25" class="txtcss"  name="site_title" id="site_title" value="{$WEB_TITLE}"/>
                            </td>
                        </tr>
                          <tr>
                              <td class="right-side-text" width="50%"><label>Logout url <label class="star">*</label></label></td>
                              <td class="left-side-text " width="50%">
                                <input type="text" maxlength="255" size="75" class="txtcss"  name="logout_url" id="logout_url" value="{$USER_LOGOUT_URL}"/>
                            </td>
                        </tr>
                         <tr>
                              <td class="right-side-text" width="50%"><label>Maximum login attempt <label class="star">*</label></label></td>
                              <td class="left-side-text" width="50%">  
                                <input type="text" maxlength="255"  name="max_login_attemp"  id="max_login_attemp"  class="txtcss" size="5" maxlength="255"  value="{$USER_MAX_LOGIN_ATTAMPT}"/>
                            </td>
                        </tr>
                         <tr>
                            <td class="right-side-text" width="50%"><label>Show Support Email Page<label class="star">*</label></label></td>
                           <td class="left-side-text" width="50%"> 
                                <select size="1" class="selectcss"  id="show_support_email" name="show_support_email">
                                  <option value="0" selected>Select.</option>
                                  {if $IS_USER_SUPPORT_LINK_VISIBLE eq 'true'}
                                     <option value="true" selected>Yes</option>
                                  {else}
                                      <option value="true">Yes</option> 
                                   {/if}
                                   {if $IS_USER_SUPPORT_LINK_VISIBLE eq 'false'}   
                                     <option  value="no" selected >No</option>
                                   {else}
                                      <option  value="no">No</option>  
                                   {/if}
                                </select>

                            </td>
                        </tr>
                           <tr>
                            <td class="right-side-text" width="50%"><label>Show Affilate Link <label class="star">*</label></label></td>
                           <td class="left-side-text" width="50%"> 
                                <select size="1" class="selectcss"  id="show_affiliate" name="show_affiliate">
                                  <option value="0" selected>Select.</option>
                                  {if $SHOW_AFFILIATE eq 'true'}
                                     <option value="true" selected>Yes</option>
                                  {else}
                                      <option value="true">Yes</option> 
                                   {/if}
                                   {if $SHOW_AFFILIATE eq 'false'}   
                                     <option  value="no" selected >No</option>
                                   {else}
                                      <option  value="no">No</option>  
                                   {/if}
                                </select>

                            </td>
                        </tr>
                          <tr>
                             <td class="right-side-text" width="50%"> &nbsp;</td>
                           <td class="buttontd" width="50%">
                                <input  type="submit" value="Update Configuration"  class="btncss" align="middle">&nbsp;&nbsp;&nbsp;
                                <input  class="btncss" type="button" name="btnBack" value="Cancel" onclick="javascript:location.href='./index.php';">

                            </td>
                        </tr>
                        
                        
                </tbody>
           </table>
           </div>
        </form>
    </div>
</div>
        {literal}
          <script language="JavaScript" type="text/javascript">
              var frmvalidator  = new Validator("configureMessages");
              frmvalidator.EnableMsgsTogether();

              frmvalidator.addValidation("login_min_length","req","Please enter value of Login Minimum Length.");
               frmvalidator.addValidation("generate_login_prefix","req","Please enter value of Generate Login Prefix.");
              frmvalidator.addValidation("login_min_length","numeric","Please enter only numeric value in Login Minimum Length.");   
                     
              frmvalidator.addValidation("login_min_length","maxlen=255","Max length for Login Minimum Length is 255.");
              frmvalidator.addValidation("login_max_length","req","Please value of Login Maximum Length."); 
              frmvalidator.addValidation("login_max_length","numeric","Please enter only numeric value in Login Maximum Length."); 
               frmvalidator.addValidation("login_max_length","maxlen=255","Max length for Login Maximum Length is 255.");         
               frmvalidator.addValidation("pass_min_length","req","Please enter value of Password Minimum Length.");
               frmvalidator.addValidation("pass_min_length","numeric","Please enter only numeric value in Password Minimum Length.");
              frmvalidator.addValidation("pass_min_length","maxlen=255","Max length for Password Minimum Length is 255.");
              
              frmvalidator.addValidation("pass_max_length","req","Please enter value of Password Maximum Length.");
              frmvalidator.addValidation("pass_max_length","numeric","Please enter only numeric value in Password Maximum Length.");
              frmvalidator.addValidation("pass_max_length","maxlen=255","Max length for Password Maximum Length is 255.");
              
              frmvalidator.addValidation("currency","req","Please enter value of Currency."); 
              
              frmvalidator.addValidation("ddluservalidate","dontselect=0","Please select Validate User."); 
                                                                                                                      
             frmvalidator.addValidation("wbe_url","req","Please enter value of Web Url."); 
             frmvalidator.addValidation("web_url_secure","req","Please enter value of Secure Web Url.");   
             frmvalidator.addValidation("site_title","req","Please enter value of Site Title."); 
             frmvalidator.addValidation("logout_url","req","Please enter value of Logout Url."); 
              frmvalidator.addValidation("max_login_attemp","req","Please enter value Maximum Login Attempt.");  
             frmvalidator.addValidation("max_login_attemp","maxlen=255","Max length for Maximum Login Attempt is 255.");   
             frmvalidator.addValidation("max_login_attemp","numeric","Please enter only numeric value in Maximum Login Attempt."); 
             frmvalidator.addValidation("show_support_email","dontselect=0","Please select Show support email page option."); 
             frmvalidator.addValidation("show_affiliate","dontselect=0","Please select Show affiliate link page option."); 
  
             
             frmvalidator.setAddnlValidationFunction("weburlValidation"); 
             //frmvalidator.setAddnlValidationFunction("weburlsecurevalidation"); 
             //frmvalidator.setAddnlValidationFunction("logouturlvalidation");
             function weburlValidation()
                {
                  var frm = document.forms["configureMessages"];
                  if(!is_valid_URL(frm.wbe_url.value))
                  {
                    
                    alert('Please enter valid Web Url.');
                     document.getElementById('wbe_url').focus(); 
                    return false;
                  }
                  
                  else if(!weburlsecurevalidation())
                   {
                    alert('Please enter valid Secure Web Url.');
                   document.getElementById('web_url_secure').focus(); 
                   return false;
                   } 
                   else if(!logouturlvalidation())
                    {
                     
                    alert('Please enter valid Logout Url.');
                    document.getElementById('logout_url').focus();
                    return false;
                    }
                     else if(checkvaluepassusername("1")==false)
                     {
                         alert("Login Minimum Length should not 0."); 
                         document.getElementById('login_min_length').focus();   
                         return false;  
                     
                     }
                      else if(checkvaluepassusername("2")==false)
                     {
                         alert('Login Maximum Length should not 0.'); 
                         document.getElementById('login_max_length').focus();   
                         return false;  
                     
                     }
                     else if(checkLoginlength()==false)
                     {
                        alert('Login Minimum Length should not greater than Login Maximum Length.');
                         document.getElementById('login_min_length').focus();
                         return false;  
                     }
                       else if(checkvaluepassusername("3")==false)
                     {
                         alert('Password Minimum Length should not 0.'); 
                         document.getElementById('pass_min_length').focus();   
                         return false;  
                     
                     }
                       else if(checkvaluepassusername("4")==false)
                     {
                         alert('Password Maximum Length should not 0.'); 
                         document.getElementById('pass_max_length').focus();   
                         return false;  
                     
                     }
                    else if(checkpasswordlength()==false)
                     {
                     
                        alert('Password Minimum Length should not greater than Password maximum Length.'); 
                         document.getElementById('pass_min_length').focus();   
                         return false;  
                     }
                     else if(checkvaluepassusername("5")==false)
                     {
                         alert('Login Maximum Attempt should not 0.'); 
                         document.getElementById('max_login_attemp').focus();   
                         return false;  
                     
                     }
                     
                     else
                     {
                        return true;
                     
                     }
                   
                  
                }
                function checkLoginlength()
                {
                     var frm = document.forms["configureMessages"];  
                     if(parseInt(frm.login_min_length.value)<=parseInt(frm.login_max_length.value))
                     {
                   
                       return true;
                     
                     }
                     else
                     {
                      
                      return false;
                     }
                }
                function checkpasswordlength()
                {
                     var frm = document.forms["configureMessages"];  
                     if(parseInt(frm.pass_min_length.value)<=parseInt(frm.pass_max_length.value))
                     {
                           
                       return true;
                     
                     }
                     else
                     {
                      
                      return false;
                     }
                }
                function checkvaluepassusername(order)
                {
                   var frm = document.forms["configureMessages"];
                  // var ans=parseInt(value);
                   var order=parseInt(order);
                   switch (order)
                   {
                            case 1:
                               if(frm.login_min_length.value=="0")
                                {
                                   return false;
                                 
                                }
                                else
                                {
                                    return true;
                                    
                                }
                                break;
                                
                            case 2:
                                if(frm.login_max_length.value=="0")
                                {
                                   return false;
                                   break;
                                }
                                else
                                {
                                return true;
                                }
                                break;
                            case 3:
                               if(frm.pass_min_length.value=="0")
                                {
                                   return false;
                                   break;
                                }
                                else
                                {
                                return true;
                                }
                                break;
                              break;
                            case 4:
                             if(frm.pass_max_length.value=="0")
                                {
                                   return false;
                                   break;
                                }
                                else
                                {
                                return true;
                                }
                                break;
                             case 5:
                             if(frm.max_login_attemp.value=="0")
                                {
                                   return false;
                                   break;
                                }
                                else
                                {
                                return true;
                                }
                                break;
                             default:  
                           
                   }
                
                }
                
                
                function weburlsecurevalidation()
                {
                  var frm = document.forms["configureMessages"];
                  if(!is_valid_URL(frm.web_url_secure.value))
                  {
                    
                    
                    return false;
                  }
                  else
                  {
                    return true;
                  }
                }
                
                 function logouturlvalidation()
                {
                  var frm = document.forms["configureMessages"];
                  if(!is_valid_URL(frm.logout_url.value))
                  {
                    
                    return false;
                  }
                  else
                  {
                    return true;
                  }
                }
                
             function is_valid_URL(url) {
                    //var regexp = "/^(((ht|f)tp(s?))\:\/\/)?(www.|[a-zA-Z].)[a-zA-Z0-9\-\.]+\.(com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk)(\/:[0-9]+)*(/($|[a-zA-Z0-9\.\,\;\?\'\\\+&%\$#\=~_\-]+))*$/";
                    var regexp=/https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?/;
                    // var regexp = /^(http[s]?:\/\/|ftp:\/\/)?(www\.)?[a-zA-Z0-9-\.]+\.(com|net|org|edu|mil|gov|arpa|biz|aero|name|coop|info|pro|museum|tv|([a-z]{2}))$/;
                     return(regexp.test(url));
                   }
   
                                                            
            </script>
 
        {/literal}
 
 </div>
{$ADMIN_FOOTER}
Return current item: MembersGear