Changeset 21075


Ignore:
Timestamp:
Feb 28, 2013, 10:47:05 PM (7 years ago)
Author:
Eric
Message:

Compliance with Piwigo 2.5
Bug 2764 fixed - Code refactory : Change config variables to assoc array and $_POST vars control before writing conf in database - Thx to flop25 for his advices ;-)
Update fr_FR

Location:
extensions/UserAdvManager/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/trunk/admin/UAM_admin.php

    r20591 r21075  
    179179    // Check if [Kdays] flag is used in a legal way (ConfirmMail Time out have to be set)
    180180    // ----------------------------------------------------------------------------------
    181     if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_Text']) != 0)
     181    if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_Text']) != 0)
    182182    {
    183183      $UAM_Illegal_Flag_Error1 = true;
     
    187187    // Save global UAM configuration
    188188    // -----------------------------
    189     $newconf_UAM = array(
    190       $_POST['UAM_Mail_Info'],
    191       $_POST['UAM_Confirm_Mail'],
    192       (isset($_POST['UAM_No_Confirm_Group'])?$_POST['UAM_No_Confirm_Group']:''),
    193       (isset($_POST['UAM_Validated_Group'])?$_POST['UAM_Validated_Group']:''),
    194       (isset($_POST['UAM_Validated_Status'])?$_POST['UAM_Validated_Status']:''),
    195       $_POST['UAM_Username_Char'],
    196       $_POST['UAM_Username_List'],
    197       (isset($_POST['UAM_No_Confirm_Status'])?$_POST['UAM_No_Confirm_Status']:''),
    198       $_POST['UAM_MailInfo_Text'],
    199       $_POST['UAM_ConfirmMail_Text'],
    200       $_POST['UAM_MailExclusion'],
    201       $_POST['UAM_MailExclusion_List'],
    202       $_POST['UAM_Password_Enforced'],
    203       $_POST['UAM_Password_Score'],
    204       $_POST['UAM_AdminPassword_Enforced'],
    205       $_POST['UAM_GhostUser_Tracker'],
    206       $_POST['UAM_GhostTracker_DayLimit'],
    207       $_POST['UAM_GhostTracker_ReminderText'],
    208       $_POST['UAM_Add_LastVisit_Column'],
    209       $_POST['UAM_Admin_ConfMail'],
    210       $_POST['UAM_RedirToProfile'],
    211       $_POST['UAM_GTAuto'],
    212       $_POST['UAM_GTAutoMail'],
    213       $_POST['UAM_GTAutoDelText'],
    214       $_POST['UAM_GTAutoMailText'],
    215       (isset($_POST['UAM_Downgrade_Group'])?$_POST['UAM_Downgrade_Group']:''),
    216       (isset($_POST['UAM_Downgrade_Status'])?$_POST['UAM_Downgrade_Status']:''),
    217       $_POST['UAM_AdminValidationMail_Text'],
    218       $_POST['UAM_CustomPasswRetr'],
    219       $_POST['UAM_CustomPasswRetr_Text'],
    220       $_POST['UAM_USRAuto'],
    221       $_POST['UAM_USRAutoDelText'],
    222       $_POST['UAM_USRAutoMail'],
    223       $_POST['UAM_Stuffs'],
    224       $_POST['UAM_HidePassw'],
    225       (isset($_POST['UAM_No_Valid_Level'])?$_POST['UAM_No_Valid_Level']:''),
    226       (isset($_POST['UAM_Valid_Level'])?$_POST['UAM_Valid_Level']:''),
    227       (isset($_POST['UAM_Downgrade_Level'])?$_POST['UAM_Downgrade_Level']:''),
    228       $_POST['UAM_PwdReset'],
    229       $_POST['UAM_RejectConnexion'],
    230       $_POST['UAM_CustomRejectConnexion_Text'],
    231       $_POST['UAM_ConfirmMail_Subject'],
    232       $_POST['UAM_ConfirmMail_Remail_Subject'],
    233       $_POST['UAM_InfoMail_Subject'],
    234       $_POST['UAM_GTAutoMail_Subject'],
    235       $_POST['UAM_GTReminder_Subject'],
    236       $_POST['UAM_AdminValidationMail_Subject'],
    237     );
     189    $newconf_UAM['MAIL_INFO'] = (isset($_POST['UAM_Mail_Info']) ? $_POST['UAM_Mail_Info'] : 'false');
     190    $newconf_UAM['CONFIRM_MAIL'] = (isset($_POST['UAM_Confirm_Mail']) ? $_POST['UAM_Confirm_Mail'] : 'false');
     191    $newconf_UAM['NO_CONFIRM_GROUP'] = (isset($_POST['UAM_No_Confirm_Group']) ? $_POST['UAM_No_Confirm_Group'] : '');
     192    $newconf_UAM['VALIDATED_GROUP'] = (isset($_POST['UAM_Validated_Group']) ? $_POST['UAM_Validated_Group'] : '');
     193    $newconf_UAM['VALIDATED_STATUS'] = (isset($_POST['UAM_Validated_Status'])?$_POST['UAM_Validated_Status'] : '');
     194    $newconf_UAM['USERNAME_CHAR'] = $_POST['UAM_Username_Char'];
     195    $newconf_UAM['USERNAME_CHAR_LIST'] = (isset($_POST['UAM_Username_List']) ? $_POST['UAM_Username_List'] : '');
     196    $newconf_UAM['NO_CONFIRM_STATUS'] = (isset($_POST['UAM_No_Confirm_Status']) ? $_POST['UAM_No_Confirm_Status'] : '');
     197    $newconf_UAM['MAILINFO_TEXT'] = (isset($_POST['UAM_MailInfo_Text']) ? $_POST['UAM_MailInfo_Text'] : l10n('UAM_Default_InfoMail_Txt'));
     198    $newconf_UAM['CONFIRMMAIL_TEXT'] = (isset($_POST['UAM_ConfirmMail_Text']) ? $_POST['UAM_ConfirmMail_Text'] : l10n('UAM_Default_ConfirmMail_Txt'));
     199    $newconf_UAM['MAILEXCLUSION'] = (isset($_POST['UAM_MailExclusion']) ? $_POST['UAM_MailExclusion'] : 'false');
     200    $newconf_UAM['MAILEXCLUSION_LIST'] = (isset($_POST['UAM_MailExclusion_List']) ? $_POST['UAM_MailExclusion_List'] : '');
     201    $newconf_UAM['PASSWORDENF'] = (isset($_POST['UAM_Password_Enforced']) ? $_POST['UAM_Password_Enforced'] : 'false');
     202    $newconf_UAM['PASSWORD_SCORE'] = (isset($_POST['UAM_Password_Score']) ? $_POST['UAM_Password_Score'] : '100');
     203    $newconf_UAM['ADMINPASSWENF'] = (isset($_POST['UAM_AdminPassword_Enforced']) ? $_POST['UAM_AdminPassword_Enforced'] : 'false');
     204    $newconf_UAM['GHOSTRACKER'] = (isset($_POST['UAM_GhostUser_Tracker']) ? $_POST['UAM_GhostUser_Tracker'] : 'false');
     205    $newconf_UAM['GHOSTRACKER_DAYLIMIT'] = (isset($_POST['UAM_GhostTracker_DayLimit']) ? $_POST['UAM_GhostTracker_DayLimit'] : '10');
     206    $newconf_UAM['GHOSTRACKER_REMINDERTEXT'] = (isset($_POST['UAM_GhostTracker_ReminderText']) ? $_POST['UAM_GhostTracker_ReminderText'] : l10n('UAM_Default_GhstReminder_Txt'));
     207    $newconf_UAM['ADDLASTVISIT'] = (isset($_POST['UAM_Add_LastVisit_Column']) ? $_POST['UAM_Add_LastVisit_Column'] : 'false');
     208    $newconf_UAM['ADMINCONFMAIL'] = (isset($_POST['UAM_Admin_ConfMail']) ? $_POST['UAM_Admin_ConfMail'] : 'false');
     209    $newconf_UAM['REDIRTOPROFILE'] = (isset($_POST['UAM_RedirToProfile']) ? $_POST['UAM_RedirToProfile'] : 'false');
     210    $newconf_UAM['GTAUTO'] = (isset($_POST['UAM_GTAuto']) ? $_POST['UAM_GTAuto'] : 'false');
     211    $newconf_UAM['GTAUTOMAIL'] = (isset($_POST['UAM_GTAutoMail']) ? $_POST['UAM_GTAutoMail'] : 'false');
     212    $newconf_UAM['GTAUTODEL'] = (isset($_POST['UAM_GTAutoDelText']) ? $_POST['UAM_GTAutoDelText'] : l10n('UAM_Default_GhstDeletion_Txt'));
     213    $newconf_UAM['GTAUTOMAILTEXT'] = (isset($_POST['UAM_GTAutoMailText']) ? $_POST['UAM_GTAutoMailText'] : l10n('UAM_Default_GhstDemotion_Txt'));
     214    $newconf_UAM['DOWNGRADE_GROUP'] = (isset($_POST['UAM_Downgrade_Group']) ? $_POST['UAM_Downgrade_Group'] : '');
     215    $newconf_UAM['DOWNGRADE_STATUS'] = (isset($_POST['UAM_Downgrade_Status']) ? $_POST['UAM_Downgrade_Status'] : '');
     216    $newconf_UAM['ADMINVALIDATIONMAIL'] = (isset($_POST['UAM_AdminValidationMail_Text']) ? $_POST['UAM_AdminValidationMail_Text'] : l10n('UAM_Default_AdminValidation_Txt'));
     217    $newconf_UAM['CUSTOMPASSWRETR'] = (isset($_POST['UAM_CustomPasswRetr']) ? $_POST['UAM_CustomPasswRetr'] : 'false');
     218    $newconf_UAM['CUSTOMPASSWRETR_TEXT'] = (isset($_POST['UAM_CustomPasswRetr_Text']) ? $_POST['UAM_CustomPasswRetr_Text'] : l10n('UAM_Default_PwdRequest_Txt'));
     219    $newconf_UAM['USRAUTO'] = (isset($_POST['UAM_USRAuto']) ? $_POST['UAM_USRAuto'] : 'false');
     220    $newconf_UAM['USRAUTODEL'] = (isset($_POST['UAM_USRAutoDelText']) ? $_POST['UAM_USRAutoDelText'] : l10n('UAM_Default_ValidationTimeout_Txt'));
     221    $newconf_UAM['USRAUTOMAIL'] = (isset($_POST['UAM_USRAutoMail']) ? $_POST['UAM_USRAutoMail'] : 'false');
     222    $newconf_UAM['STUFFS'] = (isset($_POST['UAM_Stuffs']) ? $_POST['UAM_Stuffs'] : 'false');
     223    $newconf_UAM['HIDEPASSW'] = (isset($_POST['UAM_HidePassw']) ? $_POST['UAM_HidePassw'] : 'false');
     224    $newconf_UAM['NO_VALID_LEVEL'] = (isset($_POST['UAM_No_Valid_Level']) ? $_POST['UAM_No_Valid_Level'] : '');
     225    $newconf_UAM['VALID_LEVEL'] = (isset($_POST['UAM_Valid_Level']) ? $_POST['UAM_Valid_Level'] : '');
     226    $newconf_UAM['DOWNGRADE_LEVEL'] = (isset($_POST['UAM_Downgrade_Level']) ? $_POST['UAM_Downgrade_Level'] : '');
     227    $newconf_UAM['PWDRESET'] = (isset($_POST['UAM_PwdReset']) ? $_POST['UAM_PwdReset'] : 'false');
     228    $newconf_UAM['REJECTCONNECT'] = (isset($_POST['UAM_RejectConnexion']) ? $_POST['UAM_RejectConnexion'] : 'false');
     229    $newconf_UAM['REJECTCONNECT_TEXT'] = (isset($_POST['UAM_CustomRejectConnexion_Text']) ? $_POST['UAM_CustomRejectConnexion_Text'] : l10n('UAM_Default_RejectConnexion_Txt'));
     230    $newconf_UAM['CONFIRMMAIL_SUBJECT'] = (isset($_POST['UAM_ConfirmMail_Subject']) ? $_POST['UAM_ConfirmMail_Subject'] : l10n('UAM_Default_ConfirmMail_Subject'));
     231    $newconf_UAM['CONFIRMMAIL_REMAIL_SUBJECT'] = (isset($_POST['UAM_ConfirmMail_Remail_Subject']) ? $_POST['UAM_ConfirmMail_Remail_Subject'] : l10n('UAM_Default_ConfirmMail_Remail_Subject'));
     232    $newconf_UAM['INFOMAIL_SUBJECT'] = (isset($_POST['UAM_InfoMail_Subject']) ? $_POST['UAM_InfoMail_Subject'] : l10n('UAM_Default_InfoMail_Subject'));
     233    $newconf_UAM['GTAUTOMAIL_SUBJECT'] = (isset($_POST['UAM_GTAutoMail_Subject']) ? $_POST['UAM_GTAutoMail_Subject'] : l10n('UAM_Default_GTAutoMail_Subject'));
     234    $newconf_UAM['GTREMINDER_SUBJECT'] = (isset($_POST['UAM_GTReminder_Subject']) ? $_POST['UAM_GTReminder_Subject'] : l10n('UAM_Default_GTReminder_Subject'));
     235    $newconf_UAM['ADMINVALIDATIONMAIL_SUBJECT'] = (isset($_POST['UAM_AdminValidationMail_Subject']) ? $_POST['UAM_AdminValidationMail_Subject'] : l10n('UAM_Default_AdminValidationMail_Subject'));
    238236
    239237    $conf['UserAdvManager'] = serialize($newconf_UAM);
    240238
    241     conf_update_param('UserAdvManager', pwg_db_real_escape_string($conf['UserAdvManager']));
     239    conf_update_param('UserAdvManager', pwg_db_real_escape_string($conf['UserAdvManager'])); 
    242240
    243241    // Email confirmation settings
     
    253251    // Check if [Kdays] flag is used in a legal way (ConfirmMail Time out have to be set)
    254252    // ----------------------------------------------------------------------------------
    255     if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_ReMail_Txt1']) == 1)
     253    if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_ReMail_Txt1']) == 1)
    256254    {
    257255      $UAM_Illegal_Flag_Error2 = true;
    258256      array_push($page['errors'], l10n('UAM_Error_Using_illegal_flag'));
    259257    }
    260     elseif (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_ReMail_Txt2']) == 1)
     258    elseif (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'false' and preg_match('#\[Kdays\]#i',$_POST['UAM_ConfirmMail_ReMail_Txt2']) == 1)
    261259    {
    262260      $UAM_Illegal_Flag_Error3 = true;
     
    266264    // Save ConfirmMail settings
    267265    // -------------------------
    268     $newconf_UAM_ConfirmMail = array (
    269       $_POST['UAM_ConfirmMail_TimeOut'],
    270       $_POST['UAM_ConfirmMail_Delay'],
    271       $_POST['UAM_ConfirmMail_ReMail_Txt1'],
    272       $_POST['UAM_ConfirmMail_Remail'],
    273       $_POST['UAM_ConfirmMail_ReMail_Txt2'],
    274       $_POST['UAM_ConfirmMail_Custom_Txt1'],
    275       $_POST['UAM_ConfirmMail_Custom_Txt2']
    276     );
     266    $newconf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] = (isset($_POST['UAM_ConfirmMail_TimeOut']) ? $_POST['UAM_ConfirmMail_TimeOut'] : 'false');
     267    $newconf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'] = (isset($_POST['UAM_ConfirmMail_Delay']) ? $_POST['UAM_ConfirmMail_Delay'] : '5');
     268    $newconf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1'] = (isset($_POST['UAM_ConfirmMail_ReMail_Txt1']) ? $_POST['UAM_ConfirmMail_ReMail_Txt1'] : l10n('UAM_Default_CfmMail_Remail_Txt1'));
     269    $newconf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL'] = (isset($_POST['UAM_ConfirmMail_Remail']) ? $_POST['UAM_ConfirmMail_Remail'] : 'false');
     270    $newconf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2'] = (isset($_POST['UAM_ConfirmMail_ReMail_Txt2']) ? $_POST['UAM_ConfirmMail_ReMail_Txt2'] : l10n('UAM_Default_CfmMail_Remail_Txt2'));
     271    $newconf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1'] = (isset($_POST['UAM_ConfirmMail_Custom_Txt1']) ? $_POST['UAM_ConfirmMail_Custom_Txt1'] : l10n('UAM_Default_CfmMail_Custom_Txt1'));
     272    $newconf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2'] = (isset($_POST['UAM_ConfirmMail_Custom_Txt2']) ? $_POST['UAM_ConfirmMail_Custom_Txt2'] : l10n('UAM_Default_CfmMail_Custom_Txt2'));
    277273
    278274    $conf['UserAdvManager_ConfirmMail'] = serialize($newconf_UAM_ConfirmMail);
     
    363359    $groups[$row['id']] = $row['name'];
    364360    //configuration value for unvalidated users
    365     if (isset($conf_UAM[2]) and $conf_UAM[2] == $row['id'])
     361    if (isset($conf_UAM['NO_CONFIRM_GROUP']) and $conf_UAM['NO_CONFIRM_GROUP'] == $row['id'])
    366362    {
    367363      $No_Valid = $row['id'];
    368364    }
    369365    //configuration value for validated users
    370     if (isset($conf_UAM[3]) and $conf_UAM[3] == $row['id'])
     366    if (isset($conf_UAM['VALIDATED_GROUP']) and $conf_UAM['VALIDATED_GROUP'] == $row['id'])
    371367    {
    372368      $Valid = $row['id'];
    373369    }
    374370    //configuration value for downgrade users
    375     if (isset($conf_UAM[25]) and $conf_UAM[25] == $row['id'])
     371    if (isset($conf_UAM['DOWNGRADE_GROUP']) and $conf_UAM['DOWNGRADE_GROUP'] == $row['id'])
    376372    {
    377373      $Downgrade = $row['id'];
     
    421417  {
    422418          $status_options[$status] = l10n('user_status_'.$status);
    423           if (isset($conf_UAM[7]) and $conf_UAM[7] == $status)
     419          if (isset($conf_UAM['NO_CONFIRM_STATUS']) and $conf_UAM['NO_CONFIRM_STATUS'] == $status)
    424420          {
    425421            $No_Valid_Status = $status;
     
    442438  {
    443439    $status_options[$status] = l10n('user_status_'.$status);
    444     if (isset($conf_UAM[4]) and $conf_UAM[4] == $status)
     440    if (isset($conf_UAM['VALIDATED_STATUS']) and $conf_UAM['VALIDATED_STATUS'] == $status)
    445441    {
    446442      $Valid_Status = $status;
     
    463459  {
    464460    $status_options[$status] = l10n('user_status_'.$status);
    465     if (isset($conf_UAM[26]) and $conf_UAM[26] == $status)
     461    if (isset($conf_UAM['DOWNGRADE_STATUS']) and $conf_UAM['DOWNGRADE_STATUS'] == $status)
    466462    {
    467463      $Downgrade_Status = $status;
     
    492488  {
    493489    $level_options[$level] = l10n(sprintf('Level %d', $level));
    494     if (isset($conf_UAM[35]) and $conf_UAM[35] == $level)
     490    if (isset($conf_UAM['NO_VALID_LEVEL']) and $conf_UAM['NO_VALID_LEVEL'] == $level)
    495491    {
    496492      $No_Valid_Level = $level;
     
    513509  {
    514510    $level_options[$level] = l10n(sprintf('Level %d', $level));
    515     if (isset($conf_UAM[36]) and $conf_UAM[36] == $level)
     511    if (isset($conf_UAM['VALID_LEVEL']) and $conf_UAM['VALID_LEVEL'] == $level)
    516512    {
    517513      $Valid_Level = $level;
     
    534530  {
    535531    $level_options[$level] = l10n(sprintf('Level %d', $level));
    536     if (isset($conf_UAM[37]) and $conf_UAM[37] == $level)
     532    if (isset($conf_UAM['DOWNGRADE_LEVEL']) and $conf_UAM['DOWNGRADE_LEVEL'] == $level)
    537533    {
    538534      $Downgrade_Level = $level;
     
    578574            'UAM_DUMP_DOWNLOAD'                 => $dump_download,
    579575            'UAM_THEME'                         => $UAM_theme,
    580                                                 'UAM_MAIL_INFO_TRUE'                => $conf_UAM[0]=='true' ? 'checked="checked"' : '' ,
    581                                                 'UAM_MAIL_INFO_FALSE'               => $conf_UAM[0]=='false' ? 'checked="checked"' : '' ,
    582                                                 'UAM_MAILINFO_TEXT'                 => $conf_UAM[8],
    583                                                 'UAM_USERNAME_CHAR_TRUE'            => $conf_UAM[5]=='true' ? 'checked="checked"' : '' ,
    584                                                 'UAM_USERNAME_CHAR_FALSE'           => $conf_UAM[5]=='false' ? 'checked="checked"' : '' ,
    585                                                 'UAM_USERNAME_CHAR_LIST'            => $conf_UAM[6],
    586                                                 'UAM_CONFIRM_MAIL_TRUE'             => $conf_UAM[1]=='true' ? 'checked="checked"' : '' ,
    587                                                 'UAM_CONFIRM_MAIL_FALSE'            => $conf_UAM[1]=='false' ? 'checked="checked"' : '' ,
    588             'UAM_CONFIRM_MAIL_LOCAL'            => $conf_UAM[1]=='local' ? 'checked="checked"' : '' ,
    589                                                 'UAM_CONFIRMMAIL_TEXT'              => $conf_UAM[9],
    590                                                 'UAM_No_Confirm_Group'              => $conf_UAM[2],
    591                                                 'UAM_Validated_Group'               => $conf_UAM[3],
    592                                                 'UAM_No_Confirm_Status'             => $conf_UAM[7],
    593                                                 'UAM_Validated_Status'              => $conf_UAM[4],
    594                                                 'UAM_MAILEXCLUSION_TRUE'            => $conf_UAM[10]=='true' ? 'checked="checked"' : '' ,
    595                                                 'UAM_MAILEXCLUSION_FALSE'           => $conf_UAM[10]=='false' ? 'checked="checked"' : '' ,
    596                                                 'UAM_MAILEXCLUSION_LIST'            => $conf_UAM[11],
    597                                                 'UAM_PASSWORDENF_TRUE'              => $conf_UAM[12]=='true' ? 'checked="checked"' : '' ,
    598                                                 'UAM_PASSWORDENF_FALSE'             => $conf_UAM[12]=='false' ? 'checked="checked"' : '' ,
    599                                                 'UAM_PASSWORD_SCORE'                => $conf_UAM[13],
    600             'UAM_ADMINPASSWENF_TRUE'            => $conf_UAM[14]=='true' ? 'checked="checked"' : '' ,
    601                                                 'UAM_ADMINPASSWENF_FALSE'           => $conf_UAM[14]=='false' ? 'checked="checked"' : '' ,
    602             'UAM_GHOSTRACKER_TRUE'              => $conf_UAM[15]=='true' ? 'checked="checked"' : '' ,
    603                                                 'UAM_GHOSTRACKER_FALSE'             => $conf_UAM[15]=='false' ? 'checked="checked"' : '' ,
    604             'UAM_GHOSTRACKER_DAYLIMIT'          => $conf_UAM[16],
    605             'UAM_GHOSTRACKER_REMINDERTEXT'      => $conf_UAM[17],
    606             'UAM_ADDLASTVISIT_TRUE'             => $conf_UAM[18]=='true' ? 'checked="checked"' : '' ,
    607             'UAM_ADDLASTVISIT_FALSE'            => $conf_UAM[18]=='false' ? 'checked="checked"' : '' ,
    608             'UAM_ADMINCONFMAIL_TRUE'            => $conf_UAM[19]=='true' ? 'checked="checked"' : '' ,
    609             'UAM_ADMINCONFMAIL_FALSE'           => $conf_UAM[19]=='false' ? 'checked="checked"' : '' ,
    610             'UAM_REDIRTOPROFILE_TRUE'           => $conf_UAM[20]=='true' ? 'checked="checked"' : '' ,
    611             'UAM_REDIRTOPROFILE_FALSE'          => $conf_UAM[20]=='false' ? 'checked="checked"' : '' ,
    612             'UAM_GTAUTO_TRUE'                   => $conf_UAM[21]=='true' ? 'checked="checked"' : '' ,
    613             'UAM_GTAUTO_FALSE'                  => $conf_UAM[21]=='false' ? 'checked="checked"' : '' ,
    614             'UAM_GTAUTOMAIL_TRUE'               => $conf_UAM[22]=='true' ? 'checked="checked"' : '' ,
    615             'UAM_GTAUTOMAIL_FALSE'              => $conf_UAM[22]=='false' ? 'checked="checked"' : '' ,
    616             'UAM_GTAUTODEL_TEXT'                => $conf_UAM[23],
    617             'UAM_GTAUTOMAILTEXT'                => $conf_UAM[24],
    618                                                 'UAM_Downgrade_Group'               => $conf_UAM[25],
    619                                                 'UAM_Downgrade_Status'              => $conf_UAM[26],
    620             'UAM_ADMINVALIDATIONMAIL_TEXT'      => $conf_UAM[27],
    621             'UAM_CUSTOMPASSWRETR_TRUE'          => $conf_UAM[28]=='true' ? 'checked="checked"' : '' ,
    622             'UAM_CUSTOMPASSWRETR_FALSE'         => $conf_UAM[28]=='false' ? 'checked="checked"' : '' ,
    623             'UAM_CUSTOMPASSWRETR_TEXT'          => $conf_UAM[29],
    624             'UAM_USRAUTO_TRUE'                  => $conf_UAM[30]=='true' ? 'checked="checked"' : '' ,
    625             'UAM_USRAUTO_FALSE'                 => $conf_UAM[30]=='false' ? 'checked="checked"' : '' ,
    626             'UAM_USRAUTODEL_TEXT'               => $conf_UAM[31],
    627             'UAM_USRAUTOMAIL_TRUE'              => $conf_UAM[32]=='true' ? 'checked="checked"' : '' ,
    628             'UAM_USRAUTOMAIL_FALSE'             => $conf_UAM[32]=='false' ? 'checked="checked"' : '' ,
    629             'UAM_STUFFS_TRUE'                   => $conf_UAM[33]=='true' ? 'checked="checked"' : '' ,
    630             'UAM_STUFFS_FALSE'                  => $conf_UAM[33]=='false' ? 'checked="checked"' : '' ,
    631             'UAM_HIDEPASSW_TRUE'                => $conf_UAM[34]=='true' ? 'checked="checked"' : '' ,
    632             'UAM_HIDEPASSW_FALSE'               => $conf_UAM[34]=='false' ? 'checked="checked"' : '' ,
    633                                                 'UAM_NO_VALID_LEVEL'                => $conf_UAM[35],
    634                                                 'UAM_VALID_LEVEL'                   => $conf_UAM[36],
    635             'UAM_DOWNGRADE_LEVEL'               => $conf_UAM[37],
    636             'UAM_PWDRESET_TRUE'                 => $conf_UAM[38]=='true' ? 'checked="checked"' : '' ,
    637             'UAM_PWDRESET_FALSE'                => $conf_UAM[38]=='false' ? 'checked="checked"' : '' ,
    638             'UAM_REJECTCONNECT_TRUE'            => $conf_UAM[39]=='true' ? 'checked="checked"' : '' ,
    639             'UAM_REJECTCONNECT_FALSE'           => $conf_UAM[39]=='false' ? 'checked="checked"' : '' ,
    640             'UAM_REJECTCONNECT_TEXT'            => $conf_UAM[40],
    641             'UAM_CONFIRMMAIL_SUBJECT'           => $conf_UAM[41],
    642             'UAM_CONFIRMMAIL_REMAIL_SUBJECT'    => $conf_UAM[42],
    643             'UAM_INFOMAIL_SUBJECT'              => $conf_UAM[43],
    644             'UAM_GTAUTOMAIL_SUBJECT'            => $conf_UAM[44],
    645             'UAM_GTREMINDER_SUBJECT'            => $conf_UAM[45],
    646             'UAM_ADMINVALIDATIONMAIL_SUBJECT'   => $conf_UAM[46],
     576                                                'UAM_MAIL_INFO_TRUE'                => $conf_UAM['MAIL_INFO']=='true' ? 'checked="checked"' : '' ,
     577                                                'UAM_MAIL_INFO_FALSE'               => $conf_UAM['MAIL_INFO']=='false' ? 'checked="checked"' : '' ,
     578                                                'UAM_MAILINFO_TEXT'                 => $conf_UAM['MAILINFO_TEXT'],
     579                                                'UAM_USERNAME_CHAR_TRUE'            => $conf_UAM['USERNAME_CHAR']=='true' ? 'checked="checked"' : '' ,
     580                                                'UAM_USERNAME_CHAR_FALSE'           => $conf_UAM['USERNAME_CHAR']=='false' ? 'checked="checked"' : '' ,
     581                                                'UAM_USERNAME_CHAR_LIST'            => $conf_UAM['USERNAME_CHAR_LIST'],
     582                                                'UAM_CONFIRM_MAIL_TRUE'             => $conf_UAM['CONFIRM_MAIL']=='true' ? 'checked="checked"' : '' ,
     583                                                'UAM_CONFIRM_MAIL_FALSE'            => $conf_UAM['CONFIRM_MAIL']=='false' ? 'checked="checked"' : '' ,
     584            'UAM_CONFIRM_MAIL_LOCAL'            => $conf_UAM['CONFIRM_MAIL']=='local' ? 'checked="checked"' : '' ,
     585                                                'UAM_CONFIRMMAIL_TEXT'              => $conf_UAM['CONFIRMMAIL_TEXT'],
     586                                                'UAM_No_Confirm_Group'              => $conf_UAM['NO_CONFIRM_GROUP'],
     587                                                'UAM_Validated_Group'               => $conf_UAM['VALIDATED_GROUP'],
     588                                                'UAM_No_Confirm_Status'             => $conf_UAM['NO_CONFIRM_STATUS'],
     589                                                'UAM_Validated_Status'              => $conf_UAM['VALIDATED_STATUS'],
     590                                                'UAM_MAILEXCLUSION_TRUE'            => $conf_UAM['MAILEXCLUSION']=='true' ? 'checked="checked"' : '' ,
     591                                                'UAM_MAILEXCLUSION_FALSE'           => $conf_UAM['MAILEXCLUSION']=='false' ? 'checked="checked"' : '' ,
     592                                                'UAM_MAILEXCLUSION_LIST'            => $conf_UAM['MAILEXCLUSION_LIST'],
     593                                                'UAM_PASSWORDENF_TRUE'              => $conf_UAM['PASSWORDENF']=='true' ? 'checked="checked"' : '' ,
     594                                                'UAM_PASSWORDENF_FALSE'             => $conf_UAM['PASSWORDENF']=='false' ? 'checked="checked"' : '' ,
     595                                                'UAM_PASSWORD_SCORE'                => $conf_UAM['PASSWORD_SCORE'],
     596            'UAM_ADMINPASSWENF_TRUE'            => $conf_UAM['ADMINPASSWENF']=='true' ? 'checked="checked"' : '' ,
     597                                                'UAM_ADMINPASSWENF_FALSE'           => $conf_UAM['ADMINPASSWENF']=='false' ? 'checked="checked"' : '' ,
     598            'UAM_GHOSTRACKER_TRUE'              => $conf_UAM['GHOSTRACKER']=='true' ? 'checked="checked"' : '' ,
     599                                                'UAM_GHOSTRACKER_FALSE'             => $conf_UAM['GHOSTRACKER']=='false' ? 'checked="checked"' : '' ,
     600            'UAM_GHOSTRACKER_DAYLIMIT'          => $conf_UAM['GHOSTRACKER_DAYLIMIT'],
     601            'UAM_GHOSTRACKER_REMINDERTEXT'      => $conf_UAM['GHOSTRACKER_REMINDERTEXT'],
     602            'UAM_ADDLASTVISIT_TRUE'             => $conf_UAM['ADDLASTVISIT']=='true' ? 'checked="checked"' : '' ,
     603            'UAM_ADDLASTVISIT_FALSE'            => $conf_UAM['ADDLASTVISIT']=='false' ? 'checked="checked"' : '' ,
     604            'UAM_ADMINCONFMAIL_TRUE'            => $conf_UAM['ADMINCONFMAIL']=='true' ? 'checked="checked"' : '' ,
     605            'UAM_ADMINCONFMAIL_FALSE'           => $conf_UAM['ADMINCONFMAIL']=='false' ? 'checked="checked"' : '' ,
     606            'UAM_REDIRTOPROFILE_TRUE'           => $conf_UAM['REDIRTOPROFILE']=='true' ? 'checked="checked"' : '' ,
     607            'UAM_REDIRTOPROFILE_FALSE'          => $conf_UAM['REDIRTOPROFILE']=='false' ? 'checked="checked"' : '' ,
     608            'UAM_GTAUTO_TRUE'                   => $conf_UAM['GTAUTO']=='true' ? 'checked="checked"' : '' ,
     609            'UAM_GTAUTO_FALSE'                  => $conf_UAM['GTAUTO']=='false' ? 'checked="checked"' : '' ,
     610            'UAM_GTAUTOMAIL_TRUE'               => $conf_UAM['GTAUTOMAIL']=='true' ? 'checked="checked"' : '' ,
     611            'UAM_GTAUTOMAIL_FALSE'              => $conf_UAM['GTAUTOMAIL']=='false' ? 'checked="checked"' : '' ,
     612            'UAM_GTAUTODEL_TEXT'                => $conf_UAM['GTAUTODEL'],
     613            'UAM_GTAUTOMAILTEXT'                => $conf_UAM['GTAUTOMAILTEXT'],
     614                                                'UAM_Downgrade_Group'               => $conf_UAM['DOWNGRADE_GROUP'],
     615                                                'UAM_Downgrade_Status'              => $conf_UAM['DOWNGRADE_STATUS'],
     616            'UAM_ADMINVALIDATIONMAIL_TEXT'      => $conf_UAM['ADMINVALIDATIONMAIL'],
     617            'UAM_CUSTOMPASSWRETR_TRUE'          => $conf_UAM['CUSTOMPASSWRETR']=='true' ? 'checked="checked"' : '' ,
     618            'UAM_CUSTOMPASSWRETR_FALSE'         => $conf_UAM['CUSTOMPASSWRETR']=='false' ? 'checked="checked"' : '' ,
     619            'UAM_CUSTOMPASSWRETR_TEXT'          => $conf_UAM['CUSTOMPASSWRETR_TEXT'],
     620            'UAM_USRAUTO_TRUE'                  => $conf_UAM['USRAUTO']=='true' ? 'checked="checked"' : '' ,
     621            'UAM_USRAUTO_FALSE'                 => $conf_UAM['USRAUTO']=='false' ? 'checked="checked"' : '' ,
     622            'UAM_USRAUTODEL_TEXT'               => $conf_UAM['USRAUTODEL'],
     623            'UAM_USRAUTOMAIL_TRUE'              => $conf_UAM['USRAUTOMAIL']=='true' ? 'checked="checked"' : '' ,
     624            'UAM_USRAUTOMAIL_FALSE'             => $conf_UAM['USRAUTOMAIL']=='false' ? 'checked="checked"' : '' ,
     625            'UAM_STUFFS_TRUE'                   => $conf_UAM['STUFFS']=='true' ? 'checked="checked"' : '' ,
     626            'UAM_STUFFS_FALSE'                  => $conf_UAM['STUFFS']=='false' ? 'checked="checked"' : '' ,
     627            'UAM_HIDEPASSW_TRUE'                => $conf_UAM['HIDEPASSW']=='true' ? 'checked="checked"' : '' ,
     628            'UAM_HIDEPASSW_FALSE'               => $conf_UAM['HIDEPASSW']=='false' ? 'checked="checked"' : '' ,
     629                                                'UAM_NO_VALID_LEVEL'                => $conf_UAM['NO_VALID_LEVEL'],
     630                                                'UAM_VALID_LEVEL'                   => $conf_UAM['VALID_LEVEL'],
     631            'UAM_DOWNGRADE_LEVEL'               => $conf_UAM['DOWNGRADE_LEVEL'],
     632            'UAM_PWDRESET_TRUE'                 => $conf_UAM['PWDRESET']=='true' ? 'checked="checked"' : '' ,
     633            'UAM_PWDRESET_FALSE'                => $conf_UAM['PWDRESET']=='false' ? 'checked="checked"' : '' ,
     634            'UAM_REJECTCONNECT_TRUE'            => $conf_UAM['REJECTCONNECT']=='true' ? 'checked="checked"' : '' ,
     635            'UAM_REJECTCONNECT_FALSE'           => $conf_UAM['REJECTCONNECT']=='false' ? 'checked="checked"' : '' ,
     636            'UAM_REJECTCONNECT_TEXT'            => $conf_UAM['REJECTCONNECT_TEXT'],
     637            'UAM_CONFIRMMAIL_SUBJECT'           => $conf_UAM['CONFIRMMAIL_SUBJECT'],
     638            'UAM_CONFIRMMAIL_REMAIL_SUBJECT'    => $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT'],
     639            'UAM_INFOMAIL_SUBJECT'              => $conf_UAM['INFOMAIL_SUBJECT'],
     640            'UAM_GTAUTOMAIL_SUBJECT'            => $conf_UAM['GTAUTOMAIL_SUBJECT'],
     641            'UAM_GTREMINDER_SUBJECT'            => $conf_UAM['GTREMINDER_SUBJECT'],
     642            'UAM_ADMINVALIDATIONMAIL_SUBJECT'   => $conf_UAM['ADMINVALIDATIONMAIL_SUBJECT'],
    647643                                                'UAM_PASSWORD_TEST_SCORE'           => $UAM_Password_Test_Score,
    648644            'UAM_ERROR_REPORTS1'                => $UAM_Exclusionlist_Error,
     
    651647            'UAM_ERROR_REPORTS4'                => $UAM_Illegal_Flag_Error3,
    652648            'UAM_EMAIL_MANDATORY'               => $UAM_Email_Mandatory_Check,
    653                                                 'UAM_CONFIRMMAIL_TIMEOUT_TRUE'      => $conf_UAM_ConfirmMail[0]=='true' ? 'checked="checked"' : '' ,
    654                                                 'UAM_CONFIRMMAIL_TIMEOUT_FALSE'     => $conf_UAM_ConfirmMail[0]=='false' ? 'checked="checked"' : '' ,
    655                                                 'UAM_CONFIRMMAIL_DELAY'             => $conf_UAM_ConfirmMail[1],
    656             'UAM_CONFIRMMAIL_REMAIL_TRUE'       => $conf_UAM_ConfirmMail[3]=='true' ? 'checked="checked"' : '',
    657             'UAM_CONFIRMMAIL_REMAIL_FALSE'      => $conf_UAM_ConfirmMail[3]=='false' ? 'checked="checked"' : '',
    658             'UAM_CONFIRMMAIL_REMAIL_TXT1'       => $conf_UAM_ConfirmMail[2],
    659             'UAM_CONFIRMMAIL_REMAIL_TXT2'       => $conf_UAM_ConfirmMail[4],
    660             'UAM_CONFIRMMAIL_CUSTOM_TXT1'       => $conf_UAM_ConfirmMail[5],
    661             'UAM_CONFIRMMAIL_CUSTOM_TXT2'       => $conf_UAM_ConfirmMail[6],
     649                                                'UAM_CONFIRMMAIL_TIMEOUT_TRUE'      => $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']=='true' ? 'checked="checked"' : '' ,
     650                                                'UAM_CONFIRMMAIL_TIMEOUT_FALSE'     => $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']=='false' ? 'checked="checked"' : '' ,
     651                                                'UAM_CONFIRMMAIL_DELAY'             => $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'],
     652            'UAM_CONFIRMMAIL_REMAIL_TRUE'       => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL']=='true' ? 'checked="checked"' : '',
     653            'UAM_CONFIRMMAIL_REMAIL_FALSE'      => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL']=='false' ? 'checked="checked"' : '',
     654            'UAM_CONFIRMMAIL_REMAIL_TXT1'       => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1'],
     655            'UAM_CONFIRMMAIL_REMAIL_TXT2'       => $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2'],
     656            'UAM_CONFIRMMAIL_CUSTOM_TXT1'       => $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1'],
     657            'UAM_CONFIRMMAIL_CUSTOM_TXT2'       => $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2'],
    662658    )
    663659  );
     
    669665    // Username without forbidden keys
    670666    // -------------------------------
    671     if ( isset($conf_UAM[5]) and $conf_UAM[5] == 'true' )
     667    if ( isset($conf_UAM['USERNAME_CHAR']) and $conf_UAM['USERNAME_CHAR'] == 'true' )
    672668          {
    673669      $query = '
     
    689685    // Email without forbidden domain
    690686    // ------------------------------
    691     if ( isset($conf_UAM[10]) and $conf_UAM[10] == 'true' )
     687    if ( isset($conf_UAM['MAILEXCLUSION']) and $conf_UAM['MAILEXCLUSION'] == 'true' )
    692688    {
    693689      $query = '
     
    700696      while($row = pwg_db_fetch_assoc($result))
    701697      {
    702         $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]);
     698        $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM['MAILEXCLUSION_LIST']);
    703699        for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++)
    704700        {
     
    755751  $conf_UAM = unserialize($conf['UserAdvManager']);
    756752 
    757   if (isset($conf_UAM[18]) and $conf_UAM[18]=='true')
     753  if (isset($conf_UAM['ADDLASTVISIT']) and $conf_UAM['ADDLASTVISIT']=='true')
    758754  {
    759755// +-----------------------------------------------------------------------+
     
    805801                $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days
    806802 
    807         if (isset($conf_UAM[15]) and $conf_UAM[15]=='true' and !empty($conf_UAM[16]))
     803        if (isset($conf_UAM['GHOSTRACKER']) and $conf_UAM['GHOSTRACKER']=='true' and !empty($conf_UAM['GHOSTRACKER_DAYLIMIT']))
    808804                {
    809           if ($deltadays <= ($conf_UAM[16]/2))
     805          if ($deltadays <= ($conf_UAM['GHOSTRACKER_DAYLIMIT']/2))
    810806                {
    811807            $display = 'green';
    812808                }
    813809
    814           if (($deltadays > ($conf_UAM[16]/2)) and ($deltadays < $conf_UAM[16]))
     810          if (($deltadays > ($conf_UAM['GHOSTRACKER_DAYLIMIT']/2)) and ($deltadays < $conf_UAM['GHOSTRACKER_DAYLIMIT']))
    815811                {
    816812            $display = 'orange';
    817813                }
    818814
    819                 if ($deltadays >= $conf_UAM[16])
     815                if ($deltadays >= $conf_UAM['GHOSTRACKER_DAYLIMIT'])
    820816                {
    821817            $display = 'red';
     
    885881  $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']);
    886882       
    887   if (isset($conf_UAM[1]) and ($conf_UAM[1]=='true' or $conf_UAM[1]=='local'))
     883  if (isset($conf_UAM['CONFIRM_MAIL']) and ($conf_UAM['CONFIRM_MAIL']=='true' or $conf_UAM['CONFIRM_MAIL']=='local'))
    888884  {
    889885// +-----------------------------------------------------------------------+
     
    13511347    $Confirm_Local = "";
    13521348   
    1353     if ($conf_UAM[1] == 'local')
    1354     {
    1355       $Confirm_Local = $conf_UAM[1];
     1349    if ($conf_UAM['CONFIRM_MAIL'] == 'local')
     1350    {
     1351      $Confirm_Local = $conf_UAM['CONFIRM_MAIL'];
    13561352    }
    13571353    else
     
    14041400  $conf_UAM = unserialize($conf['UserAdvManager']);
    14051401       
    1406   if (isset($conf_UAM[16]) and $conf_UAM[15]=='true')
     1402  if (isset($conf_UAM['GHOSTRACKER_DAYLIMIT']) and $conf_UAM['GHOSTRACKER']=='true')
    14071403  {
    14081404// +-----------------------------------------------------------------------+
  • extensions/UserAdvManager/trunk/changelog.txt.php

    r20703 r21075  
    376376            Update tr_TR, thanks to : hakanselcuk
    377377
     378-- 2.50.0 : Compliance with Piwigo 2.5
     379            Bug 2764 fixed - Code refactory : Change config variables to assoc array and $_POST vars control before writing conf in database - Thx to flop25 for his advices ;-)
     380            Update fr_FR
     381            Update de_DE, thanks to : stephy
     382            Update tr_TR, thanks to : hakanselcuk and LazBoy
     383            Update it_IT, thanks to : Ericnet
     384           
    378385*/
    379386?>
  • extensions/UserAdvManager/trunk/include/functions.inc.php

    r20703 r21075  
    4040 
    4141  // Check mandatory email address for email exclusion
    42   if (!$conf['obligatory_user_mail_address'] and $conf_UAM[10] == 'true')
     42  if (!$conf['obligatory_user_mail_address'] and $conf_UAM['MAILEXCLUSION'] == 'true')
    4343  {
    4444    array_push($page['warnings'], l10n('UAM_mail_exclusion_error'));
     
    6464  if (!is_admin() and !is_a_guest() and $user['username'] != "16" and $user['username'] != "18")
    6565  {
    66     if ((isset($conf_UAM[15]) and $conf_UAM[15] == 'true') or (isset($conf_UAM[18]) and $conf_UAM[18] == 'true'))
     66    if ((isset($conf_UAM['GHOSTRACKER']) and $conf_UAM['GHOSTRACKER'] == 'true') or (isset($conf_UAM['ADDLASTVISIT']) and $conf_UAM['ADDLASTVISIT'] == 'true'))
    6767    {
    6868      $userid = get_userid($user['username']);
     
    103103
    104104    // Perform user logout after registration if not validated
    105     if ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and !is_webmaster() )
     105    if ((isset($conf_UAM['REJECTCONNECT']) and $conf_UAM['REJECTCONNECT'] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and !is_webmaster() )
    106106    {
    107107      invalidate_user_cache();
     
    141141    //Bug 2829 fix not working - if (isset($page['page']) and ($page['page'] != 'user_list'))
    142142    //{
    143       if (isset($conf_UAM[1]) and $conf_UAM[1] == 'local')
     143      if (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local')
    144144      {
    145145        // This is to set user to "waiting" group or status and without ConfirMail until admin validation
     
    157157      // Sending registration confirmation by email
    158158      // ------------------------------------------
    159       elseif (isset($conf_UAM[1]) and $conf_UAM[1] == 'true')
    160       {
    161         if (is_admin() and isset($conf_UAM[19]) and $conf_UAM[19] == 'true')
     159      elseif (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true')
     160      {
     161        if (is_admin() and isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'true')
    162162        {
    163163          SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
    164164        }
    165         elseif (is_admin() and isset($conf_UAM[19]) and $conf_UAM[19] == 'false')
     165        elseif (is_admin() and isset($conf_UAM['ADMINCONFMAIL']) and $conf_UAM['ADMINCONFMAIL'] == 'false')
    166166        {
    167167          SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
     
    217217    // Password enforcement control
    218218    // ----------------------------
    219     if (isset($conf_UAM[12]) and $conf_UAM[12] == 'true' and !empty($conf_UAM[13]))
     219    if (isset($conf_UAM['PASSWORDENF']) and $conf_UAM['PASSWORDENF'] == 'true' and !empty($conf_UAM['PASSWORD_SCORE']))
    220220    {
    221221      if (!empty($user['password']) and !is_admin())
     
    223223        $PasswordCheck = testpassword($user['password']);
    224224 
    225         if ($PasswordCheck < $conf_UAM[13])
     225        if ($PasswordCheck < $conf_UAM['PASSWORD_SCORE'])
    226226        {
    227227          $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck);
    228           $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[13];
     228          $lang['reg_err_pass'] = l10n_args($message).$conf_UAM['PASSWORD_SCORE'];
    229229          array_push($errors, $lang['reg_err_pass']);
    230230        }
    231231      }
    232       else if (!empty($user['password']) and is_admin() and isset($conf_UAM[14]) and $conf_UAM[14] == 'true')
     232      else if (!empty($user['password']) and is_admin() and isset($conf_UAM['ADMINPASSWENF']) and $conf_UAM['ADMINPASSWENF'] == 'true')
    233233      {
    234234        $PasswordCheck = testpassword($user['password']);
    235235 
    236         if ($PasswordCheck < $conf_UAM[13])
     236        if ($PasswordCheck < $conf_UAM['PASSWORD_SCORE'])
    237237        {
    238238          $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck);
    239           $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[13];
     239          $lang['reg_err_pass'] = l10n_args($message).$conf_UAM['PASSWORD_SCORE'];
    240240          array_push($errors, $lang['reg_err_pass']);
    241241        }
     
    245245    // Username without forbidden keys
    246246    // -------------------------------
    247     if (isset($conf_UAM[5]) and $conf_UAM[5] == 'true' and !empty($user['username']) and ValidateUsername($user['username']) and !is_admin())
    248     {
    249       $lang['reg_err_login1'] = l10n('UAM_reg_err_login2')."'".$conf_UAM[6]."'";
     247    if (isset($conf_UAM['USERNAME_CHAR']) and $conf_UAM['USERNAME_CHAR'] == 'true' and !empty($user['username']) and ValidateUsername($user['username']) and !is_admin())
     248    {
     249      $lang['reg_err_login1'] = l10n('UAM_reg_err_login2')."'".$conf_UAM['USERNAME_CHAR_LIST']."'";
    250250      array_push($errors, $lang['reg_err_login1']);
    251251    }
     
    253253    // Email without forbidden domains
    254254    // -------------------------------
    255     if (isset($conf_UAM[10]) and $conf_UAM[10] == 'true' and !empty($user['email']) and ValidateEmailProvider($user['email']) and !is_admin())
    256     {
    257       $lang['reg_err_login1'] = l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'";
     255    if (isset($conf_UAM['MAILEXCLUSION']) and $conf_UAM['MAILEXCLUSION'] == 'true' and !empty($user['email']) and ValidateEmailProvider($user['email']) and !is_admin())
     256    {
     257      $lang['reg_err_login1'] = l10n('UAM_reg_err_login5')."'".$conf_UAM['MAILEXCLUSION_LIST']."'";
    258258      array_push($errors, $lang['reg_err_login1']);
    259259    }
     
    274274  // Update first redirection parameter
    275275  // ----------------------------------
    276   if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))
     276  if ((isset($conf_UAM['REDIRTOPROFILE']) and $conf_UAM['REDIRTOPROFILE'] == 'true'))
    277277  {
    278278    $user_idsOK = array();
     
    292292  // Special message display for password reset
    293293  // ------------------------------------------
    294   if ((isset($conf_UAM[38]) and $conf_UAM[38] == 'true'))
     294  if ((isset($conf_UAM['PWDRESET']) and $conf_UAM['PWDRESET'] == 'true'))
    295295  {
    296296    if (UAM_check_pwgreset($user['id']))
     
    306306    // Email without forbidden domains
    307307    // -------------------------------
    308     if (isset($conf_UAM[10]) and $conf_UAM[10] == 'true' and !empty($_POST['mail_address']))
     308    if (isset($conf_UAM['MAILEXCLUSION']) and $conf_UAM['MAILEXCLUSION'] == 'true' and !empty($_POST['mail_address']))
    309309    {
    310310      if (ValidateEmailProvider($_POST['mail_address']))
    311311      {
    312         $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'");
     312        $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM['MAILEXCLUSION_LIST']."'");
    313313        unset($_POST['validate']);
    314314      }
     
    317317    // Password reset control
    318318    // ----------------------
    319     if (isset($conf_UAM[38]) and $conf_UAM[38] == 'true' and UAM_check_pwgreset($user['id']))
     319    if (isset($conf_UAM['PWDRESET']) and $conf_UAM['PWDRESET'] == 'true' and UAM_check_pwgreset($user['id']))
    320320    {
    321321      // if password not changed then pwdreset field = true else pwdreset field = false
     
    341341      // Password enforcement control
    342342      // ----------------------------
    343       if (isset($conf_UAM[12]) and $conf_UAM[12] == 'true' and !empty($conf_UAM[13]))
     343      if (isset($conf_UAM['PASSWORDENF']) and $conf_UAM['PASSWORDENF'] == 'true' and !empty($conf_UAM['PASSWORD_SCORE']))
    344344      {
    345345        $PasswordCheck = testpassword($_POST['use_new_pwd']);
    346346
    347         if ($PasswordCheck < $conf_UAM[13])
     347        if ($PasswordCheck < $conf_UAM['PASSWORD_SCORE'])
    348348        {
    349349          $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck);
    350           $template->append('errors', l10n_args($message).$conf_UAM[13]);
     350          $template->append('errors', l10n_args($message).$conf_UAM['PASSWORD_SCORE']);
    351351          unset($_POST['use_new_pwd']);
    352352          unset($_POST['validate']);
     
    357357    // Sending registration confirmation by email
    358358    // ------------------------------------------
    359     if ((isset($conf_UAM[1]) and $conf_UAM[1] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
     359    if ((isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true') or (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local'))
    360360    {
    361361      $confirm_mail_need = false;
     
    373373        // This is to send a new validation key
    374374        // ------------------------------------
    375         if ($_POST['mail_address'] != $current_email and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
     375        if ($_POST['mail_address'] != $current_email and (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true'))
    376376        {
    377377          SetPermission($user['id']);// Set to "waiting" group or status until user validation
     
    382382        // This is to set the user to "waiting" group or status until admin validation
    383383        // ---------------------------------------------------------------------------
    384         elseif ($_POST['mail_address'] != $current_email and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
     384        elseif ($_POST['mail_address'] != $current_email and (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local'))
    385385        {
    386386          SetPermission($user['id']);// Set to "waiting" group or status until admin validation
     
    390390      }
    391391
    392       if (((!empty($_POST['use_new_pwd']) and (isset($conf_UAM[0]) and $conf_UAM[0] == 'true')) or $confirm_mail_need))
     392      if (((!empty($_POST['use_new_pwd']) and (isset($conf_UAM['MAIL_INFO']) and $conf_UAM['MAIL_INFO'] == 'true')) or $confirm_mail_need))
    393393      {
    394394        $query = '
     
    423423  // Performing GhostTracker scheduled tasks
    424424  // ---------------------------------------
    425   if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true'))
     425  if ((isset($conf_UAM['GTAUTO']) and $conf_UAM['GTAUTO'] == 'true'))
    426426  {
    427427    UAM_GT_ScheduledTasks();
     
    430430  // Performing User validation scheduled tasks
    431431  // ------------------------------------------
    432   if ((isset($conf_UAM[30]) and $conf_UAM[30] == 'true'))
     432  if ((isset($conf_UAM['USRAUTO']) and $conf_UAM['USRAUTO'] == 'true'))
    433433  {
    434434    UAM_USR_ScheduledTasks();
     
    436436
    437437  // Avoid login into public galleries until registration confirmation is done
    438   if ((isset($conf_UAM[39]) and $conf_UAM[39] == 'false') or ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and UAM_UsrReg_Verif($user['id'])) or  (!is_admin() and !is_webmaster()))
     438  if ((isset($conf_UAM['REJECTCONNECT']) and $conf_UAM['REJECTCONNECT'] == 'false') or ((isset($conf_UAM['REJECTCONNECT']) and $conf_UAM['REJECTCONNECT'] == 'true') and UAM_UsrReg_Verif($user['id'])) or  (!is_admin() and !is_webmaster()))
    439439  {
    440440    // Performing redirection to profile page on first login
    441441    // -----------------------------------------------------
    442     if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))
     442    if ((isset($conf_UAM['REDIRTOPROFILE']) and $conf_UAM['REDIRTOPROFILE'] == 'true'))
    443443    {
    444444      $query ='
     
    459459    // Performing redirection to profile page for password reset
    460460    // ---------------------------------------------------------
    461     if ((isset($conf_UAM[38]) and $conf_UAM[38] == 'true'))
     461    if ((isset($conf_UAM['PWDRESET']) and $conf_UAM['PWDRESET'] == 'true'))
    462462    {
    463463      $query ='
     
    477477    }
    478478  }
    479   elseif ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and !is_webmaster())
     479  elseif ((isset($conf_UAM['REJECTCONNECT']) and $conf_UAM['REJECTCONNECT'] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and !is_webmaster())
    480480  {
    481481    // Logged-in user cleanup, session destruction and redirected to custom page
     
    543543  // Auto group, status or privacy level downgrade and autodeletion if user already reminded
    544544  // ---------------------------------------------------------------------------------------
    545   if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true') and ((isset($conf_UAM[25]) and $conf_UAM[25] <> -1) or (isset($conf_UAM[26]) and $conf_UAM[26] <> -1) or (isset($conf_UAM[37]) and $conf_UAM[37] <> -1)))
     545  if ((isset($conf_UAM['GTAUTO']) and $conf_UAM['GTAUTO'] == 'true') and ((isset($conf_UAM['DOWNGRADE_GROUP']) and $conf_UAM['DOWNGRADE_GROUP'] <> -1) or (isset($conf_UAM['DOWNGRADE_STATUS']) and $conf_UAM['DOWNGRADE_STATUS'] <> -1) or (isset($conf_UAM['DOWNGRADE_LEVEL']) and $conf_UAM['DOWNGRADE_LEVEL'] <> -1)))
    546546  {
    547547    if (count($collection) > 0)
     
    625625            // Delete user from all groups
    626626            // ---------------------------
    627             if ($conf_UAM[2] <> -1 and $conf_UAM[3] <> -1)
     627            if ($conf_UAM['NO_CONFIRM_GROUP'] <> -1 and $conf_UAM['VALIDATED_GROUP'] <> -1)
    628628            {
    629629                        $query = '
     
    631631WHERE user_id = '.$user_id.'
    632632  AND (
    633     group_id = '.$conf_UAM[2].'
     633    group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
    634634  OR
    635     group_id = '.$conf_UAM[3].'
     635    group_id = '.$conf_UAM['VALIDATED_GROUP'].'
    636636  )
    637637;';
     
    641641            // Change user status
    642642            // ------------------
    643             if ($conf_UAM[26] <> -1)
     643            if ($conf_UAM['DOWNGRADE_STATUS'] <> -1)
    644644            {
    645645              $query = '
    646646UPDATE '.USER_INFOS_TABLE.'
    647 SET status = "'.$conf_UAM[26].'"
     647SET status = "'.$conf_UAM['DOWNGRADE_STATUS'].'"
    648648WHERE user_id = '.$user_id.'
    649649;';
     
    653653            // Change user group
    654654            // -----------------
    655             if ($conf_UAM[25] <> -1)
     655            if ($conf_UAM['DOWNGRADE_GROUP'] <> -1)
    656656            {
    657657              $query = '
     
    659659  (user_id, group_id)
    660660VALUES
    661   ('.$user_id.', "'.$conf_UAM[25].'")
     661  ('.$user_id.', "'.$conf_UAM['DOWNGRADE_GROUP'].'")
    662662;';
    663663              pwg_query($query);
     
    666666            // Change user privacy level
    667667            // -------------------------
    668             if ($conf_UAM[37] <> -1)
     668            if ($conf_UAM['DOWNGRADE_LEVEL'] <> -1)
    669669            {
    670670              $query = '
    671671UPDATE '.USER_INFOS_TABLE.'
    672 SET level = "'.$conf_UAM[37].'"
     672SET level = "'.$conf_UAM['DOWNGRADE_LEVEL'].'"
    673673WHERE user_id = '.$user_id.'
    674674;';
     
    678678            // Auto send email notification on group / status downgrade
    679679            // --------------------------------------------------------
    680             if (isset($conf_UAM[22]) and $conf_UAM[22] == 'true')
     680            if (isset($conf_UAM['GTAUTOMAIL']) and $conf_UAM['GTAUTOMAIL'] == 'true')
    681681            {
    682682              // Set reminder true
     
    754754  // Unvalidated accounts auto email sending and autodeletion if user already reminded
    755755  // ---------------------------------------------------------------------------------
    756   if ((isset($conf_UAM[30]) and $conf_UAM[30] == 'true'))
     756  if ((isset($conf_UAM['USRAUTO']) and $conf_UAM['USRAUTO'] == 'true'))
    757757  {
    758758    if (count($collection) > 0)
     
    782782        // If never reminded before, send reminder and set reminder True
    783783        // -------------------------------------------------------------
    784         if (!$reminder and isset($conf_UAM[32]) and $conf_UAM[32] == 'true')
     784        if (!$reminder and isset($conf_UAM['USRAUTOMAIL']) and $conf_UAM['USRAUTOMAIL'] == 'true')
    785785        {
    786786          $typemail = 1;
     
    836836          // If never reminded before, send reminder and set reminder True
    837837          // -------------------------------------------------------------
    838           if (!$reminder and isset($conf_UAM[32]) and $conf_UAM[32] == 'true')
     838          if (!$reminder and isset($conf_UAM['USRAUTOMAIL']) and $conf_UAM['USRAUTOMAIL'] == 'true')
    839839          {
    840840            $typemail = 1;
     
    884884      // Email without forbidden domains
    885885      // -------------------------------
    886       if (isset($conf_UAM[10]) and $conf_UAM[10] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email']))
    887       {
    888         $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'");
     886      if (isset($conf_UAM['MAILEXCLUSION']) and $conf_UAM['MAILEXCLUSION'] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email']))
     887      {
     888        $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM['MAILEXCLUSION_LIST']."'");
    889889        unset($_POST['submit_add']);
    890890      }
     
    915915
    916916    // Connexion rejected until validation
    917     if (isset($conf_UAM[40]) and !empty($conf_UAM[40]) and $_GET['UAM_msg']=="rejected")
     917    if (isset($conf_UAM['REJECTCONNECT_TEXT']) and !empty($conf_UAM['REJECTCONNECT_TEXT']) and $_GET['UAM_msg']=="rejected")
    918918    {
    919919      // Management of Extension flags ([mygallery], [myurl])
     
    926926      if (function_exists('get_user_language_desc'))
    927927      {
    928         $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[40]));
    929       }
    930       else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM[40]));
     928        $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['REJECTCONNECT_TEXT']));
     929      }
     930      else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM['REJECTCONNECT_TEXT']));
    931931
    932932      $page["errors"][]=$custom_text;
     
    934934
    935935    // User account deleted after validation deadline - Triggered by any other user
    936     elseif (isset($conf_UAM[23]) and !empty($conf_UAM[23]) and $_GET['UAM_msg']=="deleted")
     936    elseif (isset($conf_UAM['GTAUTODEL']) and !empty($conf_UAM['GTAUTODEL']) and $_GET['UAM_msg']=="deleted")
    937937    {
    938938      // Management of Extension flags ([mygallery], [myurl]) - [username] flag can't be used here
     
    945945      if (function_exists('get_user_language_desc'))
    946946      {
    947         $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[23]));
    948       }
    949       else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM[23]));
     947        $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['GTAUTODEL']));
     948      }
     949      else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM['GTAUTODEL']));
    950950
    951951      $page["errors"][]=$custom_text;
     
    953953
    954954    // User account deleted after validation deadline - Triggered by user himself
    955     elseif (isset($conf_UAM[31]) and !empty($conf_UAM[31]) and $_GET['UAM_msg']=="deleted")
     955    elseif (isset($conf_UAM['USRAUTODEL']) and !empty($conf_UAM['USRAUTODEL']) and $_GET['UAM_msg']=="deleted")
    956956    {
    957957      // Management of Extension flags ([mygallery], [myurl]) - [username] flag can't be used here
     
    964964      if (function_exists('get_user_language_desc'))
    965965      {
    966         $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[31]));
    967       }
    968       else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM[31]));
     966        $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['USRAUTODEL']));
     967      }
     968      else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM['USRAUTODEL']));
    969969
    970970      $page["errors"][]=$custom_text;
     
    10001000    if (VerifyConfirmMail($key))
    10011001    {
    1002       if (isset($conf_UAM[1]) and $conf_UAM[1] == 'local')
     1002      if (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local')
    10031003      {
    10041004        validation_mail($userid);
     
    10301030      }
    10311031
    1032       if (isset($conf_UAM_ConfirmMail[5]) and !empty($conf_UAM_ConfirmMail[5]))
     1032      if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1']) and !empty($conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1']))
    10331033      {
    10341034        // Management of Extension flags ([username], [mygallery], [myurl])
     
    10431043        if (function_exists('get_user_language_desc'))
    10441044        {
    1045           $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[5]));
     1045          $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1']));
    10461046        }
    10471047        else
    10481048        {
    1049           $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[5]));
     1049          $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT1']));
    10501050        }
    10511051        $page['infos'][]=$custom_text;
     
    10541054    else
    10551055    {
    1056       if (isset($conf_UAM_ConfirmMail[6]) and !empty($conf_UAM_ConfirmMail[6]))
     1056      if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2']) and !empty($conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2']))
    10571057      {
    10581058        // Management of Extension flags ([username], [mygallery], [myurl])
     
    10671067        if (function_exists('get_user_language_desc'))
    10681068        {
    1069           $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[6]));
     1069          $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2']));
    10701070        }
    10711071        else
    10721072        {
    1073           $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[6]));
     1073          $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_CUSTOM_TXT2']));
    10741074        }
    10751075
     
    11001100  $conf_UAM = unserialize($conf['UserAdvManager']);
    11011101
    1102   if (isset($conf_UAM[28]) and $conf_UAM[28] == 'true')
     1102  if (isset($conf_UAM['CUSTOMPASSWRETR']) and $conf_UAM['CUSTOMPASSWRETR'] == 'true')
    11031103  {
    11041104    // Management of Extension flags ([mygallery], [myurl])
     
    11081108    $replacements[] = get_gallery_home_url();
    11091109
    1110     $infos = preg_replace($patterns, $replacements, $conf_UAM[29])."\n"."\n".$infos;
     1110    $infos = preg_replace($patterns, $replacements, $conf_UAM['CUSTOMPASSWRETR_TEXT'])."\n"."\n".$infos;
    11111111  }
    11121112  return $infos;
     
    11621162  {
    11631163    case 1: // Confirmation email on user registration - Without information email (already managed by Piwigo)
    1164       if (isset($conf_UAM[41]) and !empty($conf_UAM[41]))
     1164      if (isset($conf_UAM['CONFIRMMAIL_SUBJECT']) and !empty($conf_UAM['CONFIRMMAIL_SUBJECT']))
    11651165      {
    11661166        // Management of Extension flags ([username], [mygallery])
     
    11731173        if (function_exists('get_user_language_desc'))
    11741174        {
    1175           $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[41]))."\n\n";
    1176         }
    1177         else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[41]))."\n\n";
     1175          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_SUBJECT']))."\n\n";
     1176        }
     1177        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_SUBJECT']))."\n\n";
    11781178      }
    11791179
     
    11811181
    11821182    case 2: // Confirmation email on user profile update - With information email if modification done in user profile
    1183       if (isset($conf_UAM[41]) and !empty($conf_UAM[41]))
     1183      if (isset($conf_UAM['CONFIRMMAIL_SUBJECT']) and !empty($conf_UAM['CONFIRMMAIL_SUBJECT']))
    11841184      {
    11851185        // Management of Extension flags ([username], [mygallery])
     
    11921192        if (function_exists('get_user_language_desc'))
    11931193        {
    1194           $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[41]))."\n\n";
    1195         }
    1196         else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[41]))."\n\n";
     1194          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_SUBJECT']))."\n\n";
     1195        }
     1196        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_SUBJECT']))."\n\n";
    11971197      }
    11981198
    11991199      $password = !empty($password) ? $password : l10n('UAM_empty_pwd');
    12001200
    1201       if (isset($conf_UAM[8]) and !empty($conf_UAM[8]))
     1201      if (isset($conf_UAM['MAILINFO_TEXT']) and !empty($conf_UAM['MAILINFO_TEXT']))
    12021202      {
    12031203        // Management of Extension flags ([username], [mygallery], [myurl])
     
    12121212        if (function_exists('get_user_language_desc'))
    12131213        {
    1214           $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n";
    1215         }
    1216         else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n";
    1217       }
    1218 
    1219       if (isset($conf_UAM[0]) and $conf_UAM[0] == 'true')
    1220       {
    1221         if (isset($conf_UAM[34]) and $conf_UAM[34] == 'true') // Allow display of clear password in email
     1214          $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['MAILINFO_TEXT']))."\n\n";
     1215        }
     1216        else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM['MAILINFO_TEXT']))."\n\n";
     1217      }
     1218
     1219      if (isset($conf_UAM['MAIL_INFO']) and $conf_UAM['MAIL_INFO'] == 'true')
     1220      {
     1221        if (isset($conf_UAM['HIDEPASSW']) and $conf_UAM['HIDEPASSW'] == 'true') // Allow display of clear password in email
    12221222        {
    12231223          $infos1 = array(
     
    12431243
    12441244    case 3: // Only information email send to user if checked
    1245       if (isset($conf_UAM[43]) and !empty($conf_UAM[43]))
     1245      if (isset($conf_UAM['INFOMAIL_SUBJECT']) and !empty($conf_UAM['INFOMAIL_SUBJECT']))
    12461246      {
    12471247        // Management of Extension flags ([username], [mygallery])
     
    12541254        if (function_exists('get_user_language_desc'))
    12551255        {
    1256           $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[43]))."\n\n";
    1257         }
    1258         else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[43]))."\n\n";
     1256          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['INFOMAIL_SUBJECT']))."\n\n";
     1257        }
     1258        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['INFOMAIL_SUBJECT']))."\n\n";
    12591259      }
    12601260
    12611261      $password = !empty($password) ? $password : l10n('UAM_no_update_pwd');
    12621262
    1263       if (isset($conf_UAM[8]) and !empty($conf_UAM[8]))
     1263      if (isset($conf_UAM['MAILINFO_TEXT']) and !empty($conf_UAM['MAILINFO_TEXT']))
    12641264      {
    12651265        // Management of Extension flags ([username], [mygallery], [myurl])
     
    12741274        if (function_exists('get_user_language_desc'))
    12751275        {
    1276           $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n";
    1277         }
    1278         else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n";
    1279       }
    1280 
    1281       if (isset($conf_UAM[0]) and $conf_UAM[0] == 'true')
    1282       {
    1283         if (isset($conf_UAM[34]) and $conf_UAM[34] == 'true') // Allow display of clear password in email
     1276          $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['MAILINFO_TEXT']))."\n\n";
     1277        }
     1278        else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM['MAILINFO_TEXT']))."\n\n";
     1279      }
     1280
     1281      if (isset($conf_UAM['MAIL_INFO']) and $conf_UAM['MAIL_INFO'] == 'true')
     1282      {
     1283        if (isset($conf_UAM['HIDEPASSW']) and $conf_UAM['HIDEPASSW'] == 'true') // Allow display of clear password in email
    12841284        {
    12851285          $infos1 = array(
     
    13051305  }
    13061306
    1307   if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local')  and $confirm) // Add confirmation link ?
     1307  if (isset($conf_UAM['CONFIRM_MAIL']) and ($conf_UAM['CONFIRM_MAIL'] == 'true' or $conf_UAM['CONFIRM_MAIL'] == 'local')  and $confirm) // Add confirmation link ?
    13081308  {
    13091309    $infos2 = array(
     
    13121312    );
    13131313
    1314     if (isset($conf_UAM[9]) and !empty($conf_UAM[9])) // Add personal text in confirmation email ?
     1314    if (isset($conf_UAM['CONFIRMMAIL_TEXT']) and !empty($conf_UAM['CONFIRMMAIL_TEXT'])) // Add personal text in confirmation email ?
    13151315    {
    13161316      // Management of Extension flags ([username], [mygallery], [myurl], [Kdays])
     
    13231323      $replacements[] = get_gallery_home_url();
    13241324
    1325       if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'true') // [Kdays] replacement only if related option is active
     1325      if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'true') // [Kdays] replacement only if related option is active
    13261326      {
    13271327        $patterns[] = '#\[Kdays\]#i';
    1328         $replacements[] = $conf_UAM_ConfirmMail[1];
     1328        $replacements[] = $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'];
    13291329      }
    13301330
    13311331      if (function_exists('get_user_language_desc'))
    13321332      {
    1333         $infos2_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[9]))."\n\n";
    1334       }
    1335       else $infos2_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[9]))."\n\n";
     1333        $infos2_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_TEXT']))."\n\n";
     1334      }
     1335      else $infos2_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_TEXT']))."\n\n";
    13361336    }
    13371337  }
     
    13391339// Sending the email with subject and contents
    13401340// -------------------------------------------
    1341                 if (isset($conf_UAM[1]) and $conf_UAM[1] == 'local')
     1341                if (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'local')
    13421342                {
    13431343                switch_lang_to(get_default_language());
     
    14701470  {
    14711471    case 1: //Generating email content for remind with a new key
    1472       if (isset($conf_UAM[42]) and !empty($conf_UAM[42]))
     1472      if (isset($conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']) and !empty($conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))
    14731473      {
    14741474        // Management of Extension flags ([username], [mygallery])
     
    14811481        if (function_exists('get_user_language_desc'))
    14821482        {
    1483           $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[42]))."\n\n";
    1484         }
    1485         else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[42]))."\n\n";
    1486       }
    1487 
    1488       if (isset($conf_UAM_ConfirmMail[2]) and !empty($conf_UAM_ConfirmMail[2]) and isset($conf_UAM_ConfirmMail[3]) and $conf_UAM_ConfirmMail[3] == 'true' and $confirm)
     1483          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))."\n\n";
     1484        }
     1485        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))."\n\n";
     1486      }
     1487
     1488      if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1']) and !empty($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1']) and isset($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL'] == 'true' and $confirm)
    14891489      {
    14901490                // Management of Extension flags ([username], [mygallery], [myurl], [Kdays])
     
    14971497        $replacements[] = get_gallery_home_url();
    14981498
    1499         if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'true') // [Kdays] replacement only if related option is active
     1499        if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'true') // [Kdays] replacement only if related option is active
    15001500        {
    15011501          $patterns[] = '#\[Kdays\]#i';
    1502           $replacements[] = $conf_UAM_ConfirmMail[1];
     1502          $replacements[] = $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'];
    15031503        }
    15041504
    15051505        if (function_exists('get_user_language_desc'))
    15061506        {
    1507           $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[2]))."\n\n";
    1508         }
    1509                                 else $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[2]))."\n\n";
     1507          $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1']))."\n\n";
     1508        }
     1509                                else $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT1']))."\n\n";
    15101510
    15111511        $infos2 = array
     
    15281528
    15291529    case 2: //Generating email content for remind without a new key
    1530       if (isset($conf_UAM[42]) and !empty($conf_UAM[42]))
     1530      if (isset($conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']) and !empty($conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))
    15311531      {
    15321532        // Management of Extension flags ([username], [mygallery])
     
    15391539        if (function_exists('get_user_language_desc'))
    15401540        {
    1541           $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[42]))."\n\n";
    1542         }
    1543         else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[42]))."\n\n";
    1544       }
    1545 
    1546       if (isset($conf_UAM_ConfirmMail[4]) and !empty($conf_UAM_ConfirmMail[4]) and isset($conf_UAM_ConfirmMail[3]) and $conf_UAM_ConfirmMail[3] == 'true' and !$confirm)
     1541          $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))."\n\n";
     1542        }
     1543        else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['CONFIRMMAIL_REMAIL_SUBJECT']))."\n\n";
     1544      }
     1545
     1546      if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2']) and !empty($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2']) and isset($conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL'] == 'true' and !$confirm)
    15471547      {
    15481548        // Management of Extension flags ([username], [mygallery], [myurl], [Kdays])
     
    15551555        $replacements[] = get_gallery_home_url();
    15561556
    1557         if (isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0] == 'true') // [Kdays] replacement only if related option is active
     1557        if (isset($conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT']) and $conf_UAM_ConfirmMail['CONFIRMMAIL_TIMEOUT'] == 'true') // [Kdays] replacement only if related option is active
    15581558        {
    15591559          $patterns[] = '#\[Kdays\]#i';
    1560           $replacements[] = $conf_UAM_ConfirmMail[1];
     1560          $replacements[] = $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'];
    15611561        }
    15621562
    15631563        if (function_exists('get_user_language_desc'))
    15641564        {
    1565           $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[4]))."\n\n";
    1566         }
    1567         else $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail[4]))."\n\n";
     1565          $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2']))."\n\n";
     1566        }
     1567        else $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM_ConfirmMail['CONFIRMMAIL_REMAIL_TXT2']))."\n\n";
    15681568      }
    15691569
     
    16221622  load_language('plugin.lang', UAM_PATH);
    16231623
    1624   if (isset($conf_UAM[45]) and !empty($conf_UAM[45]))
     1624  if (isset($conf_UAM['GTREMINDER_SUBJECT']) and !empty($conf_UAM['GTREMINDER_SUBJECT']))
    16251625  {
    16261626    // Management of Extension flags ([username], [mygallery])
     
    16331633    if (function_exists('get_user_language_desc'))
    16341634    {
    1635       $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[45]))."\n\n";
    1636     }
    1637     else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[45]))."\n\n";
    1638   }
    1639 
    1640   if (isset($conf_UAM[17]) and !empty($conf_UAM[17]) and isset($conf_UAM[15]) and $conf_UAM[15] == 'true')
     1635      $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['GTREMINDER_SUBJECT']))."\n\n";
     1636    }
     1637    else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['GTREMINDER_SUBJECT']))."\n\n";
     1638  }
     1639
     1640  if (isset($conf_UAM['GHOSTRACKER_REMINDERTEXT']) and !empty($conf_UAM['GHOSTRACKER_REMINDERTEXT']) and isset($conf_UAM['GHOSTRACKER']) and $conf_UAM['GHOSTRACKER'] == 'true')
    16411641  {
    16421642    // Management of Extension flags ([username], [mygallery], [myurl], [days])
     
    16491649    $replacements[] = get_gallery_home_url();
    16501650    $patterns[] = '#\[days\]#i';
    1651     $replacements[] = $conf_UAM[16];
     1651    $replacements[] = $conf_UAM['GHOSTRACKER_DAYLIMIT'];
    16521652
    16531653    if (function_exists('get_user_language_desc'))
    16541654    {
    1655       $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[17]))."\n\n";
     1655      $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['GHOSTRACKER_REMINDERTEXT']))."\n\n";
    16561656    }
    16571657    else
    16581658    {
    1659       $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM[17]))."\n\n";
     1659      $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM['GHOSTRACKER_REMINDERTEXT']))."\n\n";
    16601660    }
    16611661
     
    17191719  }
    17201720
    1721   if (isset($conf_UAM[44]) and !empty($conf_UAM[44]))
     1721  if (isset($conf_UAM['GTAUTOMAIL_SUBJECT']) and !empty($conf_UAM['GTAUTOMAIL_SUBJECT']))
    17221722  {
    17231723    // Management of Extension flags ([username], [mygallery])
     
    17301730    if (function_exists('get_user_language_desc'))
    17311731    {
    1732       $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[44]))."\n\n";
    1733     }
    1734     else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[44]))."\n\n";
    1735   }
    1736 
    1737   if (isset($conf_UAM[24]) and !empty($conf_UAM[24]))
     1732      $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['GTAUTOMAIL_SUBJECT']))."\n\n";
     1733    }
     1734    else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['GTAUTOMAIL_SUBJECT']))."\n\n";
     1735  }
     1736
     1737  if (isset($conf_UAM['GTAUTOMAILTEXT']) and !empty($conf_UAM['GTAUTOMAILTEXT']))
    17381738  {
    17391739    // Management of Extension flags ([username], [mygallery], [myurl])
     
    17481748    if (function_exists('get_user_language_desc'))
    17491749    {
    1750       $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[24]))."\n\n";
    1751     }
    1752     else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[24]))."\n\n";
     1750      $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['GTAUTOMAILTEXT']))."\n\n";
     1751    }
     1752    else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM['GTAUTOMAILTEXT']))."\n\n";
    17531753  }
    17541754
     
    18351835  $result = pwg_db_fetch_assoc(pwg_query($query));
    18361836
    1837   if (isset($conf_UAM[46]) and !empty($conf_UAM[46]))
     1837  if (isset($conf_UAM['ADMINVALIDATIONMAIL_SUBJECT']) and !empty($conf_UAM['ADMINVALIDATIONMAIL_SUBJECT']))
    18381838  {
    18391839    // Management of Extension flags ([username], [mygallery])
     
    18461846    if (function_exists('get_user_language_desc'))
    18471847    {
    1848       $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[46]))."\n\n";
    1849     }
    1850     else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[46]))."\n\n";
    1851   }
    1852 
    1853   if (isset($conf_UAM[27]) and !empty($conf_UAM[27]))
     1848      $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['ADMINVALIDATIONMAIL_SUBJECT']))."\n\n";
     1849    }
     1850    else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM['ADMINVALIDATIONMAIL_SUBJECT']))."\n\n";
     1851  }
     1852
     1853  if (isset($conf_UAM['ADMINVALIDATIONMAIL']) and !empty($conf_UAM['ADMINVALIDATIONMAIL']))
    18541854  {
    18551855    // Management of Extension flags ([username], [mygallery], [myurl])
     
    18631863    if (function_exists('get_user_language_desc'))
    18641864    {
    1865       $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[27]))."\n\n";
    1866     }
    1867     else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[27]))."\n\n";
     1865      $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM['ADMINVALIDATIONMAIL']))."\n\n";
     1866    }
     1867    else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM['ADMINVALIDATIONMAIL']))."\n\n";
    18681868  }
    18691869
     
    19521952WHERE user_id = '.$user_id.'
    19531953  AND (
    1954     group_id = '.$conf_UAM[2].'
     1954    group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
    19551955  OR
    1956     group_id = '.$conf_UAM[3].'
     1956    group_id = '.$conf_UAM['VALIDATED_GROUP'].'
    19571957  )
    19581958;';
     
    19621962    // Set user unvalidated status
    19631963    // ---------------------------
    1964     if (!is_admin() and $conf_UAM[7] <> -1)
     1964    if (!is_admin() and $conf_UAM['NO_CONFIRM_STATUS'] <> -1)
    19651965    {
    19661966      $query = '
    19671967UPDATE '.USER_INFOS_TABLE.'
    1968 SET status = "'.$conf_UAM[7].'"
     1968SET status = "'.$conf_UAM['NO_CONFIRM_STATUS'].'"
    19691969WHERE user_id = '.$user_id.'
    19701970;';
     
    19751975    // Set user unvalidated group
    19761976    // --------------------------
    1977     if (!is_admin() and $conf_UAM[2] <> -1)
     1977    if (!is_admin() and $conf_UAM['NO_CONFIRM_GROUP'] <> -1)
    19781978    {
    19791979      $query = '
     
    19811981  (user_id, group_id)
    19821982VALUES
    1983   ('.$user_id.', '.$conf_UAM[2].')
     1983  ('.$user_id.', '.$conf_UAM['NO_CONFIRM_GROUP'].')
    19841984;';
    19851985
     
    19891989    // Set user unvalidated privacy level
    19901990    // ----------------------------------
    1991     if (!is_admin() and $conf_UAM[35] <> -1)
     1991    if (!is_admin() and $conf_UAM['NO_VALID_LEVEL'] <> -1)
    19921992    {
    19931993      $query = '
    19941994UPDATE '.USER_INFOS_TABLE.'
    1995 SET level = "'.$conf_UAM[35].'"
     1995SET level = "'.$conf_UAM['NO_VALID_LEVEL'].'"
    19961996WHERE user_id = '.$user_id.'
    19971997;';
     
    20352035WHERE user_id = '.$user_id.'
    20362036  AND (
    2037     group_id = '.$conf_UAM[2].'
     2037    group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
    20382038  OR
    2039     group_id = '.$conf_UAM[3].'
     2039    group_id = '.$conf_UAM['VALIDATED_GROUP'].'
    20402040  )
    20412041;';
     
    20432043  pwg_query($query);
    20442044
    2045   if (!is_admin() and $conf_UAM[7] <> -1) // Set status
     2045  if (!is_admin() and $conf_UAM['NO_CONFIRM_STATUS'] <> -1) // Set status
    20462046  {
    20472047    $query = '
    20482048UPDATE '.USER_INFOS_TABLE.'
    2049 SET status = "'.$conf_UAM[7].'"
     2049SET status = "'.$conf_UAM['NO_CONFIRM_STATUS'].'"
    20502050WHERE user_id = '.$user_id.'
    20512051;';
     
    20542054  }
    20552055
    2056   if (!is_admin() and $conf_UAM[2] <> -1) // Set group
     2056  if (!is_admin() and $conf_UAM['NO_CONFIRM_GROUP'] <> -1) // Set group
    20572057  {
    20582058    $query = '
     
    20602060  (user_id, group_id)
    20612061VALUES
    2062   ('.$user_id.', '.$conf_UAM[2].')
     2062  ('.$user_id.', '.$conf_UAM['NO_CONFIRM_GROUP'].')
    20632063;';
    20642064
     
    20662066  }
    20672067
    2068   if (!is_admin() and $conf_UAM[35] <> -1) // Set privacy level
     2068  if (!is_admin() and $conf_UAM['NO_VALID_LEVEL'] <> -1) // Set privacy level
    20692069  {
    20702070    $query = '
     
    20722072  (user_id, level)
    20732073VALUES
    2074   ('.$user_id.', "'.$conf_UAM[35].'")
     2074  ('.$user_id.', "'.$conf_UAM['NO_VALID_LEVEL'].'")
    20752075;';
    20762076
     
    22612261        // Verify Confirmmail with time limit ON
    22622262                // -------------------------------------
    2263                                 if (isset ($conf_UAM_ConfirmMail[1]))
     2263                                if (isset ($conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY']))
    22642264        {
    22652265                                  // Dates formating and compare
     
    22782278                                        // Condition with the value set for time limit
    22792279                        // -------------------------------------------
    2280                                         if ($deltadays <= $conf_UAM_ConfirmMail[1]) // If Nb of days is less than the limit set
     2280                                        if ($deltadays <= $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY']) // If Nb of days is less than the limit set
    22812281          {
    22822282            $dbnow = date("Y-m-d H:i:s");
     
    23012301                                                pwg_query($query);
    23022302     
    2303                                                 if ($conf_UAM[2] <> -1) // Delete user from unvalidated users group
     2303                                                if ($conf_UAM['NO_CONFIRM_GROUP'] <> -1) // Delete user from unvalidated users group
    23042304                                                {
    23052305              $query = '
    23062306DELETE FROM '.USER_GROUP_TABLE.'
    23072307WHERE user_id = '.$data['user_id'].'
    2308   AND group_id = '.$conf_UAM[2].'
     2308  AND group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
    23092309;';
    23102310                                                        pwg_query($query);
    23112311            }
    23122312
    2313                                                 if ($conf_UAM[3] <> -1) // Add user to validated users group
     2313                                                if ($conf_UAM['VALIDATED_GROUP'] <> -1) // Add user to validated users group
    23142314                                                {
    23152315              $query = '
     
    23172317  (user_id, group_id)
    23182318VALUES
    2319   ('.$data['user_id'].', '.$conf_UAM[3].')
     2319  ('.$data['user_id'].', '.$conf_UAM['VALIDATED_GROUP'].')
    23202320;';
    23212321                                                        pwg_query($query);
    23222322            }
    23232323
    2324                                                 if ($conf_UAM[4] <> -1) // Change user's status
     2324                                                if ($conf_UAM['VALIDATED_STATUS'] <> -1) // Change user's status
    23252325                                                {
    23262326              $query = '
    23272327UPDATE '.USER_INFOS_TABLE.'
    2328 SET status = "'.$conf_UAM[4].'"
     2328SET status = "'.$conf_UAM['VALIDATED_STATUS'].'"
    23292329WHERE user_id = '.$data['user_id'].'
    23302330;';
     
    23322332            }
    23332333
    2334                                                 if ($conf_UAM[36] <> -1) // Change user's privacy level
     2334                                                if ($conf_UAM['VALID_LEVEL'] <> -1) // Change user's privacy level
    23352335                                                {
    23362336              $query = '
    23372337UPDATE '.USER_INFOS_TABLE.'
    2338 SET level = "'.$conf_UAM[36].'"
     2338SET level = "'.$conf_UAM['VALID_LEVEL'].'"
    23392339WHERE user_id = '.$data['user_id'].'
    23402340;';
     
    23562356                                                return true;
    23572357          }
    2358           elseif ($deltadays > $conf_UAM_ConfirmMail[1]) // If timelimit exeeds
     2358          elseif ($deltadays > $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY']) // If timelimit exeeds
    23592359          {
    23602360            return false;
     
    23862386          pwg_query($query);
    23872387
    2388           if ($conf_UAM[2] <> -1) // Delete user from unvalidated users group
     2388          if ($conf_UAM['NO_CONFIRM_GROUP'] <> -1) // Delete user from unvalidated users group
    23892389          {
    23902390            $query = '
    23912391DELETE FROM '.USER_GROUP_TABLE.'
    23922392WHERE user_id = '.$data['user_id'].'
    2393 AND group_id = '.$conf_UAM[2].'
     2393AND group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
    23942394;';
    23952395            pwg_query($query);
    23962396          }
    23972397
    2398           if ($conf_UAM[3] <> -1)
     2398          if ($conf_UAM['VALIDATED_GROUP'] <> -1)
    23992399          {
    24002400            $query = '
    24012401DELETE FROM '.USER_GROUP_TABLE.'
    24022402WHERE user_id = '.$data['user_id'].'
    2403 AND group_id = '.$conf_UAM[3].'
     2403AND group_id = '.$conf_UAM['VALIDATED_GROUP'].'
    24042404;';
    24052405            pwg_query($query);
     
    24092409  (user_id, group_id)
    24102410VALUES
    2411   ('.$data['user_id'].', '.$conf_UAM[3].')
     2411  ('.$data['user_id'].', '.$conf_UAM['VALIDATED_GROUP'].')
    24122412;';
    24132413            pwg_query($query);
    24142414          }
    24152415
    2416           if ($conf_UAM[4] <> -1) // Change user's status
     2416          if ($conf_UAM['VALIDATED_STATUS'] <> -1) // Change user's status
    24172417          {
    24182418            $query = '
    24192419UPDATE '.USER_INFOS_TABLE.'
    2420 SET status = "'.$conf_UAM[4].'"
     2420SET status = "'.$conf_UAM['VALIDATED_STATUS'].'"
    24212421WHERE user_id = '.$data['user_id'].'
    24222422;';
     
    24242424          }
    24252425
    2426           if ($conf_UAM[36] <> -1) // Change user's privacy level
     2426          if ($conf_UAM['VALID_LEVEL'] <> -1) // Change user's privacy level
    24272427          {
    24282428            $query = '
    24292429UPDATE '.USER_INFOS_TABLE.'
    2430 SET level = "'.$conf_UAM[36].'"
     2430SET level = "'.$conf_UAM['VALID_LEVEL'].'"
    24312431WHERE user_id = '.$data['user_id'].'
    24322432;';
     
    24722472                $conf_UAM = unserialize($conf['UserAdvManager']);
    24732473
    2474                 if (isset($conf_UAM[1]) and $conf_UAM[1] == 'true') // Set date of validation
     2474                if (isset($conf_UAM['CONFIRM_MAIL']) and $conf_UAM['CONFIRM_MAIL'] == 'true') // Set date of validation
    24752475                {
    24762476      $dbnow = date("Y-m-d H:i:s");
     
    24842484                }
    24852485
    2486                 if ($conf_UAM[2] <> -1) // Delete user from waiting group
     2486                if ($conf_UAM['NO_CONFIRM_GROUP'] <> -1) // Delete user from waiting group
    24872487                {
    24882488                                $query = '
    24892489DELETE FROM '.USER_GROUP_TABLE.'
    24902490WHERE user_id = '.$id.'
    2491                 AND group_id = '.$conf_UAM[2].'
     2491                AND group_id = '.$conf_UAM['NO_CONFIRM_GROUP'].'
    24922492;';
    24932493                                pwg_query($query);
    24942494                }
    24952495
    2496                 if ($conf_UAM[3] <> -1) // Set user's valid group
     2496                if ($conf_UAM['VALIDATED_GROUP'] <> -1) // Set user's valid group
    24972497                {
    24982498      $query = '
    24992499DELETE FROM '.USER_GROUP_TABLE.'
    25002500WHERE user_id = '.$id.'
    2501                 AND group_id = '.$conf_UAM[3].'
     2501                AND group_id = '.$conf_UAM['VALIDATED_GROUP'].'
    25022502;';
    25032503      pwg_query($query);
     
    25072507                (user_id, group_id)
    25082508VALUES
    2509                 ('.$id.', '.$conf_UAM[3].')
     2509                ('.$id.', '.$conf_UAM['VALIDATED_GROUP'].')
    25102510;';
    25112511      pwg_query($query);
    25122512                }
    25132513
    2514                 if ($conf_UAM[4] <> -1) // Set user's valid status
     2514                if ($conf_UAM['VALIDATED_STATUS'] <> -1) // Set user's valid status
    25152515                {
    25162516      $query = '
    25172517UPDATE '.USER_INFOS_TABLE.'
    2518 SET status = "'.$conf_UAM[4].'"
     2518SET status = "'.$conf_UAM['VALIDATED_STATUS'].'"
    25192519WHERE user_id = '.$id.'
    25202520;';
     
    25222522                }
    25232523
    2524                 if ($conf_UAM[36] <> -1) // Set user's valid privacy level
     2524                if ($conf_UAM['VALID_LEVEL'] <> -1) // Set user's valid privacy level
    25252525                {
    25262526      $query = '
    25272527UPDATE '.USER_INFOS_TABLE.'
    2528 SET level = "'.$conf_UAM[36].'"
     2528SET level = "'.$conf_UAM['VALID_LEVEL'].'"
    25292529WHERE user_id = '.$id.'
    25302530;';
     
    25562556  $conf_UAM = unserialize($conf['UserAdvManager']);
    25572557
    2558   if (isset($login) and isset($conf_UAM[6]) and !empty($conf_UAM[6]))
    2559   {
    2560     $conf_CharExclusion = preg_split("/,/",$conf_UAM[6]);
     2558  if (isset($login) and isset($conf_UAM['USERNAME_CHAR_LIST']) and !empty($conf_UAM['USERNAME_CHAR_LIST']))
     2559  {
     2560    $conf_CharExclusion = preg_split("/,/",$conf_UAM['USERNAME_CHAR_LIST']);
    25612561    for ($i = 0 ; $i < count($conf_CharExclusion) ; $i++)
    25622562    {
     
    26152615  $conf_UAM = unserialize($conf['UserAdvManager']);
    26162616
    2617                 if (isset($email) and isset($conf_UAM[11]) and !empty($conf_UAM[11]))
     2617                if (isset($email) and isset($conf_UAM['MAILEXCLUSION_LIST']) and !empty($conf_UAM['MAILEXCLUSION_LIST']))
    26182618                {
    2619       $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]);
     2619      $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM['MAILEXCLUSION_LIST']);
    26202620      for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++)
    26212621      {
     
    26692669    ON u.'.$conf['user_fields']['id'].' = ug.user_id
    26702670WHERE u.'.$conf['user_fields']['id'].' >= 3
    2671   AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_UAM_ConfirmMail[1].'"
    2672   OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_UAM_ConfirmMail[1].'")
     2671  AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'].'"
     2672  OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'].'")
    26732673                AND u.UAM_validated = "false"
    26742674ORDER BY ui.registration_date ASC
     
    27442744    ON u.'.$conf['user_fields']['id'].' = ui.user_id
    27452745WHERE u.'.$conf['user_fields']['id'].' >= 3
    2746   AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_UAM_ConfirmMail[1].'")
     2746  AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY'].'")
    27472747ORDER BY ui.registration_date ASC;';
    27482748
     
    27832783  INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv
    27842784    ON u.'.$conf['user_fields']['id'].' = lv.user_id
    2785 WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[16].'")
     2785WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM['GHOSTRACKER_DAYLIMIT'].'")
    27862786ORDER BY lv.lastvisit ASC;';
    27872787
     
    28302830  INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv
    28312831    ON u.'.$conf['user_fields']['id'].' = lv.user_id
    2832 WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[16].'")
     2832WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM['GHOSTRACKER_DAYLIMIT'].'")
    28332833ORDER BY lv.lastvisit ASC;';
    28342834
     
    29402940    // Condition with the value set for time limit
    29412941    // -------------------------------------------
    2942     if ($deltadays <= $conf_UAM_ConfirmMail[1]) // If Nb of days is less than the limit set
     2942    if ($deltadays <= $conf_UAM_ConfirmMail['CONFIRMMAIL_DELAY']) // If Nb of days is less than the limit set
    29432943    {
    29442944      return false;
     
    32003200    $result = pwg_query($query);
    32013201
    3202     while ($row = mysql_fetch_array($result))
     3202    while ($row = pwg_db_fetch_assoc($result))
    32033203    {
    32043204      if ($row['UAM_pwdreset'] == 'false')
     
    32643264      $insertions .= "DROP TABLE IF EXISTS ".$ListTables[$j].";\n\n";
    32653265
    3266       $array = mysql_fetch_array($res);
     3266      $array = pwg_db_fetch_row($res);
    32673267      $array[1] .= ";\n\n";
    32683268      $insertions .= $array[1];
    32693269
    3270       $req_table = pwg_query('SELECT * FROM '.$ListTables[$j]) or die(mysql_error());
    3271       $nb_fields = mysql_num_fields($req_table);
    3272       while ($line = mysql_fetch_array($req_table))
     3270      $req_table = pwg_query('DESCRIBE '.$ListTables[$j].';') or die(my_error());
     3271      $nb_fields = pwg_db_num_rows($req_table);
     3272      $req_table2 = pwg_query('SELECT * FROM '.$ListTables[$j]) or die(my_error());
     3273
     3274      while ($line = pwg_db_fetch_row($req_table2))
    32733275      {
    32743276        $insertions .= 'INSERT INTO '.$ListTables[$j].' VALUES (';
     
    32963298
    32973299  $pattern = "UserAdvManager%";
    3298   $req_table = pwg_query('SELECT * FROM '.CONFIG_TABLE.' WHERE param LIKE "'.$pattern.'";') or die(mysql_error());
    3299   $nb_fields = mysql_num_fields($req_table);
    3300 
    3301   while ($line = mysql_fetch_array($req_table))
     3300  $req_table = pwg_query('SELECT * FROM '.CONFIG_TABLE.' WHERE param LIKE "'.$pattern.'";') or die(my_error());
     3301  $nb_fields = pwg_db_num_rows($req_table);
     3302  $nb_fields = $nb_fields - 1;  // Fix the number of fields because pwg_db_num_rows() returns a bad number
     3303
     3304  while ($line = pwg_db_fetch_row($req_table))
    33023305  {
    33033306    $insertions = 'INSERT INTO '.CONFIG_TABLE.' VALUES (';
  • extensions/UserAdvManager/trunk/include/upgradedb.inc.php

    r20591 r21075  
    685685                $result = pwg_query($query);
    686686
    687                 while($row = mysql_fetch_array($result))
     687                while($row = pwg_db_fetch_assoc($result))
    688688                {
    689689                                $query = '
     
    703703                pwg_query($query);
    704704}
     705
     706
     707/* upgrade from 2.41.x to 2.50.0 */
     708/* ***************************** */
     709function upgrade_2410_2500()
     710{
     711  global $conf;
     712 
     713  load_language('plugin.lang', UAM_PATH);
     714
     715  // Upgrading options - Changing config variables to assoc array
     716  // ------------------------------------------------------------
     717 
     718  // Upgrade $conf_UAM options
     719  $conf_UAM = unserialize($conf['UserAdvManager']);
     720
     721  $Newconf_UAM = array(
     722    'MAIL_INFO'                   => $conf_UAM[0],
     723    'CONFIRM_MAIL'                => $conf_UAM[1],
     724    'NO_CONFIRM_GROUP'            => $conf_UAM[2],
     725    'VALIDATED_GROUP'             => $conf_UAM[3],
     726    'VALIDATED_STATUS'            => $conf_UAM[4],
     727    'USERNAME_CHAR'               => $conf_UAM[5],
     728    'USERNAME_CHAR_LIST'          => $conf_UAM[6],
     729    'NO_CONFIRM_STATUS'           => $conf_UAM[7],
     730    'MAILINFO_TEXT'               => $conf_UAM[8],
     731    'CONFIRMMAIL_TEXT'            => $conf_UAM[9],
     732    'MAILEXCLUSION'               => $conf_UAM[10],
     733    'MAILEXCLUSION_LIST'          => $conf_UAM[11],
     734    'PASSWORDENF'                 => $conf_UAM[12],
     735    'PASSWORD_SCORE'              => $conf_UAM[13],
     736    'ADMINPASSWENF'               => $conf_UAM[14],
     737    'GHOSTRACKER'                 => $conf_UAM[15],
     738    'GHOSTRACKER_DAYLIMIT'        => $conf_UAM[16],
     739    'GHOSTRACKER_REMINDERTEXT'    => $conf_UAM[17],
     740    'ADDLASTVISIT'                => $conf_UAM[18],
     741    'ADMINCONFMAIL'               => $conf_UAM[19],
     742    'REDIRTOPROFILE'              => $conf_UAM[20],
     743    'GTAUTO'                      => $conf_UAM[21],
     744    'GTAUTOMAIL'                  => $conf_UAM[22],
     745    'GTAUTODEL'                   => $conf_UAM[23],
     746    'GTAUTOMAILTEXT'              => $conf_UAM[24],
     747    'DOWNGRADE_GROUP'             => $conf_UAM[25],
     748    'DOWNGRADE_STATUS'            => $conf_UAM[26],
     749    'ADMINVALIDATIONMAIL'         => $conf_UAM[27],
     750    'CUSTOMPASSWRETR'             => $conf_UAM[28],
     751    'CUSTOMPASSWRETR_TEXT'        => $conf_UAM[29],
     752    'USRAUTO'                     => $conf_UAM[30],
     753    'USRAUTODEL'                  => $conf_UAM[31],
     754    'USRAUTOMAIL'                 => $conf_UAM[32],
     755    'STUFFS'                      => $conf_UAM[33],
     756    'HIDEPASSW'                   => $conf_UAM[34],
     757    'NO_VALID_LEVEL'              => $conf_UAM[35],
     758    'VALID_LEVEL'                 => $conf_UAM[36],
     759    'DOWNGRADE_LEVEL'             => $conf_UAM[37],
     760    'PWDRESET'                    => $conf_UAM[38],
     761    'REJECTCONNECT'               => $conf_UAM[39],
     762    'REJECTCONNECT_TEXT'          => $conf_UAM[40],
     763    'CONFIRMMAIL_SUBJECT'         => $conf_UAM[41],
     764    'CONFIRMMAIL_REMAIL_SUBJECT'  => $conf_UAM[42],
     765    'INFOMAIL_SUBJECT'            => $conf_UAM[43],
     766    'GTAUTOMAIL_SUBJECT'          => $conf_UAM[44],
     767    'GTREMINDER_SUBJECT'          => $conf_UAM[45],
     768    'ADMINVALIDATIONMAIL_SUBJECT' => $conf_UAM[46]
     769  );
     770
     771  // unset obsolete conf
     772  // -------------------
     773  for ($i = 0; $i <= 46; $i++)
     774  {
     775    unset ($conf_UAM[$i]);
     776  }
     777
     778  $update_conf = serialize($Newconf_UAM);
     779
     780  conf_update_param('UserAdvManager', pwg_db_real_escape_string($update_conf));
     781
     782
     783  // Upgrade $conf_UAM_ConfirmMail
     784  $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']);
     785
     786  $Newconf_UAM_ConfirmMail = array (
     787    'CONFIRMMAIL_TIMEOUT'     => $conf_UAM_ConfirmMail[0],
     788    'CONFIRMMAIL_DELAY'       => $conf_UAM_ConfirmMail[1],
     789    'CONFIRMMAIL_REMAIL_TXT1' => $conf_UAM_ConfirmMail[2],
     790    'CONFIRMMAIL_REMAIL'      => $conf_UAM_ConfirmMail[3],
     791    'CONFIRMMAIL_REMAIL_TXT2' => $conf_UAM_ConfirmMail[4],
     792    'CONFIRMMAIL_CUSTOM_TXT1' => $conf_UAM_ConfirmMail[5],
     793    'CONFIRMMAIL_CUSTOM_TXT2' => $conf_UAM_ConfirmMail[6]
     794  );
     795
     796  // unset obsolete conf
     797  // -------------------
     798  for ($i = 0; $i <= 6; $i++)
     799  {
     800    unset ($conf_UAM_ConfirmMail[$i]);
     801  }
     802
     803  $update_conf = serialize($Newconf_UAM_ConfirmMail);
     804
     805  conf_update_param('UserAdvManager_ConfirmMail', pwg_db_real_escape_string($update_conf));
     806}
    705807?>
  • extensions/UserAdvManager/trunk/language/fr_FR/plugin.lang.php

    r19234 r21075  
    1616$lang['UAM_Err_audit_username_char'] = '<b>Ce compte contient un ou des caractères interdits :</b> ';
    1717$lang['UAM_Err_audit_email_forbidden'] = '<b>Ce compte contient des domaines de messagerie interdit :</b> ';
    18 $lang['UAM_Err_audit_advise'] = '<b>Vous avez des corrections a faire pour respecter les nouvelles règles que vous avez activées.<br>Utilisez un utilitaire de gestion de base de données pour corriger les comptes utilisateurs directement dans la table ###_USERS si nécessaire.</b><br><br>';
    19 $lang['UAM_reg_err_login2'] = 'le nom utilisateur ne doit pas contenir les caractère suivants : ';
     18$lang['UAM_Err_audit_advise'] = '<b>Vous avez des corrections à faire pour respecter les nouvelles règles que vous avez activées.<br>Utilisez un utilitaire de gestion de base de données pour corriger les comptes utilisateurs directement dans la table ###_USERS si nécessaire.</b><br><br>';
     19$lang['UAM_reg_err_login2'] = 'le nom utilisateur ne doit pas contenir les caractères suivants : ';
    2020$lang['UAM_reg_err_login5'] = 'L\'adresse email est issue d\'un prestataire interdit. Les prestataires d\'adresses email interdits à l\'inscription sont : ';
    2121$lang['UAM_empty_pwd'] = '[mot de passe vide]';
  • extensions/UserAdvManager/trunk/main.inc.php

    r18205 r21075  
    6969// PWG_Stuffs module
    7070// -----------------
    71 if (isset($conf_UAM[33]) and $conf_UAM[33] == 'true')
     71if (isset($conf_UAM['STUFFS']) and $conf_UAM['STUFFS'] == 'true')
    7272{
    7373  add_event_handler('get_stuffs_modules', 'register_UAM_stuffs_module');
     
    7676// Add new feature in user_list - Password Reset
    7777// ---------------------------------------------
    78 if (isset($conf_UAM[38]) and $conf_UAM[38] == 'true')
     78if (isset($conf_UAM['PWDRESET']) and $conf_UAM['PWDRESET'] == 'true')
    7979{
    8080  // Add new column on user_list
  • extensions/UserAdvManager/trunk/maintain.inc.php

    r18479 r21075  
    2020/* ****************************************************************** */
    2121
    22   $defaultUAM = array();
    23   $defaultConfirmMail = array();
    24 
    2522  // Default global parameters for UserAdvManager conf
    2623  // -------------------------------------------------
    27   $defaultUAM[0] = 'false';                                         // UAM_MAIL_INFO_TRUE/FALSE
    28   $defaultUAM[1] = 'false';                                         // UAM_CONFIRM_MAIL_TRUE/FALSE
    29   $defaultUAM[2] = '-1';                                            // UAM_No_Confirm_Group
    30   $defaultUAM[3] = '-1';                                            // UAM_Validated_Group
    31   $defaultUAM[4] = '-1';                                            // UAM_Validated_Status
    32   $defaultUAM[5] = 'false';                                         // UAM_USERNAME_CHAR_TRUE
    33   $defaultUAM[6] = '';                                              // UAM_USERNAME_CHAR_LIST
    34   $defaultUAM[7] = '-1';                                            // UAM_No_Confirm_Status
    35   $defaultUAM[8] = l10n('UAM_Default_InfoMail_Txt');                // UAM_MAILINFO_TEXT
    36   $defaultUAM[9] = l10n('UAM_Default_ConfirmMail_Txt');             // UAM_CONFIRMMAIL_TEXT
    37   $defaultUAM[10] = 'false';                                        // UAM_MAILEXCLUSION_TRUE/FALSE
    38   $defaultUAM[11] = '';                                             // UAM_MAILEXCLUSION_LIST
    39   $defaultUAM[12] = 'false';                                        // UAM_PASSWORDENF_TRUE/FALSE
    40   $defaultUAM[13] = '100';                                          // UAM_PASSWORD_SCORE
    41   $defaultUAM[14] = 'false';                                        // UAM_ADMINPASSWENF_TRUE/FALSE
    42   $defaultUAM[15] = 'false';                                        // UAM_GHOSTRACKER_TRUE/FALSE
    43   $defaultUAM[16] = '10';                                           // UAM_GHOSTRACKER_DAYLIMIT
    44   $defaultUAM[17] = l10n('UAM_Default_GhstReminder_Txt');           // UAM_GHOSTRACKER_REMINDERTEXT
    45   $defaultUAM[18] = 'false';                                        // UAM_ADDLASTVISIT_TRUE/FALSE
    46   $defaultUAM[19] = 'false';                                        // UAM_ADMINCONFMAIL_TRUE/FALSE
    47   $defaultUAM[20] = 'false';                                        // UAM_REDIRTOPROFILE_TRUE/FALSE
    48   $defaultUAM[21] = 'false';                                        // UAM_GTAUTO_TRUE/FALSE
    49   $defaultUAM[22] = 'false';                                        // UAM_GTAUTOMAIL_TRUE/FALSE
    50   $defaultUAM[23] = l10n('UAM_Default_GhstDeletion_Txt');           // UAM_GTAUTODEL_TEXT
    51   $defaultUAM[24] = l10n('UAM_Default_GhstDemotion_Txt');           // UAM_GTAUTOMAILTEXT
    52   $defaultUAM[25] = '-1';                                           // UAM_Downgrade_Group
    53   $defaultUAM[26] = '-1';                                           // UAM_Downgrade_Status
    54   $defaultUAM[27] = l10n('UAM_Default_AdminValidation_Txt');        // UAM_ADMINVALIDATIONMAIL_TEXT
    55   $defaultUAM[28] = 'false';                                        // UAM_CUSTOMPASSWRETR_TRUE/FALSE
    56   $defaultUAM[29] = l10n('UAM_Default_PwdRequest_Txt');             // UAM_CUSTOMPASSWRETR_TEXT
    57   $defaultUAM[30] = 'false';                                        // UAM_USRAUTO_TRUE/FALSE
    58   $defaultUAM[31] = l10n('UAM_Default_ValidationTimeout_Txt');      // UAM_USRAUTODEL_TEXT
    59   $defaultUAM[32] = 'false';                                        // UAM_USRAUTOMAIL_TRUE/FALSE
    60   $defaultUAM[33] = 'false';                                        // UAM_STUFFS_TRUE/FALSE
    61   $defaultUAM[34] = 'false';                                        // UAM_HIDEPASSW_TRUE/FALSE
    62   $defaultUAM[35] = '-1';                                           // UAM_NO_VALID_LEVEL
    63   $defaultUAM[36] = '-1';                                           // UAM_VALID_LEVEL
    64   $defaultUAM[37] = '-1';                                           // UAM_DOWNGRADE_LEVEL
    65   $defaultUAM[38] = 'false';                                        // UAM_PWDRESET_TRUE/FALSE
    66   $defaultUAM[39] = 'false';                                        // UAM_REJECTCONNECT_TRUE/FALSE
    67   $defaultUAM[40] = l10n('UAM_Default_RejectConnexion_Txt');        // UAM_REJECTCONNECT_TEXT
    68   $defaultUAM[41] = l10n('UAM_Default_ConfirmMail_Subject');        // UAM_CONFIRMMAIL_SUBJECT
    69   $defaultUAM[42] = l10n('UAM_Default_ConfirmMail_Remail_Subject'); // UAM_CONFIRMMAIL_REMAIL_SUBJECT
    70   $defaultUAM[43] = l10n('UAM_Default_InfoMail_Subject');           // UAM_INFOMAIL_SUBJECT
    71   $defaultUAM[44] = l10n('UAM_Default_GTAutoMail_Subject');         // UAM_GTAUTOMAIL_SUBJECT
    72   $defaultUAM[45] = l10n('UAM_Default_GTReminder_Subject');         // UAM_GTREMINDER_SUBJECT
    73   $defaultUAM[46] = l10n('UAM_Default_AdminValidationMail_Subject');// UAM_ADMINVALIDATIONMAIL_SUBJECT
     24  $defaultUAM = array(
     25    'MAIL_INFO'                   => 'false',
     26    'CONFIRM_MAIL'                => 'false',
     27    'NO_CONFIRM_GROUP'            => '-1',
     28    'VALIDATED_GROUP'             => '-1',
     29    'VALIDATED_STATUS'            => '-1',
     30    'USERNAME_CHAR'               => 'false',
     31    'USERNAME_CHAR_LIST'          => '',
     32    'NO_CONFIRM_STATUS'           => '-1',
     33    'MAILINFO_TEXT'               => l10n('UAM_Default_InfoMail_Txt'),
     34    'CONFIRMMAIL_TEXT'            => l10n('UAM_Default_ConfirmMail_Txt'),
     35    'MAILEXCLUSION'               => 'false',
     36    'MAILEXCLUSION_LIST'          => '',
     37    'PASSWORDENF'                 => 'false',
     38    'PASSWORD_SCORE'              => '100',
     39    'ADMINPASSWENF'               => 'false',
     40    'GHOSTRACKER'                 => 'false',
     41    'GHOSTRACKER_DAYLIMIT'        => '10',
     42    'GHOSTRACKER_REMINDERTEXT'    => l10n('UAM_Default_GhstReminder_Txt'),
     43    'ADDLASTVISIT'                => 'false',
     44    'ADMINCONFMAIL'               => 'false',
     45    'REDIRTOPROFILE'              => 'false',
     46    'GTAUTO'                      => 'false',
     47    'GTAUTOMAIL'                  => 'false',
     48    'GTAUTODEL'                   => l10n('UAM_Default_GhstDeletion_Txt'),
     49    'GTAUTOMAILTEXT'              => l10n('UAM_Default_GhstDemotion_Txt'),
     50    'DOWNGRADE_GROUP'             => '-1',
     51    'DOWNGRADE_STATUS'            => '-1',
     52    'ADMINVALIDATIONMAIL'         => l10n('UAM_Default_AdminValidation_Txt'),
     53    'CUSTOMPASSWRETR'             => 'false',
     54    'CUSTOMPASSWRETR_TEXT'        => l10n('UAM_Default_PwdRequest_Txt'),
     55    'USRAUTO'                     => 'false',
     56    'USRAUTODEL'                  => l10n('UAM_Default_ValidationTimeout_Txt'),
     57    'USRAUTOMAIL'                 => 'false',
     58    'STUFFS'                      => 'false',
     59    'HIDEPASSW'                   => 'false',
     60    'NO_VALID_LEVEL'              => '-1',
     61    'VALID_LEVEL'                 => '-1',
     62    'DOWNGRADE_LEVEL'             => '-1',
     63    'PWDRESET'                    => 'false',
     64    'REJECTCONNECT'               => 'false',
     65    'REJECTCONNECT_TEXT'          => l10n('UAM_Default_RejectConnexion_Txt'),
     66    'CONFIRMMAIL_SUBJECT'         => l10n('UAM_Default_ConfirmMail_Subject'),
     67    'CONFIRMMAIL_REMAIL_SUBJECT'  => l10n('UAM_Default_ConfirmMail_Remail_Subject'),
     68    'INFOMAIL_SUBJECT'            => l10n('UAM_Default_InfoMail_Subject'),
     69    'GTAUTOMAIL_SUBJECT'          => l10n('UAM_Default_GTAutoMail_Subject'),
     70    'GTREMINDER_SUBJECT'          => l10n('UAM_Default_GTReminder_Subject'),
     71    'ADMINVALIDATIONMAIL_SUBJECT' => l10n('UAM_Default_AdminValidationMail_Subject')
     72  );
    7473 
    7574  // Default specific parameters for UserAdvManager ConfirmMail conf
    7675  // ---------------------------------------------------------------
    77   $defaultConfirmMail[0] = 'false';                                 // UAM_CONFIRMMAIL_TIMEOUT_TRUE/FALSE
    78   $defaultConfirmMail[1] = '5';                                     // UAM_CONFIRMMAIL_DELAY
    79   $defaultConfirmMail[2] = l10n('UAM_Default_CfmMail_Remail_Txt1'); // UAM_CONFIRMMAIL_REMAIL_TXT1
    80   $defaultConfirmMail[3] = 'false';                                 // UAM_CONFIRMMAIL_REMAIL_TRUE/FALSE
    81   $defaultConfirmMail[4] = l10n('UAM_Default_CfmMail_Remail_Txt2'); // UAM_CONFIRMMAIL_REMAIL_TXT2
    82   $defaultConfirmMail[5] = l10n('UAM_Default_CfmMail_Custom_Txt1'); // UAM_CONFIRMMAIL_CUSTOM_TXT1
    83   $defaultConfirmMail[6] = l10n('UAM_Default_CfmMail_Custom_Txt2'); // UAM_CONFIRMMAIL_CUSTOM_TXT2
     76  $defaultConfirmMail = array(
     77    'CONFIRMMAIL_TIMEOUT'     => 'false',
     78    'CONFIRMMAIL_DELAY'       => '5',
     79    'CONFIRMMAIL_REMAIL_TXT1' => l10n('UAM_Default_CfmMail_Remail_Txt1'),
     80    'CONFIRMMAIL_REMAIL'      => 'false',
     81    'CONFIRMMAIL_REMAIL_TXT2' => l10n('UAM_Default_CfmMail_Remail_Txt2'),
     82    'CONFIRMMAIL_CUSTOM_TXT1' => l10n('UAM_Default_CfmMail_Custom_Txt1'),
     83    'CONFIRMMAIL_CUSTOM_TXT2' => l10n('UAM_Default_CfmMail_Custom_Txt2')
     84  );
    8485 
    8586  // Set current plugin version in config table
     
    290291/* Check for upgrade from 2.12 to 2.13 */
    291292/* *********************************** */
    292     $fields = mysql_list_fields($conf['db_base'],USER_CONFIRM_MAIL_TABLE);
    293     $nb_fields = mysql_num_fields($fields);
     293    $fields = pwg_query('SHOW COLUMNS FROM '.USER_CONFIRM_MAIL_TABLE.';');
     294    $nb_fields = pwg_db_num_rows($fields);
    294295
    295296    if ($nb_fields < 6)
     
    404405      upgrade_2400_2410();
    405406    }
     407
     408    if (version_compare($conf['UserAdvManager_Version'], '2.50.0') < 0)
     409    {
     410    /* upgrade from version 2.41.x to 2.50.0 */
     411    /* ************************************* */
     412      upgrade_2410_2500();
     413    }
    406414  }
    407415
Note: See TracChangeset for help on using the changeset viewer.