Ignore:
Timestamp:
May 23, 2011, 7:08:25 PM (13 years ago)
Author:
Eric
Message:

r11018 merged from trunk to branch 2.20

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/branches/2.20/admin/UAM_admin.php

    r10958 r11019  
    106106  case 'global':
    107107
    108         if (isset($_POST['submit']) and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_No_Comment_Anonymous']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) and isset($_POST['UAM_GhostUser_Tracker']) and isset($_POST['UAM_Admin_ConfMail']) and isset($_POST['UAM_RedirToProfile']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']) and isset($_POST['UAM_GroupComm']))
     108        if (isset($_POST['submit']) and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) and isset($_POST['UAM_Password_Enforced']) and isset($_POST['UAM_AdminPassword_Enforced']) and isset($_POST['UAM_GhostUser_Tracker']) and isset($_POST['UAM_Admin_ConfMail']) and isset($_POST['UAM_RedirToProfile']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']))
    109109  {
    110110
     
    149149      (isset($_POST['UAM_Validated_Group'])?$_POST['UAM_Validated_Group']:''),
    150150      (isset($_POST['UAM_Validated_Status'])?$_POST['UAM_Validated_Status']:''),
    151       $_POST['UAM_No_Comment_Anonymous'],
    152151      $_POST['UAM_Username_Char'],
    153152      $_POST['UAM_Username_List'],
     
    180179      $_POST['UAM_Stuffs'],
    181180      $_POST['UAM_HidePassw'],
    182       $_POST['UAM_GroupComm'],
    183       (isset($_POST['UAM_AllowComm_Group'])?$_POST['UAM_AllowComm_Group']:''),
    184181      );
    185182
    186183    $conf['UserAdvManager'] = serialize($newconf_UAM);
    187184
    188                 $query = '
    189                 UPDATE '.CONFIG_TABLE.'
    190                 SET value="'.pwg_db_real_escape_string($conf['UserAdvManager']).'"
    191                 WHERE param="UserAdvManager"
    192                 LIMIT 1
    193                 ;';
    194                
    195                 pwg_query($query);
     185    conf_update_param('UserAdvManager', pwg_db_real_escape_string($conf['UserAdvManager']));
    196186
    197187    //Email confirmation settings
     
    214204
    215205    $conf['UserAdvManager_ConfirmMail'] = serialize($newconf_UAM_ConfirmMail);
    216    
    217           $query = '
    218       UPDATE '.CONFIG_TABLE.'
    219                         SET value="'.pwg_db_real_escape_string($conf['UserAdvManager_ConfirmMail']).'"
    220                         WHERE param="UserAdvManager_ConfirmMail"
    221                         LIMIT 1
    222                 ;';
    223 
    224                 pwg_query($query);
     206
     207    conf_update_param('UserAdvManager_ConfirmMail', pwg_db_real_escape_string($conf['UserAdvManager_ConfirmMail']));
    225208
    226209                array_push($page['infos'], l10n('UAM_save_config'));
     
    259242  $Valid = -1;
    260243  $Downgrade = -1;
    261   $AllowComm = -1;
    262244       
    263245  //Check groups list in database
     
    284266                }
    285267    //configuration value for downgrade users
    286     if (isset($conf_UAM[26]) and $conf_UAM[26] == $row['id'])
     268    if (isset($conf_UAM[25]) and $conf_UAM[25] == $row['id'])
    287269                {
    288270                $Downgrade = $row['id'];
    289                 }
    290     //configuration value for users group allowed to post comments
    291     if (isset($conf_UAM[37]) and $conf_UAM[37] == $row['id'])
    292                 {
    293                 $AllowComm = $row['id'];
    294271                }
    295272  }
     
    319296                        )
    320297        );
    321   //Template initialization for allowed group for comments
    322   $template->assign(
    323     'AllowComm_Group',
    324                 array(
    325       'group_options'=> $groups,
    326       'group_selected' => $AllowComm
    327                         )
    328         );
    329298       
    330299  //Status setting for unvalidated, validated users and downgrade status
     
    338307  {
    339308          $status_options[$status] = l10n('user_status_'.$status);
    340           if (isset($conf_UAM[8]) and $conf_UAM[8] == $status)
     309          if (isset($conf_UAM[7]) and $conf_UAM[7] == $status)
    341310          {
    342311            $No_Valid_Status = $status;
     
    376345  {
    377346          $status_options[$status] = l10n('user_status_'.$status);
    378           if (isset($conf_UAM[27]) and $conf_UAM[27] == $status)
     347          if (isset($conf_UAM[26]) and $conf_UAM[26] == $status)
    379348                {
    380349                  $Downgrade_Status = $status;
     
    412381                'UAM_MAIL_INFO_TRUE'             => $conf_UAM[0]=='true' ?  'checked="checked"' : '' ,
    413382                'UAM_MAIL_INFO_FALSE'            => $conf_UAM[0]=='false' ?  'checked="checked"' : '' ,
    414                 'UAM_MAILINFO_TEXT'              => $conf_UAM[9],
    415                 'UAM_USERNAME_CHAR_TRUE'         => $conf_UAM[6]=='true' ?  'checked="checked"' : '' ,
    416                 'UAM_USERNAME_CHAR_FALSE'        => $conf_UAM[6]=='false' ?  'checked="checked"' : '' ,
    417                 'UAM_USERNAME_CHAR_LIST'         => $conf_UAM[7],
     383                'UAM_MAILINFO_TEXT'              => $conf_UAM[8],
     384                'UAM_USERNAME_CHAR_TRUE'         => $conf_UAM[5]=='true' ?  'checked="checked"' : '' ,
     385                'UAM_USERNAME_CHAR_FALSE'        => $conf_UAM[5]=='false' ?  'checked="checked"' : '' ,
     386                'UAM_USERNAME_CHAR_LIST'         => $conf_UAM[6],
    418387                'UAM_CONFIRM_MAIL_TRUE'          => $conf_UAM[1]=='true' ?  'checked="checked"' : '' ,
    419388                'UAM_CONFIRM_MAIL_FALSE'         => $conf_UAM[1]=='false' ?  'checked="checked"' : '' ,
    420389    'UAM_CONFIRM_MAIL_LOCAL'         => $conf_UAM[1]=='local' ?  'checked="checked"' : '' ,
    421                 'UAM_CONFIRMMAIL_TEXT'           => $conf_UAM[10],
     390                'UAM_CONFIRMMAIL_TEXT'           => $conf_UAM[9],
    422391                'UAM_No_Confirm_Group'           => $conf_UAM[2],
    423392                'UAM_Validated_Group'            => $conf_UAM[3],
    424                 'UAM_No_Confirm_Status'          => $conf_UAM[8],
     393                'UAM_No_Confirm_Status'          => $conf_UAM[7],
    425394                'UAM_Validated_Status'           => $conf_UAM[4],
    426                 'UAM_NO_COMMENT_ANO_TRUE'        => $conf_UAM[5]=='true' ?  'checked="checked"' : '' ,
    427                 'UAM_NO_COMMENT_ANO_FALSE'       => $conf_UAM[5]=='false' ?  'checked="checked"' : '' ,
    428                 'UAM_MAILEXCLUSION_TRUE'         => $conf_UAM[11]=='true' ?  'checked="checked"' : '' ,
    429                 'UAM_MAILEXCLUSION_FALSE'        => $conf_UAM[11]=='false' ?  'checked="checked"' : '' ,
    430                 'UAM_MAILEXCLUSION_LIST'         => $conf_UAM[12],
    431                 'UAM_PASSWORDENF_TRUE'           => $conf_UAM[13]=='true' ?  'checked="checked"' : '' ,
    432                 'UAM_PASSWORDENF_FALSE'          => $conf_UAM[13]=='false' ?  'checked="checked"' : '' ,
    433                 'UAM_PASSWORD_SCORE'             => $conf_UAM[14],
    434     'UAM_ADMINPASSWENF_TRUE'         => $conf_UAM[15]=='true' ?  'checked="checked"' : '' ,
    435                 'UAM_ADMINPASSWENF_FALSE'        => $conf_UAM[15]=='false' ?  'checked="checked"' : '' ,
    436     'UAM_GHOSTRACKER_TRUE'           => $conf_UAM[16]=='true' ?  'checked="checked"' : '' ,
    437                 'UAM_GHOSTRACKER_FALSE'          => $conf_UAM[16]=='false' ?  'checked="checked"' : '' ,
    438     'UAM_GHOSTRACKER_DAYLIMIT'       => $conf_UAM[17],
    439     'UAM_GHOSTRACKER_REMINDERTEXT'   => $conf_UAM[18],
    440     'UAM_ADDLASTVISIT_TRUE'          => $conf_UAM[19]=='true' ?  'checked="checked"' : '' ,
    441     'UAM_ADDLASTVISIT_FALSE'         => $conf_UAM[19]=='false' ?  'checked="checked"' : '' ,
    442     'UAM_ADMINCONFMAIL_TRUE'         => $conf_UAM[20]=='true' ?  'checked="checked"' : '' ,
    443     'UAM_ADMINCONFMAIL_FALSE'        => $conf_UAM[20]=='false' ?  'checked="checked"' : '' ,
    444     'UAM_REDIRTOPROFILE_TRUE'        => $conf_UAM[21]=='true' ?  'checked="checked"' : '' ,
    445     'UAM_REDIRTOPROFILE_FALSE'       => $conf_UAM[21]=='false' ?  'checked="checked"' : '' ,
    446     'UAM_GTAUTO_TRUE'                => $conf_UAM[22]=='true' ?  'checked="checked"' : '' ,
    447     'UAM_GTAUTO_FALSE'               => $conf_UAM[22]=='false' ?  'checked="checked"' : '' ,
    448     'UAM_GTAUTOMAIL_TRUE'            => $conf_UAM[23]=='true' ?  'checked="checked"' : '' ,
    449     'UAM_GTAUTOMAIL_FALSE'           => $conf_UAM[23]=='false' ?  'checked="checked"' : '' ,
    450     'UAM_GTAUTODEL_TEXT'             => $conf_UAM[24],
    451     'UAM_GTAUTOMAILTEXT'             => $conf_UAM[25],
    452                 'UAM_Downgrade_Group'            => $conf_UAM[26],
    453                 'UAM_Downgrade_Status'           => $conf_UAM[27],
    454     'UAM_ADMINVALIDATIONMAIL_TEXT'   => $conf_UAM[28],
    455     'UAM_CUSTOMPASSWRETR_TRUE'       => $conf_UAM[29]=='true' ?  'checked="checked"' : '' ,
    456     'UAM_CUSTOMPASSWRETR_FALSE'      => $conf_UAM[29]=='false' ?  'checked="checked"' : '' ,
    457     'UAM_CUSTOMPASSWRETR_TEXT'       => $conf_UAM[30],
    458     'UAM_USRAUTO_TRUE'               => $conf_UAM[31]=='true' ?  'checked="checked"' : '' ,
    459     'UAM_USRAUTO_FALSE'              => $conf_UAM[31]=='false' ?  'checked="checked"' : '' ,
    460     'UAM_USRAUTODEL_TEXT'            => $conf_UAM[32],
    461     'UAM_USRAUTOMAIL_TRUE'           => $conf_UAM[33]=='true' ?  'checked="checked"' : '' ,
    462     'UAM_USRAUTOMAIL_FALSE'          => $conf_UAM[33]=='false' ?  'checked="checked"' : '' ,
    463     'UAM_STUFFS_TRUE'                => $conf_UAM[34]=='true' ?  'checked="checked"' : '' ,
    464     'UAM_STUFFS_FALSE'               => $conf_UAM[34]=='false' ?  'checked="checked"' : '' ,
    465     'UAM_HIDEPASSW_TRUE'             => $conf_UAM[35]=='true' ?  'checked="checked"' : '' ,
    466     'UAM_HIDEPASSW_FALSE'            => $conf_UAM[35]=='false' ?  'checked="checked"' : '' ,
    467     'UAM_GROUPCOMM_TRUE'             => $conf_UAM[36]=='true' ?  'checked="checked"' : '' ,
    468     'UAM_GROUPCOMM_FALSE'            => $conf_UAM[36]=='false' ?  'checked="checked"' : '' ,
    469     'UAM_ALLOWCOMM_GROUP'            => $conf_UAM[37],
     395                'UAM_MAILEXCLUSION_TRUE'         => $conf_UAM[10]=='true' ?  'checked="checked"' : '' ,
     396                'UAM_MAILEXCLUSION_FALSE'        => $conf_UAM[10]=='false' ?  'checked="checked"' : '' ,
     397                'UAM_MAILEXCLUSION_LIST'         => $conf_UAM[11],
     398                'UAM_PASSWORDENF_TRUE'           => $conf_UAM[12]=='true' ?  'checked="checked"' : '' ,
     399                'UAM_PASSWORDENF_FALSE'          => $conf_UAM[12]=='false' ?  'checked="checked"' : '' ,
     400                'UAM_PASSWORD_SCORE'             => $conf_UAM[13],
     401    'UAM_ADMINPASSWENF_TRUE'         => $conf_UAM[14]=='true' ?  'checked="checked"' : '' ,
     402                'UAM_ADMINPASSWENF_FALSE'        => $conf_UAM[14]=='false' ?  'checked="checked"' : '' ,
     403    'UAM_GHOSTRACKER_TRUE'           => $conf_UAM[15]=='true' ?  'checked="checked"' : '' ,
     404                'UAM_GHOSTRACKER_FALSE'          => $conf_UAM[15]=='false' ?  'checked="checked"' : '' ,
     405    'UAM_GHOSTRACKER_DAYLIMIT'       => $conf_UAM[16],
     406    'UAM_GHOSTRACKER_REMINDERTEXT'   => $conf_UAM[17],
     407    'UAM_ADDLASTVISIT_TRUE'          => $conf_UAM[18]=='true' ?  'checked="checked"' : '' ,
     408    'UAM_ADDLASTVISIT_FALSE'         => $conf_UAM[18]=='false' ?  'checked="checked"' : '' ,
     409    'UAM_ADMINCONFMAIL_TRUE'         => $conf_UAM[19]=='true' ?  'checked="checked"' : '' ,
     410    'UAM_ADMINCONFMAIL_FALSE'        => $conf_UAM[19]=='false' ?  'checked="checked"' : '' ,
     411    'UAM_REDIRTOPROFILE_TRUE'        => $conf_UAM[20]=='true' ?  'checked="checked"' : '' ,
     412    'UAM_REDIRTOPROFILE_FALSE'       => $conf_UAM[20]=='false' ?  'checked="checked"' : '' ,
     413    'UAM_GTAUTO_TRUE'                => $conf_UAM[21]=='true' ?  'checked="checked"' : '' ,
     414    'UAM_GTAUTO_FALSE'               => $conf_UAM[21]=='false' ?  'checked="checked"' : '' ,
     415    'UAM_GTAUTOMAIL_TRUE'            => $conf_UAM[22]=='true' ?  'checked="checked"' : '' ,
     416    'UAM_GTAUTOMAIL_FALSE'           => $conf_UAM[22]=='false' ?  'checked="checked"' : '' ,
     417    'UAM_GTAUTODEL_TEXT'             => $conf_UAM[23],
     418    'UAM_GTAUTOMAILTEXT'             => $conf_UAM[24],
     419                'UAM_Downgrade_Group'            => $conf_UAM[25],
     420                'UAM_Downgrade_Status'           => $conf_UAM[26],
     421    'UAM_ADMINVALIDATIONMAIL_TEXT'   => $conf_UAM[27],
     422    'UAM_CUSTOMPASSWRETR_TRUE'       => $conf_UAM[28]=='true' ?  'checked="checked"' : '' ,
     423    'UAM_CUSTOMPASSWRETR_FALSE'      => $conf_UAM[28]=='false' ?  'checked="checked"' : '' ,
     424    'UAM_CUSTOMPASSWRETR_TEXT'       => $conf_UAM[29],
     425    'UAM_USRAUTO_TRUE'               => $conf_UAM[30]=='true' ?  'checked="checked"' : '' ,
     426    'UAM_USRAUTO_FALSE'              => $conf_UAM[30]=='false' ?  'checked="checked"' : '' ,
     427    'UAM_USRAUTODEL_TEXT'            => $conf_UAM[31],
     428    'UAM_USRAUTOMAIL_TRUE'           => $conf_UAM[32]=='true' ?  'checked="checked"' : '' ,
     429    'UAM_USRAUTOMAIL_FALSE'          => $conf_UAM[32]=='false' ?  'checked="checked"' : '' ,
     430    'UAM_STUFFS_TRUE'                => $conf_UAM[33]=='true' ?  'checked="checked"' : '' ,
     431    'UAM_STUFFS_FALSE'               => $conf_UAM[33]=='false' ?  'checked="checked"' : '' ,
     432    'UAM_HIDEPASSW_TRUE'             => $conf_UAM[34]=='true' ?  'checked="checked"' : '' ,
     433    'UAM_HIDEPASSW_FALSE'            => $conf_UAM[34]=='false' ?  'checked="checked"' : '' ,
    470434                'UAM_PASSWORD_TEST_SCORE'        => $UAM_Password_Test_Score,
    471435    'UAM_ERROR_REPORTS4'             => $UAM_Exclusionlist_Error,
     
    487451               
    488452    //Username without forbidden keys
    489     if ( isset($conf_UAM[6]) and $conf_UAM[6] == 'true' )
     453    if ( isset($conf_UAM[5]) and $conf_UAM[5] == 'true' )
    490454          {
    491455                        $query = "
     
    506470               
    507471    //Email without forbidden domain
    508     if ( isset($conf_UAM[11]) and $conf_UAM[11] == 'true' )
     472    if ( isset($conf_UAM[10]) and $conf_UAM[10] == 'true' )
    509473          {
    510474                        $query = "
     
    517481                  while($row = pwg_db_fetch_assoc($result))
    518482                  {
    519                           $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[12]);
     483                          $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]);
    520484                          for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++)
    521485                          {
     
    572536  $conf_UAM = unserialize($conf['UserAdvManager']);
    573537 
    574   if (isset($conf_UAM[19]) and $conf_UAM[19]=='true')
     538  if (isset($conf_UAM[18]) and $conf_UAM[18]=='true')
    575539  {
    576540// +-----------------------------------------------------------------------+
     
    621585      $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days
    622586     
    623       if (isset($conf_UAM[16]) and $conf_UAM[16]=='true' and $conf_UAM[17] <> '')
     587      if (isset($conf_UAM[15]) and $conf_UAM[15]=='true' and $conf_UAM[16] <> '')
    624588      {
    625         if ($deltadays <= ($conf_UAM[17]/2))
     589        if ($deltadays <= ($conf_UAM[16]/2))
    626590        {
    627591          $display = 'green';
    628592        }
    629593       
    630         if (($deltadays > ($conf_UAM[17]/2)) and ($deltadays < $conf_UAM[17]))
     594        if (($deltadays > ($conf_UAM[16]/2)) and ($deltadays < $conf_UAM[16]))
    631595        {
    632596          $display = 'orange';
    633597        }
    634598       
    635         if ($deltadays >= $conf_UAM[17])
     599        if ($deltadays >= $conf_UAM[16])
    636600        {
    637601          $display = 'red';
     
    695659  $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']);
    696660       
    697   if (isset($conf_UAM[1]) and ($conf_UAM[1]=='true' or $conf_UAM[1]=='local') and ((isset($conf_UAM[2]) and $conf_UAM[2] <> '-1') or (isset($conf_UAM[8]) and $conf_UAM[8] <> '-1')))
     661  if (isset($conf_UAM[1]) and ($conf_UAM[1]=='true' or $conf_UAM[1]=='local') and ((isset($conf_UAM[2]) and $conf_UAM[2] <> '-1') or (isset($conf_UAM[7]) and $conf_UAM[7] <> '-1')))
    698662  {
    699663// +-----------------------------------------------------------------------+
     
    12091173  $conf_UAM = unserialize($conf['UserAdvManager']);
    12101174       
    1211   if (isset($conf_UAM[16]) and $conf_UAM[16]=='true')
     1175  if (isset($conf_UAM[16]) and $conf_UAM[15]=='true')
    12121176  {
    12131177// +-----------------------------------------------------------------------+
Note: See TracChangeset for help on using the changeset viewer.