Ignore:
Timestamp:
Oct 23, 2013, 5:24:35 PM (11 years ago)
Author:
Eric
Message:

Initial release 2.5.0

Location:
extensions/Password_Policy/admin
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/Password_Policy/admin/PP_admin.php

    r25050 r25089  
    3434
    3535
    36   if (isset($_POST['submit']) and isset($_POST['PP_Password_Enforced']) and isset($_POST['PP_AdminPassword_Enforced']) and isset($_POST['PP_PwdReset']))
     36// +----------------------------------------------------------+
     37// |            FCK Editor for email text fields              |
     38// +----------------------------------------------------------+
     39$toolbar = 'Basic';
     40$width = '750px';
     41$height = '300px';
     42$areas = array();
     43array_push($areas,'PP_CustomLockMsg');
     44
     45if (function_exists('set_fckeditor_instance'))
     46{
     47  $fcke_config = unserialize($conf['FCKEditor']);
     48  foreach($areas as $area)
    3749  {
     50    if (!isset($fcke_config[$area]))
     51    {
     52      $fcke_config[$area] = false;
     53    }
     54  }
     55  $conf['FCKEditor'] = serialize($fcke_config);
     56
     57  set_fckeditor_instance($areas, $toolbar, $width, $height);
     58}
     59
     60
     61  if (isset($_POST['submit']) and isset($_POST['PP_Password_Enforced']) and isset($_POST['PP_AdminPassword_Enforced']) and isset($_POST['PP_PwdReset']) and isset($_POST['PP_LogFailedPassw']))
     62  {
     63    $_POST['PP_CustomLockMsg'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['PP_CustomLockMsg'])));
    3864    // Save global PP configuration
    3965    // -----------------------------
     
    4369    $newconf_PP['ADMINPASSWENF'] = (isset($_POST['PP_AdminPassword_Enforced']) ? $_POST['PP_AdminPassword_Enforced'] : 'false');
    4470    $newconf_PP['PWDRESET'] = (isset($_POST['PP_PwdReset']) ? $_POST['PP_PwdReset'] : 'false');
     71    $newconf_PP['LOGFAILBLOCK'] = (isset($_POST['PP_LogFailedPassw']) ? $_POST['PP_LogFailedPassw'] : 'false');
     72    $newconf_PP['NBLOGFAIL'] = (isset($_POST['PP_NbFailedPassw']) ? $_POST['PP_NbFailedPassw'] : '0');
     73    $newconf_PP['USRLOCKEDTXT'] = (isset($_POST['PP_CustomLockMsg']) ? $_POST['PP_CustomLockMsg'] : l10n('PP_User_Account_Locked_Txt'));
    4574
    4675    $conf['PasswordPolicy'] = serialize($newconf_PP);
     
    82111            'PP_PWDRESET_FALSE'                => $conf_PP['PWDRESET']=='false' ? 'checked="checked"' : '' ,
    83112                                                'PP_PASSWORD_TEST_SCORE'           => $PP_Password_Test_Score,
     113            'PP_LOGFAILEDPASSW_TRUE'           => $conf_PP['LOGFAILBLOCK']=='true' ? 'checked="checked"' : '' ,
     114            'PP_LOGFAILEDPASSW_FALSE'          => $conf_PP['LOGFAILBLOCK']=='false' ? 'checked="checked"' : '' ,
     115            'PP_NBLOGFAIL'                     => $conf_PP['NBLOGFAIL'],
     116            'PP_USRLOCKEDTXT'                  => $conf_PP['USRLOCKEDTXT']
    84117    )
    85118  );
  • extensions/Password_Policy/admin/template/PP_admin.tpl

    r25050 r25089  
    44{combine_css path= $PP_PATH|@cat:'admin/template/pp.css'}
    55
    6 <script type="text/javascript">
     6{footer_script}{literal}
    77jQuery().ready(function()
    8 {ldelim}
     8{
     9  jQuery("#PP_LoginAttempts_true").click(function() {
     10    jQuery("#PP_USRLOCKEDTXT").show("slow");
     11  });
     12  jQuery("#PP_LoginAttempts_false").click(function() {
     13    jQuery("#PP_USRLOCKEDTXT").hide("slow");
     14  });
     15 
     16
    917  jQuery('.cluetip').cluetip(
    10   {ldelim}
    11     width: 500,
     18  {
     19    width: 550,
    1220    splitTitle: '|'
    13   {rdelim});
    14 {rdelim});
    15 </script>
     21  });
     22});
     23{/literal}{/footer_script}
     24
    1625
    1726<div class="titrePage">
     
    6978        </label>
    7079      </li>
     80
     81      <li>
     82        <label class="cluetip" title="{'PP_LoginAttempts'|translate}|{'PP_LoginAttempts_d'|translate}">
     83          {'PP_LoginAttempts'|@translate}
     84        </label>
     85
     86        <label for="PP_LoginAttempts_false"><input id="PP_LoginAttempts_false" value="false" {$PP_LOGFAILEDPASSW_FALSE} name="PP_LogFailedPassw" type="radio"/>
     87          {'PP_Disable'|@translate}
     88        </label>
     89        <label for="PP_LoginAttempts_true"><input id="PP_LoginAttempts_true" value="true" {$PP_LOGFAILEDPASSW_TRUE} name="PP_LogFailedPassw" type="radio"/>
     90          {'PP_Enable'|@translate}
     91        </label>
     92      </li>
     93
     94      <ul>
     95        <li id="PP_USRLOCKEDTXT" {if $PP_LOGFAILEDPASSW_FALSE} style="display: none"{/if}>
     96          <label class="cluetip" title="{'PP_Max number of failed attempts'|translate}|{'PP_Max number of failed attempts_d'|translate}">
     97            {'PP_Max number of failed attempts'|@translate}&nbsp;&nbsp;<input type="text" name="PP_NbFailedPassw" value="{$PP_NBLOGFAIL}" size="5" style="text-align: center;"/>
     98          </label>
     99<br />
     100          <label class="cluetip" title="{'PP_UserLocked_Custom_Txt'|translate}|{'PP_UserLocked_Custom_Txt_d'|translate}">
     101            {'PP_UserLocked_Custom_Txt'|@translate}
     102          </label>
     103          <textarea class="pp_textfields" name="PP_CustomLockMsg" id="PP_CustomLockMsg" rows="10" {$TAG_INPUT_ENABLED}>{$PP_USRLOCKEDTXT}</textarea>
     104          {if 'FCK_PATH'|@defined}
     105            <div style="text-align:right;">
     106              <a href="#" onClick="toogleEditor('PP_CustomLockMsg'); return false;">FCK Editor On/Off</a>
     107            </div>
     108          {/if}
     109        </li>
     110      </ul>
    71111    </ul>
    72112
  • extensions/Password_Policy/admin/template/pp.css

    r25028 r25089  
    1717  margin-bottom: 5px;
    1818}
     19
     20textarea.pp_textfields
     21{
     22  width: 70%;
     23}
Note: See TracChangeset for help on using the changeset viewer.