Ignore:
Timestamp:
Aug 18, 2010, 10:56:53 PM (14 years ago)
Author:
Eric
Message:

Merge from Trunk to Branch 2.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/branches/2.15/admin/UAM_admin.php

    r6253 r6776  
    2828$UAM_Password_Test_Score = 0;
    2929$UAM_Exclusionlist_Error = false;
    30 
    3130
    3231// +-----------------------------------------------------------------------+
     
    102101  case 'global':
    103102
    104         if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_No_Casse']) 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']))
     103        if (isset($_POST['submit']) and !is_adviser() 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']))
    105104  {
    106105
    107106/* General configuration settings */
    108                 $_POST['UAM_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_MailInfo_Text']));
     107                $_POST['UAM_MailInfo_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_MailInfo_Text'])));
    109108   
    110                 $_POST['UAM_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Text']));
    111 
    112     $_POST['UAM_GhostTracker_ReminderText'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_GhostTracker_ReminderText']));
     109                $_POST['UAM_ConfirmMail_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Text'])));
     110
     111    $_POST['UAM_GhostTracker_ReminderText'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_GhostTracker_ReminderText'])));
    113112
    114113
     
    119118      $UAM_Exclusionlist_Error = true;
    120119    }
    121                
     120
    122121                $newconf_UAM = array(
    123122      $_POST['UAM_Mail_Info'],
    124       $_POST['UAM_No_Casse'],
    125123      $_POST['UAM_Confirm_Mail'],
    126124      (isset($_POST['UAM_No_Confirm_Group'])?$_POST['UAM_No_Confirm_Group']:''),
     
    142140      $_POST['UAM_GhostTracker_ReminderText'],
    143141      $_POST['UAM_Add_LastVisit_Column'],
    144       $_POST['UAM_Admin_ConfMail']);
     142      $_POST['UAM_Admin_ConfMail'],
     143      $_POST['UAM_RedirToProfile']);
    145144
    146145    $conf['UserAdvManager'] = serialize($newconf_UAM);
     
    155154                pwg_query($query);
    156155
    157 
    158156/* Email confirmation settings */
    159     $_POST['UAM_ConfirmMail_ReMail_Txt1'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_ReMail_Txt1']));
    160 
    161     $_POST['UAM_ConfirmMail_ReMail_Txt2'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_ReMail_Txt2']));
     157    $_POST['UAM_ConfirmMail_ReMail_Txt1'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_ReMail_Txt1'])));
     158
     159    $_POST['UAM_ConfirmMail_ReMail_Txt2'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_ReMail_Txt2'])));
    162160   
    163     $_POST['UAM_ConfirmMail_Custom_Txt1'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Custom_Txt1']));
     161    $_POST['UAM_ConfirmMail_Custom_Txt1'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Custom_Txt1'])));
    164162   
    165     $_POST['UAM_ConfirmMail_Custom_Txt2'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Custom_Txt2']));
    166 
    167 
     163    $_POST['UAM_ConfirmMail_Custom_Txt2'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Custom_Txt2'])));
     164   
    168165          $newconf_UAM_ConfirmMail = array (
    169166      $_POST['UAM_ConfirmMail_TimeOut'],
     
    220217    $groups[$row['id']] = $row['name'];
    221218/* configuration value for unvalidated users */
     219    if (isset($conf_UAM[2]) and $conf_UAM[2] == $row['id'])
     220    {
     221                $No_Valid = $row['id'];
     222                }
     223/* configuration value for validated users */
    222224    if (isset($conf_UAM[3]) and $conf_UAM[3] == $row['id'])
    223     {
    224                 $No_Valid = $row['id'];
    225                 }
    226 /* configuration value for validated users */
    227     if (isset($conf_UAM[4]) and $conf_UAM[4] == $row['id'])
    228225                {
    229226                $Valid = $row['id'];
     
    257254  {
    258255          $status_options[$status] = l10n('user_status_'.$status);
    259           if (isset($conf_UAM[9]) and $conf_UAM[9] == $status)
     256          if (isset($conf_UAM[8]) and $conf_UAM[8] == $status)
    260257          {
    261258            $No_Valid_Status = $status;
     
    276273  {
    277274          $status_options[$status] = l10n('user_status_'.$status);
    278           if (isset($conf_UAM[5]) and $conf_UAM[5] == $status)
     275          if (isset($conf_UAM[4]) and $conf_UAM[4] == $status)
    279276                {
    280277                  $Valid_Status = $status;
     
    305302                'UAM_MAIL_INFO_TRUE'             => $conf_UAM[0]=='true' ?  'checked="checked"' : '' ,
    306303                'UAM_MAIL_INFO_FALSE'            => $conf_UAM[0]=='false' ?  'checked="checked"' : '' ,
    307                 'UAM_MAILINFO_TEXT'              => $conf_UAM[10],
    308                 'UAM_NO_CASSE_TRUE'              => $conf_UAM[1]=='true' ?  'checked="checked"' : '' ,
    309                 'UAM_NO_CASSE_FALSE'             => $conf_UAM[1]=='false' ?  'checked="checked"' : '' ,
    310                 'UAM_USERNAME_CHAR_TRUE'         => $conf_UAM[7]=='true' ?  'checked="checked"' : '' ,
    311                 'UAM_USERNAME_CHAR_FALSE'        => $conf_UAM[7]=='false' ?  'checked="checked"' : '' ,
    312                 'UAM_USERNAME_CHAR_LIST'         => $conf_UAM[8],
    313                 'UAM_CONFIRM_MAIL_TRUE'          => $conf_UAM[2]=='true' ?  'checked="checked"' : '' ,
    314                 'UAM_CONFIRM_MAIL_FALSE'         => $conf_UAM[2]=='false' ?  'checked="checked"' : '' ,
    315                 'UAM_CONFIRMMAIL_TEXT'           => $conf_UAM[11],
    316                 'UAM_No_Confirm_Group'           => $conf_UAM[3],
    317                 'UAM_Validated_Group'            => $conf_UAM[4],
    318                 'UAM_No_Confirm_Status'          => $conf_UAM[9],
    319                 'UAM_Validated_Status'           => $conf_UAM[5],
    320                 'UAM_NO_COMMENT_ANO_TRUE'        => $conf_UAM[6]=='true' ?  'checked="checked"' : '' ,
    321                 'UAM_NO_COMMENT_ANO_FALSE'       => $conf_UAM[6]=='false' ?  'checked="checked"' : '' ,
    322                 'UAM_MAILEXCLUSION_TRUE'         => $conf_UAM[12]=='true' ?  'checked="checked"' : '' ,
    323                 'UAM_MAILEXCLUSION_FALSE'        => $conf_UAM[12]=='false' ?  'checked="checked"' : '' ,
    324                 'UAM_MAILEXCLUSION_LIST'         => $conf_UAM[13],
    325                 'UAM_PASSWORDENF_TRUE'           => $conf_UAM[14]=='true' ?  'checked="checked"' : '' ,
    326                 'UAM_PASSWORDENF_FALSE'          => $conf_UAM[14]=='false' ?  'checked="checked"' : '' ,
    327                 'UAM_PASSWORD_SCORE'             => $conf_UAM[15],
    328     'UAM_ADMINPASSWENF_TRUE'         => $conf_UAM[16]=='true' ?  'checked="checked"' : '' ,
    329                 'UAM_ADMINPASSWENF_FALSE'        => $conf_UAM[16]=='false' ?  'checked="checked"' : '' ,
    330     'UAM_GHOSTRACKER_TRUE'           => $conf_UAM[17]=='true' ?  'checked="checked"' : '' ,
    331                 'UAM_GHOSTRACKER_FALSE'          => $conf_UAM[17]=='false' ?  'checked="checked"' : '' ,
    332     'UAM_GHOSTRACKER_DAYLIMIT'       => $conf_UAM[18],
    333     'UAM_GHOSTRACKER_REMINDERTEXT'   => $conf_UAM[19],
    334     'UAM_ADDLASTVISIT_TRUE'          => $conf_UAM[20]=='true' ?  'checked="checked"' : '' ,
    335     'UAM_ADDLASTVISIT_FALSE'         => $conf_UAM[20]=='false' ?  'checked="checked"' : '' ,
    336     'UAM_ADMINCONFMAIL_TRUE'         => $conf_UAM[21]=='true' ?  'checked="checked"' : '' ,
    337     'UAM_ADMINCONFMAIL_FALSE'        => $conf_UAM[21]=='false' ?  'checked="checked"' : '' ,
     304                'UAM_MAILINFO_TEXT'              => $conf_UAM[9],
     305                'UAM_USERNAME_CHAR_TRUE'         => $conf_UAM[6]=='true' ?  'checked="checked"' : '' ,
     306                'UAM_USERNAME_CHAR_FALSE'        => $conf_UAM[6]=='false' ?  'checked="checked"' : '' ,
     307                'UAM_USERNAME_CHAR_LIST'         => $conf_UAM[7],
     308                'UAM_CONFIRM_MAIL_TRUE'          => $conf_UAM[1]=='true' ?  'checked="checked"' : '' ,
     309                'UAM_CONFIRM_MAIL_FALSE'         => $conf_UAM[1]=='false' ?  'checked="checked"' : '' ,
     310    'UAM_CONFIRM_MAIL_LOCAL'         => $conf_UAM[1]=='local' ?  'checked="checked"' : '' ,
     311                'UAM_CONFIRMMAIL_TEXT'           => $conf_UAM[10],
     312                'UAM_No_Confirm_Group'           => $conf_UAM[2],
     313                'UAM_Validated_Group'            => $conf_UAM[3],
     314                'UAM_No_Confirm_Status'          => $conf_UAM[8],
     315                'UAM_Validated_Status'           => $conf_UAM[4],
     316                'UAM_NO_COMMENT_ANO_TRUE'        => $conf_UAM[5]=='true' ?  'checked="checked"' : '' ,
     317                'UAM_NO_COMMENT_ANO_FALSE'       => $conf_UAM[5]=='false' ?  'checked="checked"' : '' ,
     318                'UAM_MAILEXCLUSION_TRUE'         => $conf_UAM[11]=='true' ?  'checked="checked"' : '' ,
     319                'UAM_MAILEXCLUSION_FALSE'        => $conf_UAM[11]=='false' ?  'checked="checked"' : '' ,
     320                'UAM_MAILEXCLUSION_LIST'         => $conf_UAM[12],
     321                'UAM_PASSWORDENF_TRUE'           => $conf_UAM[13]=='true' ?  'checked="checked"' : '' ,
     322                'UAM_PASSWORDENF_FALSE'          => $conf_UAM[13]=='false' ?  'checked="checked"' : '' ,
     323                'UAM_PASSWORD_SCORE'             => $conf_UAM[14],
     324    'UAM_ADMINPASSWENF_TRUE'         => $conf_UAM[15]=='true' ?  'checked="checked"' : '' ,
     325                'UAM_ADMINPASSWENF_FALSE'        => $conf_UAM[15]=='false' ?  'checked="checked"' : '' ,
     326    'UAM_GHOSTRACKER_TRUE'           => $conf_UAM[16]=='true' ?  'checked="checked"' : '' ,
     327                'UAM_GHOSTRACKER_FALSE'          => $conf_UAM[16]=='false' ?  'checked="checked"' : '' ,
     328    'UAM_GHOSTRACKER_DAYLIMIT'       => $conf_UAM[17],
     329    'UAM_GHOSTRACKER_REMINDERTEXT'   => $conf_UAM[18],
     330    'UAM_ADDLASTVISIT_TRUE'          => $conf_UAM[19]=='true' ?  'checked="checked"' : '' ,
     331    'UAM_ADDLASTVISIT_FALSE'         => $conf_UAM[19]=='false' ?  'checked="checked"' : '' ,
     332    'UAM_ADMINCONFMAIL_TRUE'         => $conf_UAM[20]=='true' ?  'checked="checked"' : '' ,
     333    'UAM_ADMINCONFMAIL_FALSE'        => $conf_UAM[20]=='false' ?  'checked="checked"' : '' ,
     334    'UAM_REDIRTOPROFILE_TRUE'        => $conf_UAM[21]=='true' ?  'checked="checked"' : '' ,
     335    'UAM_REDIRTOPROFILE_FALSE'       => $conf_UAM[21]=='false' ?  'checked="checked"' : '' ,
    338336                'UAM_PASSWORD_TEST_SCORE'        => $UAM_Password_Test_Score,
    339337    'UAM_ERROR_REPORTS4'             => $UAM_Exclusionlist_Error,
     
    355353               
    356354/* username insensible a la casse */
    357     if (isset($conf_UAM[3]) and $conf_UAM[3] == 'true')
     355    if (isset($conf_UAM[2]) and $conf_UAM[2] == 'true')
    358356          {
    359357                        $query = "
     
    379377               
    380378/* Username without forbidden keys */
    381     if ( isset($conf_UAM[7]) and $conf_UAM[7] == 'true' )
     379    if ( isset($conf_UAM[6]) and $conf_UAM[6] == 'true' )
    382380          {
    383381                        $query = "
     
    398396               
    399397/* Email without forbidden domain */
    400     if ( isset($conf_UAM[12]) and $conf_UAM[12] == 'true' )
     398    if ( isset($conf_UAM[11]) and $conf_UAM[11] == 'true' )
    401399          {
    402400                        $query = "
     
    409407                  while($row = pwg_db_fetch_assoc($result))
    410408                  {
    411                           $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[13]);
     409                          $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[12]);
    412410                          for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++)
    413411                          {
     
    467465  $conf_UAM = unserialize($conf['UserAdvManager']);
    468466 
    469   if (isset($conf_UAM[20]) and $conf_UAM[20]=='true')
     467  if (isset($conf_UAM[19]) and $conf_UAM[19]=='true')
    470468  {
    471469// +-----------------------------------------------------------------------+
     
    495493// |                           Template Init                               |
    496494// +-----------------------------------------------------------------------+
    497                 $base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
     495                /*$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
    498496
    499497    if (isset($_GET['start']) and is_numeric($_GET['start']))
     
    504502    {
    505503      $start = 0;
    506     }
     504    }*/
    507505
    508506// +-----------------------------------------------------------------------+
     
    510508// +-----------------------------------------------------------------------+
    511509
    512 $url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
     510/*$url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
    513511
    514512$navbar = create_navigation_bar(
     
    519517  );
    520518
    521 $template->assign('navbar', $navbar);
     519$template->assign('navbar', $navbar);*/
    522520
    523521// +-----------------------------------------------------------------------+
     
    528526    foreach ($page['filtered_users'] as $num => $local_user)
    529527    {
    530 /* simulate LIMIT $start, $conf['users_page'] */
    531                         if ($num < $start)
     528// simulate LIMIT $start, $conf['users_page']
     529                        /*if ($num < $start)
    532530      {
    533531        continue;
     
    536534      {
    537535        break;
    538       }
     536      }*/
    539537
    540538      $visible_user_list[] = $local_user;
     
    555553      $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days
    556554     
    557       if (isset($conf_UAM[17]) and $conf_UAM[17]=='true' and $conf_UAM[18] <> '')
     555      if (isset($conf_UAM[16]) and $conf_UAM[16]=='true' and $conf_UAM[17] <> '')
    558556      {
    559         if ($deltadays <= ($conf_UAM[18]/2))
     557        if ($deltadays <= ($conf_UAM[17]/2))
    560558        {
    561559          $display = 'green';
    562560        }
    563561       
    564         if (($deltadays > ($conf_UAM[18]/2)) and ($deltadays < $conf_UAM[18]))
     562        if (($deltadays > ($conf_UAM[17]/2)) and ($deltadays < $conf_UAM[17]))
    565563        {
    566564          $display = 'orange';
    567565        }
    568566       
    569         if ($deltadays >= $conf_UAM[18])
     567        if ($deltadays >= $conf_UAM[17])
    570568        {
    571569          $display = 'red';
     
    629627  $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']);
    630628       
    631   if (isset($conf_UAM[2]) and $conf_UAM[2]=='true' and ((isset($conf_UAM[3]) and $conf_UAM[3] <> '-1') or (isset($conf_UAM[9]) and $conf_UAM[9] <> '-1')) and isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0]=='true')
    632   {
     629  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')))
     630  {   
    633631// +-----------------------------------------------------------------------+
    634632// |                           initialization                              |
     
    10091007// |                           Template Init                               |
    10101008// +-----------------------------------------------------------------------+
    1011                 $base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
     1009                /*$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
    10121010
    10131011    if (isset($_GET['start']) and is_numeric($_GET['start']))
     
    10181016    {
    10191017      $start = 0;
    1020     }
     1018    }*/
    10211019
    10221020/* Hide radio-button if not allow to assign adviser */
     
    10301028// +-----------------------------------------------------------------------+
    10311029
    1032 $url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
     1030/*$url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
    10331031
    10341032$navbar = create_navigation_bar(
     
    10391037  );
    10401038
    1041 $template->assign('navbar', $navbar);
     1039$template->assign('navbar', $navbar);*/
    10421040
    10431041// +-----------------------------------------------------------------------+
     
    10521050    {
    10531051/* simulate LIMIT $start, $conf['users_page'] */
    1054                         if ($num < $start)
     1052                        /*if ($num < $start)
    10551053      {
    10561054        continue;
     
    10591057      {
    10601058        break;
    1061       }
     1059      }*/
    10621060
    10631061      $visible_user_list[] = $local_user;
     
    11151113
    11161114                        $expiration = expiration($local_user['id']);
    1117 
     1115     
    11181116                $template->append(
    11191117                'users',
     
    11381136                                )
    11391137                        );
    1140                 }
     1138                }   
     1139
     1140    // Check if validation of register is made by admin or visitor
     1141    // If visitor, $Confirm_Local is used to mask useless buttons
     1142    $Confirm_Local = "";
     1143   
     1144    if ($conf_UAM[1] == 'local')
     1145    {
     1146      $Confirm_Local = $conf_UAM[1];
     1147    }
     1148    else
     1149    {
     1150      $Confirm_Local = "";
     1151    }
     1152   
    11411153    /* Plugin version inserted */
    11421154    $template->assign(
    11431155      array(
     1156        'CONFIRM_LOCAL'=> $Confirm_Local,
    11441157        'UAM_VERSION'  => $version,
    11451158        'UAM_PATH'     => UAM_PATH,
     
    11811194  $conf_UAM = unserialize($conf['UserAdvManager']);
    11821195       
    1183   if (isset($conf_UAM[17]) and $conf_UAM[17]=='true')
     1196  if (isset($conf_UAM[16]) and $conf_UAM[16]=='true')
    11841197  {
    11851198// +-----------------------------------------------------------------------+
     
    14431456// |                           Template Init                               |
    14441457// +-----------------------------------------------------------------------+
    1445                 $base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
     1458                /*$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
    14461459
    14471460    if (isset($_GET['start']) and is_numeric($_GET['start']))
     
    14521465    {
    14531466      $start = 0;
    1454     }
     1467    }*/
    14551468
    14561469/* Hide radio-button if not allow to assign adviser */
     
    14641477// +-----------------------------------------------------------------------+
    14651478
    1466 $url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
     1479/*$url = PHPWG_ROOT_PATH.'admin.php'.get_query_string_diff(array('start'));
    14671480
    14681481$navbar = create_navigation_bar(
     
    14731486  );
    14741487
    1475 $template->assign('navbar', $navbar);
     1488$template->assign('navbar', $navbar);*/
    14761489
    14771490// +-----------------------------------------------------------------------+
     
    14831496    {
    14841497/* simulate LIMIT $start, $conf['users_page'] */
    1485                         if ($num < $start)
     1498                        /*if ($num < $start)
    14861499      {
    14871500        continue;
     
    14901503      {
    14911504        break;
    1492       }
     1505      }*/
    14931506
    14941507      $visible_user_list[] = $local_user;
Note: See TracChangeset for help on using the changeset viewer.