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

Remove all options related to comments because they are processed in new "Comments Access Manager" plugin.
New version 2.20.8 hard coded for publication.

Location:
extensions/UserAdvManager/trunk/include
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserAdvManager/trunk/include/functions.inc.php

    r10957 r11018  
    4242  if (!is_admin() and !is_a_guest() and $user['username'] != "16" and $user['username'] != "18")
    4343  {
    44     if ((isset($conf_UAM[16]) and $conf_UAM[16] == 'true') or (isset($conf_UAM[19]) and $conf_UAM[19] == 'true'))
     44    if ((isset($conf_UAM[15]) and $conf_UAM[15] == 'true') or (isset($conf_UAM[18]) and $conf_UAM[18] == 'true'))
    4545    {
    4646
     
    116116    elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true' or $conf_UAM[0] == 'false') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
    117117    {
    118       if (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'true')
     118      if (is_admin() and isset($conf_UAM[19]) and $conf_UAM[19] == 'true')
    119119      {
    120120        $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
    121121        SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
    122122      }
    123       elseif (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'false')
     123      elseif (is_admin() and isset($conf_UAM[19]) and $conf_UAM[19] == 'false')
    124124      {
    125125        $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
     
    171171
    172172    // Password enforcement control
    173     if (isset($conf_UAM[13]) and $conf_UAM[13] == 'true' and !empty($conf_UAM[14]))
     173    if (isset($conf_UAM[12]) and $conf_UAM[12] == 'true' and !empty($conf_UAM[13]))
    174174    {
    175175      if (!empty($user['password']) and !is_admin())
     
    177177        $PasswordCheck = testpassword($user['password']);
    178178 
    179         if ($PasswordCheck < $conf_UAM[14])
     179        if ($PasswordCheck < $conf_UAM[13])
    180180        {
    181181          $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck);
    182           $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14];
     182          $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[13];
    183183          array_push($errors, $lang['reg_err_pass']);
    184184        }
    185185      }
    186       else if (!empty($user['password']) and is_admin() and isset($conf_UAM[15]) and $conf_UAM[15] == 'true')
     186      else if (!empty($user['password']) and is_admin() and isset($conf_UAM[14]) and $conf_UAM[14] == 'true')
    187187      {
    188188        $PasswordCheck = testpassword($user['password']);
    189189 
    190         if ($PasswordCheck < $conf_UAM[14])
     190        if ($PasswordCheck < $conf_UAM[13])
    191191        {
    192192          $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck);
    193           $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14];
     193          $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[13];
    194194          array_push($errors, $lang['reg_err_pass']);
    195195        }
     
    198198
    199199    // Username without forbidden keys
    200     if (isset($conf_UAM[6]) and $conf_UAM[6] == 'true' and !empty($user['username']) and ValidateUsername($user['username']) and !is_admin())
    201     {
    202       $lang['reg_err_login1'] = l10n('UAM_reg_err_login2')."'".$conf_UAM[7]."'";
     200    if (isset($conf_UAM[5]) and $conf_UAM[5] == 'true' and !empty($user['username']) and ValidateUsername($user['username']) and !is_admin())
     201    {
     202      $lang['reg_err_login1'] = l10n('UAM_reg_err_login2')."'".$conf_UAM[6]."'";
    203203      array_push($errors, $lang['reg_err_login1']);
    204204    }
    205205
    206206    // Email without forbidden domains
    207     if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($user['email']) and ValidateEmailProvider($user['email']) and !is_admin())
    208     {
    209       $lang['reg_err_login1'] = l10n('UAM_reg_err_login5')."'".$conf_UAM[12]."'";
     207    if (isset($conf_UAM[10]) and $conf_UAM[10] == 'true' and !empty($user['email']) and ValidateEmailProvider($user['email']) and !is_admin())
     208    {
     209      $lang['reg_err_login1'] = l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'";
    210210      array_push($errors, $lang['reg_err_login1']);
    211211    }
     
    224224  $conf_UAM = unserialize($conf['UserAdvManager']);
    225225   
    226   if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true'))
     226  if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))
    227227  {
    228228    $user_idsOK = array();
     
    243243  {
    244244    // Email without forbidden domains
    245     if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['mail_address']))
     245    if (isset($conf_UAM[10]) and $conf_UAM[10] == 'true' and !empty($_POST['mail_address']))
    246246    {
    247247      if (ValidateEmailProvider($_POST['mail_address']))
    248248      {
    249         $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[12]."'");
     249        $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'");
    250250        unset($_POST['validate']);
    251251      }
     
    259259
    260260      // Password enforcement control
    261       if (isset($conf_UAM[13]) and $conf_UAM[13] == 'true' and !empty($conf_UAM[14]))
     261      if (isset($conf_UAM[12]) and $conf_UAM[12] == 'true' and !empty($conf_UAM[13]))
    262262      {
    263263        $PasswordCheck = testpassword($_POST['use_new_pwd']);
    264264
    265         if ($PasswordCheck < $conf_UAM[14])
     265        if ($PasswordCheck < $conf_UAM[13])
    266266        {
    267267          $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck);
    268           $template->append('errors', l10n_args($message).$conf_UAM[14]);
     268          $template->append('errors', l10n_args($message).$conf_UAM[13]);
    269269          unset($_POST['use_new_pwd']);
    270270          unset($_POST['validate']);
     
    330330 
    331331  // Performing GhostTracker scheduled tasks
    332   if ((isset($conf_UAM[22]) and $conf_UAM[22] == 'true'))
     332  if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true'))
    333333  {
    334334    UAM_GT_ScheduledTasks();
     
    336336
    337337  // Performing User validation scheduled tasks
    338   if ((isset($conf_UAM[31]) and $conf_UAM[31] == 'true'))
     338  if ((isset($conf_UAM[30]) and $conf_UAM[30] == 'true'))
    339339  {
    340340    UAM_USR_ScheduledTasks();
    341341  }
    342342
    343   if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true'))
     343  if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))
    344344  {
    345345    // Performing redirection 
     
    408408
    409409  // Ghost accounts auto group or status downgrade with or without information email sending and autodeletion if user already reminded
    410   if ((isset($conf_UAM[22]) and $conf_UAM[22] == 'true') and ((isset($conf_UAM[26]) and $conf_UAM[26] <> -1) or (isset($conf_UAM[27]) and $conf_UAM[27] <> -1)))
     410  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)))
    411411  {
    412412    if (count($collection) > 0)
     
    492492
    493493            // Change user status
    494             if ($conf_UAM[27] <> -1)
     494            if ($conf_UAM[26] <> -1)
    495495            {
    496496              $query = "
    497497UPDATE ".USER_INFOS_TABLE."
    498 SET status = '".$conf_UAM[27]."'
     498SET status = '".$conf_UAM[26]."'
    499499WHERE user_id = '".$user_id."'
    500500;";
     
    503503
    504504            // Change user group
    505             if ($conf_UAM[26] <> -1)
     505            if ($conf_UAM[25] <> -1)
    506506            {
    507507              $query = "
     
    509509  (user_id, group_id)
    510510VALUES
    511   ('".$user_id."', '".$conf_UAM[26]."')
     511  ('".$user_id."', '".$conf_UAM[25]."')
    512512;";
    513513              pwg_query($query);
     
    515515
    516516            // Auto send email notification on group / status downgrade
    517             if (isset($conf_UAM[23]) and $conf_UAM[23] == 'true')
     517            if (isset($conf_UAM[22]) and $conf_UAM[22] == 'true')
    518518            {
    519519              // Set reminder true
     
    586586
    587587  // Unvalidated accounts auto email sending and autodeletion if user already reminded
    588   if ((isset($conf_UAM[31]) and $conf_UAM[31] == 'true'))
     588  if ((isset($conf_UAM[30]) and $conf_UAM[30] == 'true'))
    589589  {
    590590    if (count($collection) > 0)
     
    611611
    612612        // If never reminded before, send reminder and set reminder True
    613         if (!$reminder and isset($conf_UAM[33]) and $conf_UAM[33] == 'true')
     613        if (!$reminder and isset($conf_UAM[32]) and $conf_UAM[32] == 'true')
    614614        {
    615615                  $typemail = 1;
     
    660660
    661661          // If never reminded before, send reminder and set reminder True
    662           if (!$reminder and isset($conf_UAM[33]) and $conf_UAM[33] == 'true')
     662          if (!$reminder and isset($conf_UAM[32]) and $conf_UAM[32] == 'true')
    663663          {
    664664            $typemail = 1;
     
    704704    {
    705705      // Email without forbidden domains
    706       if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email']))
     706      if (isset($conf_UAM[10]) and $conf_UAM[10] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email']))
    707707      {
    708         $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[12]."'");
     708        $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'");
    709709        unset($_POST['submit_add']);
    710710      }
     
    733733  $conf_UAM = unserialize($conf['UserAdvManager']);
    734734 
    735   if (isset($conf_UAM[29]) and $conf_UAM[29] == 'true')
     735  if (isset($conf_UAM[28]) and $conf_UAM[28] == 'true')
    736736  {
    737737    // Management of Extension flags ([mygallery], [myurl])
     
    743743    $replacements[] = $conf['gallery_url'];
    744744   
    745     $infos = preg_replace($patterns, $replacements, $conf_UAM[30])."\n"."\n".$infos;
     745    $infos = preg_replace($patterns, $replacements, $conf_UAM[29])."\n"."\n".$infos;
    746746  }
    747747  return $infos;
    748 }
    749 
    750 
    751 /**
    752  * Triggered on user_comment_check
    753  *
    754  * checks if author is mandatory and set on comments post when comments for all is set
    755  *
    756  * cheks if author is in an allowed group to post comment when comments for all is not set
    757  *
    758  * @param : comment action, comment
    759  *
    760  * @return : comment action
    761  *
    762  */
    763 function UAM_CheckEmptyCommentAuthor($comment_action, $comm)
    764 {
    765   load_language('plugin.lang', UAM_PATH);
    766   global $infos, $conf, $user;
    767 
    768   $conf_UAM = unserialize($conf['UserAdvManager']);
    769 
    770 // Does not allow empty author name on comments for all
    771   if (isset($conf_UAM[5]) and $conf_UAM[5] == 'true' and $comm['author'] == 'guest' and $conf['comments_forall'])
    772   {
    773     $comment_action = 'reject';
    774 
    775     array_push($infos, l10n('UAM_Empty Author'));
    776   }
    777 
    778 
    779 // Do not allow comments if user is not in an allowed group
    780   if (isset($conf_UAM[36]) and $conf_UAM[36] == 'true' and !$conf['comments_forall'])
    781   {
    782     if (!UAM_CheckAuthor($comm['author']))
    783     {
    784       $comment_action = 'reject';
    785 
    786       array_push($infos, l10n('UAM_Not_Allowed_Author'));
    787     }
    788   }
    789 
    790   return $comment_action;
    791748}
    792749
     
    838795      $password = $password <> '' ? $password : l10n('UAM_empty_pwd');
    839796     
    840       if (isset($conf_UAM[9]) and $conf_UAM[9] <> '')
     797      if (isset($conf_UAM[8]) and $conf_UAM[8] <> '')
    841798      {
    842799        // Management of Extension flags ([username], [mygallery], [myurl])
     
    850807        if (function_exists('get_user_language_desc'))
    851808        {
    852           $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[9]))."\n\n";
     809          $infos1_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n";
    853810        }
    854         else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[9]))."\n\n";
     811        else $infos1_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[8]))."\n\n";
    855812      }
    856813     
     
    872829  if (isset($conf_UAM[0]) and $conf_UAM[0] == 'true')
    873830  {
    874     if (isset($conf_UAM[35]) and $conf_UAM[35] == 'true') // Allow display of clear password in email
     831    if (isset($conf_UAM[34]) and $conf_UAM[34] == 'true') // Allow display of clear password in email
    875832    {
    876833      $infos1 = array(
     
    901858    );
    902859
    903     if (isset($conf_UAM[10]) and $conf_UAM[10] <> '')
     860    if (isset($conf_UAM[9]) and $conf_UAM[9] <> '')
    904861    {
    905862      // Management of Extension flags ([username], [mygallery], [myurl])
     
    913870      if (function_exists('get_user_language_desc'))
    914871      {
    915         $infos2_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[10]))."\n\n";
     872        $infos2_perso = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[9]))."\n\n";
    916873      }
    917       else $infos2_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[10]))."\n\n";
     874      else $infos2_perso = l10n(preg_replace($patterns, $replacements, $conf_UAM[9]))."\n\n";
    918875    }
    919876  }
     
    10961053  $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Ghost_reminder_of_%s', $username));     
    10971054
    1098   if (isset($conf_UAM[18]) and $conf_UAM[18] <> '' and isset($conf_UAM[16]) and $conf_UAM[16] == 'true')
     1055  if (isset($conf_UAM[17]) and $conf_UAM[17] <> '' and isset($conf_UAM[15]) and $conf_UAM[15] == 'true')
    10991056  {
    11001057    // Management of Extension flags ([username], [mygallery], [myurl])
     
    11081065    if (function_exists('get_user_language_desc'))
    11091066    {
    1110       $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[18]))."\n\n";
     1067      $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[17]))."\n\n";
    11111068    }
    11121069    else
    11131070    {
    1114       $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM[18]))."\n\n";
     1071      $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM[17]))."\n\n";
    11151072    }
    11161073
     
    11691126  $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Demotion of %s', stripslashes($username)));
    11701127     
    1171   if (isset($conf_UAM[25]) and $conf_UAM[25] <> '')
     1128  if (isset($conf_UAM[24]) and $conf_UAM[24] <> '')
    11721129  {
    11731130    // Management of Extension flags ([username], [mygallery], [myurl])
     
    11811138    if (function_exists('get_user_language_desc'))
    11821139    {
    1183       $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[25]))."\n\n";
    1184     }
    1185     else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[25]))."\n\n";
     1140      $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[24]))."\n\n";
     1141    }
     1142    else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[24]))."\n\n";
    11861143  }
    11871144
     
    12601217  $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Validation of %s', stripslashes($result['username'])));
    12611218     
    1262   if (isset($conf_UAM[28]) and $conf_UAM[28] <> '')
     1219  if (isset($conf_UAM[27]) and $conf_UAM[27] <> '')
    12631220  {
    12641221    // Management of Extension flags ([username], [mygallery], [myurl])
     
    12721229    if (function_exists('get_user_language_desc'))
    12731230    {
    1274       $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[28]))."\n\n";
    1275     }
    1276     else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[28]))."\n\n";
     1231      $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[27]))."\n\n";
     1232    }
     1233    else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[27]))."\n\n";
    12771234  }
    12781235
     
    13651322
    13661323    // Set user unvalidated status
    1367     if (!is_admin() and $conf_UAM[8] <> -1)
     1324    if (!is_admin() and $conf_UAM[7] <> -1)
    13681325    {
    13691326      $query = "
    13701327UPDATE ".USER_INFOS_TABLE."
    1371 SET status = '".$conf_UAM[8]."'
     1328SET status = '".$conf_UAM[7]."'
    13721329WHERE user_id = '".$user_id."'
    13731330;";
     
    14161373  pwg_query($query);
    14171374
    1418   if (!is_admin() and $conf_UAM[8] <> -1)
     1375  if (!is_admin() and $conf_UAM[7] <> -1)
    14191376  {
    14201377    $query = "
    14211378UPDATE ".USER_INFOS_TABLE."
    1422 SET status = '".$conf_UAM[8]."'
     1379SET status = '".$conf_UAM[7]."'
    14231380WHERE user_id = '".$user_id."'
    14241381;";
     
    18521809  $conf_UAM = unserialize($conf['UserAdvManager']);
    18531810
    1854   if (isset($login) and isset($conf_UAM[7]) and $conf_UAM[7] <> '')
    1855   {
    1856     $conf_CharExclusion = preg_split("/,/",$conf_UAM[7]);
     1811  if (isset($login) and isset($conf_UAM[6]) and $conf_UAM[6] <> '')
     1812  {
     1813    $conf_CharExclusion = preg_split("/,/",$conf_UAM[6]);
    18571814    for ($i = 0 ; $i < count($conf_CharExclusion) ; $i++)
    18581815    {
     
    18861843  $conf_UAM = unserialize($conf['UserAdvManager']);
    18871844 
    1888         if (isset($email) and isset($conf_UAM[12]) and $conf_UAM[12] <> '')
     1845        if (isset($email) and isset($conf_UAM[11]) and $conf_UAM[11] <> '')
    18891846        {
    1890                 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[12]);
     1847                $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]);
    18911848                for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++)
    18921849                {
     
    19401897  OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_UAM_ConfirmMail[1].'")';
    19411898
    1942         if ($conf_UAM[2] <> '-1' and $conf_UAM[8] == '-1')
     1899        if ($conf_UAM[2] <> '-1' and $conf_UAM[7] == '-1')
    19431900  {
    19441901    $query.= '
    19451902  AND ug.group_id = '.$conf_UAM[2];
    19461903  }
    1947   if ($conf_UAM[2] == '-1' and $conf_UAM[8] <> '-1')
     1904  if ($conf_UAM[2] == '-1' and $conf_UAM[7] <> '-1')
    19481905  {
    19491906    $query.= '
    1950   AND ui.status = \''.$conf_UAM[8]."'";
    1951   }
    1952   if ($conf_UAM[2] <> '-1' and $conf_UAM[8] <> '-1')
     1907  AND ui.status = \''.$conf_UAM[7]."'";
     1908  }
     1909  if ($conf_UAM[2] <> '-1' and $conf_UAM[7] <> '-1')
    19531910  {
    19541911    $query.= '
     
    20632020  INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv
    20642021    ON u.'.$conf['user_fields']['id'].' = lv.user_id
    2065 WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[17].'")
     2022WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[16].'")
    20662023ORDER BY lv.lastvisit ASC;';
    20672024
     
    21082065  INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv
    21092066    ON u.'.$conf['user_fields']['id'].' = lv.user_id
    2110 WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[17].'")
     2067WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[16].'")
    21112068ORDER BY lv.lastvisit ASC;';
    21122069
     
    25402497
    25412498/**
    2542  * Called from UAM_CheckEmptyCommentAuthor()
    2543  * Checks if comment's author name is in the allowed group
    2544  *
    2545  * @author   : author's name
    2546  *
    2547  * @returns  : Boolean (true is user is allowed to post / false if not allowed)
    2548  *
    2549  */
    2550 function UAM_CheckAuthor($author)
    2551 {
    2552   global $conf;
    2553  
    2554         // Get UAM configuration
    2555   $conf_UAM = unserialize($conf['UserAdvManager']);
    2556  
    2557   if (isset($conf_UAM[37]) and $conf_UAM[37] <> -1)
    2558   {
    2559     $query = '
    2560 SELECT u.id,
    2561        u.username,
    2562        ug.user_id,
    2563        ug.group_id
    2564 FROM '.USERS_TABLE.' AS u
    2565   INNER JOIN '.USER_GROUP_TABLE.' AS ug
    2566     ON u.id = ug.user_id
    2567 WHERE u.username LIKE "'.$author.'"
    2568   AND ug.group_id = '.$conf_UAM[37].'
    2569 ;';
    2570 
    2571     $count = pwg_db_num_rows(pwg_query($query));
    2572 
    2573     if (is_null($count) or $count == 0)
    2574     {
    2575       return false;
    2576     }
    2577     else
    2578       return true;
    2579   }
    2580 }
    2581 
    2582 
    2583 /**
    25842499 * Useful for debugging - 4 vars can be set
    25852500 * Output result to log.txt file
  • extensions/UserAdvManager/trunk/include/upgradedb.inc.php

    r10976 r11018  
    427427  conf_update_param('UserAdvManager', pwg_db_real_escape_string($update_conf));
    428428}
     429
     430/* upgrade from 2.20.7 to 2.20.8 */
     431/* ***************************** */
     432function upgrade_2207_2208()
     433{
     434  global $conf;
     435
     436  // Upgrading options
     437  $query = '
     438SELECT value
     439  FROM '.CONFIG_TABLE.'
     440WHERE param = "UserAdvManager"
     441;';
     442
     443  $result = pwg_query($query);
     444  $conf_UAM = pwg_db_fetch_assoc($result);
     445   
     446  $Newconf_UAM = unserialize($conf_UAM['value']);
     447
     448  // Refactoring all configuration options
     449  $Newconf_UAM[0] = $Newconf_UAM[0];
     450  $Newconf_UAM[1] = $Newconf_UAM[1];
     451  $Newconf_UAM[2] = $Newconf_UAM[2];
     452  $Newconf_UAM[3] = $Newconf_UAM[3];
     453  $Newconf_UAM[4] = $Newconf_UAM[4];
     454  $Newconf_UAM[5] = $Newconf_UAM[6]; //remove osolete anonymus comments option
     455  $Newconf_UAM[6] = $Newconf_UAM[7];
     456  $Newconf_UAM[7] = $Newconf_UAM[8];
     457  $Newconf_UAM[8] = $Newconf_UAM[9];
     458  $Newconf_UAM[9] = $Newconf_UAM[10];
     459  $Newconf_UAM[10] = $Newconf_UAM[11];
     460  $Newconf_UAM[11] = $Newconf_UAM[12];
     461  $Newconf_UAM[12] = $Newconf_UAM[13];
     462  $Newconf_UAM[13] = $Newconf_UAM[14];
     463  $Newconf_UAM[14] = $Newconf_UAM[15];
     464  $Newconf_UAM[15] = $Newconf_UAM[16];
     465  $Newconf_UAM[16] = $Newconf_UAM[17];
     466  $Newconf_UAM[17] = $Newconf_UAM[18];
     467  $Newconf_UAM[18] = $Newconf_UAM[19];
     468  $Newconf_UAM[19] = $Newconf_UAM[20];
     469  $Newconf_UAM[20] = $Newconf_UAM[21];
     470  $Newconf_UAM[21] = $Newconf_UAM[22];
     471  $Newconf_UAM[22] = $Newconf_UAM[23];
     472  $Newconf_UAM[23] = $Newconf_UAM[24];
     473  $Newconf_UAM[24] = $Newconf_UAM[25];
     474  $Newconf_UAM[25] = $Newconf_UAM[26];
     475  $Newconf_UAM[26] = $Newconf_UAM[27];
     476  $Newconf_UAM[27] = $Newconf_UAM[28];
     477  $Newconf_UAM[28] = $Newconf_UAM[29];
     478  $Newconf_UAM[29] = $Newconf_UAM[30];
     479  $Newconf_UAM[30] = $Newconf_UAM[31];
     480  $Newconf_UAM[31] = $Newconf_UAM[32];
     481  $Newconf_UAM[32] = $Newconf_UAM[33];
     482  $Newconf_UAM[33] = $Newconf_UAM[34];
     483  $Newconf_UAM[34] = $Newconf_UAM[35];
     484 
     485  // unset obsolete conf
     486  unset ($Newconf_UAM[35]);
     487  unset ($Newconf_UAM[36]);
     488  unset ($Newconf_UAM[37]);
     489 
     490  $update_conf = serialize($Newconf_UAM);
     491
     492  conf_update_param('UserAdvManager', pwg_db_real_escape_string($update_conf));
     493}
    429494?>
Note: See TracChangeset for help on using the changeset viewer.