Ignore:
Timestamp:
Oct 26, 2009, 11:34:13 PM (11 years ago)
Author:
Eric
Message:

[NBC_UserAdvManager] pre 2.12.0 :

  • Adding of password enforcement control function
  • Main code refactory
  • French language file refactory
  • Admin panel refactory
Location:
extensions/NBC_UserAdvManager/trunk/admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php

    r4061 r4124  
    5656  case 'global':
    5757       
    58         if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_Mail_Info']) and isset($_POST['UserAdvManager_No_Casse']) and isset($_POST['UserAdvManager_Username_Char']) and isset($_POST['UserAdvManager_Confirm_Mail']) and isset($_POST['UserAdvManager_No_Comment_Anonymous']) and isset($_POST['UserAdvManager_Password_Enforced']))
     58        if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_Mail_Info']) and isset($_POST['UserAdvManager_No_Casse']) and isset($_POST['UserAdvManager_Username_Char']) and isset($_POST['UserAdvManager_Confirm_Mail']) and isset($_POST['UserAdvManager_No_Comment_Anonymous']) and isset($_POST['UserAdvManager_Password_Enforced']) and isset($_POST['UserAdvManager_AdminPassword_Enforced']))
    5959  {
    6060                $_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text']));
    6161                $_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text']));
    6262               
    63                 $newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'];
     63                $newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'].';'.$_POST['UserAdvManager_AdminPassword_Enforced'];
    6464               
    6565                $conf['nbc_UserAdvManager'] = $newconf_nbc_UserAdvManager;
     
    202202                'UserAdvManager_PASSWORDENF_FALSE'    => $conf_nbc_UserAdvManager[14]=='false' ?  'checked="checked"' : '' ,
    203203                'UserAdvManager_PASSWORD_SCORE'       => $conf_nbc_UserAdvManager[15],
     204    'UserAdvManager_ADMINPASSWENF_TRUE'   => $conf_nbc_UserAdvManager[16]=='true' ?  'checked="checked"' : '' ,
     205                'UserAdvManager_ADMINPASSWENF_FALSE'  => $conf_nbc_UserAdvManager[16]=='false' ?  'checked="checked"' : '' ,
    204206                'UserAdvManager_PASSWORD_TEST_SCORE'  => $UserAdvManager_Password_Test_Score,
    205207    )
     
    207209       
    208210
    209   if ( isset($_POST['audit']) or isset($_POST['submit']) )
     211  if (isset($_POST['audit']))
    210212        {
    211213                $msg_error1 = '';
     
    298300// |                             errors display                            |
    299301// +-----------------------------------------------------------------------+
    300   if ( isset ($errors) and count($errors) != 0)
     302  if (isset ($errors) and count($errors) != 0)
    301303  {
    302304          $template->assign('errors',array());
  • extensions/NBC_UserAdvManager/trunk/admin/global.tpl

    r4061 r4124  
    55<form method="post" action="{$UserAdvManager_F_ACTION}" class="general">
    66  <fieldset>
    7         <legend>{'UserAdvManager_Title'|@translate}</legend>
     7        <legend>{'UserAdvManager_Title1'|@translate}</legend>
    88    <ul>
    99        <li><label>{'UserAdvManager_No_Casse'|@translate}</label><br>
    10         <input type="radio" value="true" {$UserAdvManager_NO_CASSE_TRUE} name="UserAdvManager_No_Casse"/>{'UserAdvManager_No_Casse_true'|@translate}<br>
    11         <input type="radio" value="false" {$UserAdvManager_NO_CASSE_FALSE} name="UserAdvManager_No_Casse"/>{'UserAdvManager_No_Casse_false'|@translate}<br>
     10        <input type="radio" value="true" {$UserAdvManager_NO_CASSE_TRUE} name="UserAdvManager_No_Casse">{'UserAdvManager_No_Casse_true'|@translate}<br>
     11        <input type="radio" value="false" {$UserAdvManager_NO_CASSE_FALSE} name="UserAdvManager_No_Casse">{'UserAdvManager_No_Casse_false'|@translate}<br>
    1212        <br>
    1313                </li>
    1414        <li><label>{'UserAdvManager_Username_Char'|@translate}</label><br>
    15         <input type="radio" value="true" {$UserAdvManager_USERNAME_CHAR_TRUE} name="UserAdvManager_Username_Char"/>{'UserAdvManager_Username_Char_true'|@translate}
    16         <input type="text" name="UserAdvManager_Username_List" value="{$UserAdvManager_USERNAME_CHAR_LIST}" size="20" style="text-align: center;"/><br>
    17         <input type="radio" value="false" {$UserAdvManager_USERNAME_CHAR_FALSE} name="UserAdvManager_Username_Char"/>{'UserAdvManager_Username_Char_false'|@translate}<br>
    18         <br>
     15        <input type="radio" value="true" {$UserAdvManager_USERNAME_CHAR_TRUE} name="UserAdvManager_Username_Char">{'UserAdvManager_Username_Char_true'|@translate}
     16        <input type="text" name="UserAdvManager_Username_List" value="{$UserAdvManager_USERNAME_CHAR_LIST}" size="20" style="text-align: center;"><br>
     17        <input type="radio" value="false" {$UserAdvManager_USERNAME_CHAR_FALSE} name="UserAdvManager_Username_Char">{'UserAdvManager_Username_Char_false'|@translate}<br><br>
    1918        </li>
    20         <li><label>{'UserAdvManager_Password_Enforced'|@translate}</label><br/>
    21         <input type="radio" value="true" {$UserAdvManager_PASSWORDENF_TRUE} name="UserAdvManager_Password_Enforced"/>{'UserAdvManager_Password_Enforced_true'|@translate}
    22         <input type="text" name="UserAdvManager_Password_Score" value="{$UserAdvManager_PASSWORD_SCORE}" size="5" style="text-align: center;"/><br><br>
     19     
     20        <li><label>{'UserAdvManager_Password_Enforced'|@translate}</label><br>
     21        <input type="radio" value="true" {$UserAdvManager_PASSWORDENF_TRUE} name="UserAdvManager_Password_Enforced">{'UserAdvManager_Password_Enforced_true'|@translate}
     22        <input type="text" name="UserAdvManager_Password_Score" value="{$UserAdvManager_PASSWORD_SCORE}" size="5" style="text-align: center;"><br><br>
    2323       
    2424        <label>{'UserAdvManager_Password_Enforced_Info'|@translate}</label><br><br>
    25         {'UserAdvManager_PasswordTest'|@translate}<input type="text" name="UserAdvManager_Password_Test" value="{$UserAdvManager_PASSWORD_TEST}" size="50" style="text-align: left;"/>&nbsp;&nbsp;&nbsp;
     25        {'UserAdvManager_PasswordTest'|@translate}<input type="text" name="UserAdvManager_Password_Test" value="{$UserAdvManager_PASSWORD_TEST}" size="50" style="text-align: left;">&nbsp;&nbsp;&nbsp;
    2626        <input class="submit" type="submit" value="{'PasswordTest'|@translate}" name="PasswordTest" >&nbsp;&nbsp;&nbsp;
    2727        {'UserAdvManager_ScoreTest'|@translate}{$UserAdvManager_PASSWORD_TEST_SCORE}<br><br>
    28         {if isset($PasswordTest) && empty($UserAdvManager_PASSWORD_TEST)}
    29           <label>{'reg_err_login3'|@translate}</label>
    30         {/if}
    3128       
    32         <input type="radio" value="false" {$UserAdvManager_PASSWORDENF_FALSE} name="UserAdvManager_Password_Enforced"/>{'UserAdvManager_Password_Enforced_false'|@translate}<br>
    33         <br>
     29        <input type="radio" value="false" {$UserAdvManager_PASSWORDENF_FALSE} name="UserAdvManager_Password_Enforced">{'UserAdvManager_Password_Enforced_false'|@translate}<br><br>
    3430        </li>
    35         <li><label>{'UserAdvManager_Mail_Info'|@translate}</label><br/>
    36         <input type="radio" value="true" {$UserAdvManager_MAIL_INFO_TRUE} name="UserAdvManager_Mail_Info"/>{'UserAdvManager_Mail_Info_true'|@translate}<br>
    37         <input type="radio" value="false" {$UserAdvManager_MAIL_INFO_FALSE} name="UserAdvManager_Mail_Info"/>{'UserAdvManager_Mail_Info_false'|@translate}<br>
    38         <br>
     31
     32        <li><label>{'UserAdvManager_AdminPassword_Enforced'|@translate}</label><br>
     33        <input type="radio" value="true" {$UserAdvManager_ADMINPASSWENF_TRUE} name="UserAdvManager_AdminPassword_Enforced">{'UserAdvManager_AdminPassword_Enforced_true'|@translate}<br>
     34        <input type="radio" value="false" {$UserAdvManager_ADMINPASSWENF_FALSE} name="UserAdvManager_AdminPassword_Enforced">{'UserAdvManager_AdminPassword_Enforced_false'|@translate}<br><br>
     35
     36        <li><label>{'UserAdvManager_No_Comment_Anonymous'|@translate}</label><br>
     37        <input type="radio" value="true" {$UserAdvManager_NO_COMMENT_ANO_TRUE} name="UserAdvManager_No_Comment_Anonymous">{'UserAdvManager_No_Comment_Anonymous_true'|@translate}<br>
     38        <input type="radio" value="false" {$UserAdvManager_NO_COMMENT_ANO_FALSE} name="UserAdvManager_No_Comment_Anonymous">{'UserAdvManager_No_Comment_Anonymous_false'|@translate}<br><br>
    3939        </li>
     40     
     41        <li><label>{'UserAdvManager_MailExclusion'|@translate}</label><br>
     42        <input type="radio" value="true" {$UserAdvManager_MAILEXCLUSION_TRUE} name="UserAdvManager_MailExclusion">{'UserAdvManager_MailExclusion_true'|@translate}<br>
     43        <input type="radio" value="false" {$UserAdvManager_MAILEXCLUSION_FALSE} name="UserAdvManager_MailExclusion">{'UserAdvManager_MailExclusion_false'|@translate}<br><br>
     44        </li>
     45     
     46        <li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br>
     47        <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea><br><br>
     48        </li>
     49    </ul>
     50   
     51        <p><input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} >&nbsp;<input class="submit" type="submit" value="{'audit'|@translate}" name="audit"></p>
     52  </fieldset>
     53
     54    <fieldset>
     55    <legend>{'UserAdvManager_Title2'|@translate}</legend>
     56    <ul>
     57        <li><label>{'UserAdvManager_Mail_Info'|@translate}</label><br>
     58        <input type="radio" value="true" {$UserAdvManager_MAIL_INFO_TRUE} name="UserAdvManager_Mail_Info">{'UserAdvManager_Mail_Info_true'|@translate}<br>
     59        <input type="radio" value="false" {$UserAdvManager_MAIL_INFO_FALSE} name="UserAdvManager_Mail_Info">{'UserAdvManager_Mail_Info_false'|@translate}<br><br>
     60        </li>
     61     
    4062        <li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br>
    41         <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea>
    42         <br><br>
     63        <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea><br><br>
    4364        </li>
     65     
    4466        <li><label>{'UserAdvManager_Confirm_Mail'|@translate}</label><br>
    45         <input type="radio" value="true" {$UserAdvManager_CONFIRM_MAIL_TRUE} name="UserAdvManager_Confirm_Mail"/>{'UserAdvManager_Confirm_Mail_true'|@translate}<br>
    46         <input type="radio" value="false" {$UserAdvManager_CONFIRM_MAIL_FALSE} name="UserAdvManager_Confirm_Mail"/>{'UserAdvManager_Confirm_Mail_false'|@translate}<br>
    47         <br>
     67        <input type="radio" value="true" {$UserAdvManager_CONFIRM_MAIL_TRUE} name="UserAdvManager_Confirm_Mail">{'UserAdvManager_Confirm_Mail_true'|@translate}<br>
     68        <input type="radio" value="false" {$UserAdvManager_CONFIRM_MAIL_FALSE} name="UserAdvManager_Confirm_Mail">{'UserAdvManager_Confirm_Mail_false'|@translate}<br><br>
    4869        </li>
     70     
    4971        <li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br>
    50         <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea>
    51         <br><br>
     72        <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea><br><br>
    5273        </li>
     74     
    5375        <br>
    5476                        <div style="text-align: center; font-size: 1.1em; color: red;"><b>{'UserAdvManager_Confirm_Group_Notice'|@translate}</b></div>
    5577                        <br>
     78     
    5679        <li><label>{'UserAdvManager_No_Confirm_Group'|@translate}</label><br>
    57                 {html_options name="UserAdvManager_No_Confirm_Group" options=$No_Confirm_Group.group_options selected=$No_Confirm_Group.group_selected}
    58         <br><br>
     80                {html_options name="UserAdvManager_No_Confirm_Group" options=$No_Confirm_Group.group_options selected=$No_Confirm_Group.group_selected}<br><br>
    5981        </li>
     82     
    6083        <li><label>{'UserAdvManager_Validated_Group'|@translate}</label><br>
    61                 {html_options name="UserAdvManager_Validated_Group" options=$Validated_Group.group_options selected=$Validated_Group.group_selected}
    62         <br><br>
     84                {html_options name="UserAdvManager_Validated_Group" options=$Validated_Group.group_options selected=$Validated_Group.group_selected}<br><br>
    6385        </li>
     86     
    6487        <br>
    6588                        <div style="text-align: center; font-size: 1.1em; color: red;"><b>{'UserAdvManager_Confirm_Status_Notice'|@translate}</b></div>
    6689                        <br>
     90     
    6791        <li><label>{'UserAdvManager_No_Confirm_Status'|@translate}</label><br>
    68                 {html_options name="UserAdvManager_No_Confirm_Status" options=$No_Confirm_Status.Status_options selected=$No_Confirm_Status.Status_selected}
    69         <br><br>
     92                {html_options name="UserAdvManager_No_Confirm_Status" options=$No_Confirm_Status.Status_options selected=$No_Confirm_Status.Status_selected}<br><br>
    7093        </li>
     94     
    7195        <li><label>{'UserAdvManager_Validated_Status'|@translate}</label><br>
    72                 {html_options name="UserAdvManager_Validated_Status" options=$Confirm_Status.Status_options selected=$Confirm_Status.Status_selected}
    73         <br><br>
    74         </li>
    75         <li><label>{'UserAdvManager_No_Comment_Anonymous'|@translate}</label><br>
    76         <input type="radio" value="true" {$UserAdvManager_NO_COMMENT_ANO_TRUE} name="UserAdvManager_No_Comment_Anonymous"/>{'UserAdvManager_No_Comment_Anonymous_true'|@translate}<br>
    77         <input type="radio" value="false" {$UserAdvManager_NO_COMMENT_ANO_FALSE} name="UserAdvManager_No_Comment_Anonymous"/>{'UserAdvManager_No_Comment_Anonymous_false'|@translate}<br>
    78         <br>
    79         </li>
    80         <li><label>{'UserAdvManager_MailExclusion'|@translate}</label><br>
    81         <input type="radio" value="true" {$UserAdvManager_MAILEXCLUSION_TRUE} name="UserAdvManager_MailExclusion"/>{'UserAdvManager_MailExclusion_true'|@translate}<br>
    82         <input type="radio" value="false" {$UserAdvManager_MAILEXCLUSION_FALSE} name="UserAdvManager_MailExclusion"/>{'UserAdvManager_MailExclusion_false'|@translate}<br>
    83         <br>
    84         </li>
    85         <li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br>
    86         <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea>
     96                {html_options name="UserAdvManager_Validated_Status" options=$Confirm_Status.Status_options selected=$Confirm_Status.Status_selected}<br><br>
    8797        </li>
    8898    </ul>
    89         <p><input class="submit" type="submit" value="{'audit'|@translate}" name="audit" />&nbsp;<input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} /></p>
     99   
     100        <p><input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} >&nbsp;<input class="submit" type="submit" value="{'audit'|@translate}" name="audit"></p>
    90101  </fieldset>
    91102</form>
Note: See TracChangeset for help on using the changeset viewer.