Changeset 11018 for extensions/UserAdvManager/trunk/include
- Timestamp:
- May 23, 2011, 7:05:01 PM (13 years ago)
- Location:
- extensions/UserAdvManager/trunk/include
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserAdvManager/trunk/include/functions.inc.php
r10957 r11018 42 42 if (!is_admin() and !is_a_guest() and $user['username'] != "16" and $user['username'] != "18") 43 43 { 44 if ((isset($conf_UAM[1 6]) 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')) 45 45 { 46 46 … … 116 116 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')) 117 117 { 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') 119 119 { 120 120 $passwd = (isset($_POST['password'])) ? $_POST['password'] : ''; 121 121 SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true); 122 122 } 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') 124 124 { 125 125 $passwd = (isset($_POST['password'])) ? $_POST['password'] : ''; … … 171 171 172 172 // Password enforcement control 173 if (isset($conf_UAM[1 3]) 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])) 174 174 { 175 175 if (!empty($user['password']) and !is_admin()) … … 177 177 $PasswordCheck = testpassword($user['password']); 178 178 179 if ($PasswordCheck < $conf_UAM[1 4])179 if ($PasswordCheck < $conf_UAM[13]) 180 180 { 181 181 $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck); 182 $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[1 4];182 $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[13]; 183 183 array_push($errors, $lang['reg_err_pass']); 184 184 } 185 185 } 186 else if (!empty($user['password']) and is_admin() and isset($conf_UAM[1 5]) and $conf_UAM[15] == 'true')186 else if (!empty($user['password']) and is_admin() and isset($conf_UAM[14]) and $conf_UAM[14] == 'true') 187 187 { 188 188 $PasswordCheck = testpassword($user['password']); 189 189 190 if ($PasswordCheck < $conf_UAM[1 4])190 if ($PasswordCheck < $conf_UAM[13]) 191 191 { 192 192 $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck); 193 $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[1 4];193 $lang['reg_err_pass'] = l10n_args($message).$conf_UAM[13]; 194 194 array_push($errors, $lang['reg_err_pass']); 195 195 } … … 198 198 199 199 // 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]."'"; 203 203 array_push($errors, $lang['reg_err_login1']); 204 204 } 205 205 206 206 // Email without forbidden domains 207 if (isset($conf_UAM[1 1]) 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[1 2]."'";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]."'"; 210 210 array_push($errors, $lang['reg_err_login1']); 211 211 } … … 224 224 $conf_UAM = unserialize($conf['UserAdvManager']); 225 225 226 if ((isset($conf_UAM[2 1]) and $conf_UAM[21] == 'true'))226 if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true')) 227 227 { 228 228 $user_idsOK = array(); … … 243 243 { 244 244 // Email without forbidden domains 245 if (isset($conf_UAM[1 1]) 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'])) 246 246 { 247 247 if (ValidateEmailProvider($_POST['mail_address'])) 248 248 { 249 $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[1 2]."'");249 $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'"); 250 250 unset($_POST['validate']); 251 251 } … … 259 259 260 260 // Password enforcement control 261 if (isset($conf_UAM[1 3]) 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])) 262 262 { 263 263 $PasswordCheck = testpassword($_POST['use_new_pwd']); 264 264 265 if ($PasswordCheck < $conf_UAM[1 4])265 if ($PasswordCheck < $conf_UAM[13]) 266 266 { 267 267 $message = get_l10n_args('UAM_reg_err_login4_%s', $PasswordCheck); 268 $template->append('errors', l10n_args($message).$conf_UAM[1 4]);268 $template->append('errors', l10n_args($message).$conf_UAM[13]); 269 269 unset($_POST['use_new_pwd']); 270 270 unset($_POST['validate']); … … 330 330 331 331 // Performing GhostTracker scheduled tasks 332 if ((isset($conf_UAM[2 2]) and $conf_UAM[22] == 'true'))332 if ((isset($conf_UAM[21]) and $conf_UAM[21] == 'true')) 333 333 { 334 334 UAM_GT_ScheduledTasks(); … … 336 336 337 337 // Performing User validation scheduled tasks 338 if ((isset($conf_UAM[3 1]) and $conf_UAM[31] == 'true'))338 if ((isset($conf_UAM[30]) and $conf_UAM[30] == 'true')) 339 339 { 340 340 UAM_USR_ScheduledTasks(); 341 341 } 342 342 343 if ((isset($conf_UAM[2 1]) and $conf_UAM[21] == 'true'))343 if ((isset($conf_UAM[20]) and $conf_UAM[20] == 'true')) 344 344 { 345 345 // Performing redirection … … 408 408 409 409 // Ghost accounts auto group or status downgrade with or without information email sending and autodeletion if user already reminded 410 if ((isset($conf_UAM[2 2]) 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))) 411 411 { 412 412 if (count($collection) > 0) … … 492 492 493 493 // Change user status 494 if ($conf_UAM[2 7] <> -1)494 if ($conf_UAM[26] <> -1) 495 495 { 496 496 $query = " 497 497 UPDATE ".USER_INFOS_TABLE." 498 SET status = '".$conf_UAM[2 7]."'498 SET status = '".$conf_UAM[26]."' 499 499 WHERE user_id = '".$user_id."' 500 500 ;"; … … 503 503 504 504 // Change user group 505 if ($conf_UAM[2 6] <> -1)505 if ($conf_UAM[25] <> -1) 506 506 { 507 507 $query = " … … 509 509 (user_id, group_id) 510 510 VALUES 511 ('".$user_id."', '".$conf_UAM[2 6]."')511 ('".$user_id."', '".$conf_UAM[25]."') 512 512 ;"; 513 513 pwg_query($query); … … 515 515 516 516 // Auto send email notification on group / status downgrade 517 if (isset($conf_UAM[2 3]) and $conf_UAM[23] == 'true')517 if (isset($conf_UAM[22]) and $conf_UAM[22] == 'true') 518 518 { 519 519 // Set reminder true … … 586 586 587 587 // Unvalidated accounts auto email sending and autodeletion if user already reminded 588 if ((isset($conf_UAM[3 1]) and $conf_UAM[31] == 'true'))588 if ((isset($conf_UAM[30]) and $conf_UAM[30] == 'true')) 589 589 { 590 590 if (count($collection) > 0) … … 611 611 612 612 // If never reminded before, send reminder and set reminder True 613 if (!$reminder and isset($conf_UAM[3 3]) and $conf_UAM[33] == 'true')613 if (!$reminder and isset($conf_UAM[32]) and $conf_UAM[32] == 'true') 614 614 { 615 615 $typemail = 1; … … 660 660 661 661 // If never reminded before, send reminder and set reminder True 662 if (!$reminder and isset($conf_UAM[3 3]) and $conf_UAM[33] == 'true')662 if (!$reminder and isset($conf_UAM[32]) and $conf_UAM[32] == 'true') 663 663 { 664 664 $typemail = 1; … … 704 704 { 705 705 // Email without forbidden domains 706 if (isset($conf_UAM[1 1]) 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'])) 707 707 { 708 $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[1 2]."'");708 $template->append('errors', l10n('UAM_reg_err_login5')."'".$conf_UAM[11]."'"); 709 709 unset($_POST['submit_add']); 710 710 } … … 733 733 $conf_UAM = unserialize($conf['UserAdvManager']); 734 734 735 if (isset($conf_UAM[2 9]) and $conf_UAM[29] == 'true')735 if (isset($conf_UAM[28]) and $conf_UAM[28] == 'true') 736 736 { 737 737 // Management of Extension flags ([mygallery], [myurl]) … … 743 743 $replacements[] = $conf['gallery_url']; 744 744 745 $infos = preg_replace($patterns, $replacements, $conf_UAM[ 30])."\n"."\n".$infos;745 $infos = preg_replace($patterns, $replacements, $conf_UAM[29])."\n"."\n".$infos; 746 746 } 747 747 return $infos; 748 }749 750 751 /**752 * Triggered on user_comment_check753 *754 * checks if author is mandatory and set on comments post when comments for all is set755 *756 * cheks if author is in an allowed group to post comment when comments for all is not set757 *758 * @param : comment action, comment759 *760 * @return : comment action761 *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 all771 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 group780 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;791 748 } 792 749 … … 838 795 $password = $password <> '' ? $password : l10n('UAM_empty_pwd'); 839 796 840 if (isset($conf_UAM[ 9]) and $conf_UAM[9] <> '')797 if (isset($conf_UAM[8]) and $conf_UAM[8] <> '') 841 798 { 842 799 // Management of Extension flags ([username], [mygallery], [myurl]) … … 850 807 if (function_exists('get_user_language_desc')) 851 808 { 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"; 853 810 } 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"; 855 812 } 856 813 … … 872 829 if (isset($conf_UAM[0]) and $conf_UAM[0] == 'true') 873 830 { 874 if (isset($conf_UAM[3 5]) and $conf_UAM[35] == 'true') // Allow display of clear password in email831 if (isset($conf_UAM[34]) and $conf_UAM[34] == 'true') // Allow display of clear password in email 875 832 { 876 833 $infos1 = array( … … 901 858 ); 902 859 903 if (isset($conf_UAM[ 10]) and $conf_UAM[10] <> '')860 if (isset($conf_UAM[9]) and $conf_UAM[9] <> '') 904 861 { 905 862 // Management of Extension flags ([username], [mygallery], [myurl]) … … 913 870 if (function_exists('get_user_language_desc')) 914 871 { 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"; 916 873 } 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"; 918 875 } 919 876 } … … 1096 1053 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Ghost_reminder_of_%s', $username)); 1097 1054 1098 if (isset($conf_UAM[1 8]) 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') 1099 1056 { 1100 1057 // Management of Extension flags ([username], [mygallery], [myurl]) … … 1108 1065 if (function_exists('get_user_language_desc')) 1109 1066 { 1110 $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[1 8]))."\n\n";1067 $infos1 = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[17]))."\n\n"; 1111 1068 } 1112 1069 else 1113 1070 { 1114 $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM[1 8]))."\n\n";1071 $infos1 = l10n(preg_replace($patterns, $replacements, $conf_UAM[17]))."\n\n"; 1115 1072 } 1116 1073 … … 1169 1126 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Demotion of %s', stripslashes($username))); 1170 1127 1171 if (isset($conf_UAM[2 5]) and $conf_UAM[25] <> '')1128 if (isset($conf_UAM[24]) and $conf_UAM[24] <> '') 1172 1129 { 1173 1130 // Management of Extension flags ([username], [mygallery], [myurl]) … … 1181 1138 if (function_exists('get_user_language_desc')) 1182 1139 { 1183 $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[2 5]))."\n\n";1184 } 1185 else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[2 5]))."\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"; 1186 1143 } 1187 1144 … … 1260 1217 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('UAM_Validation of %s', stripslashes($result['username']))); 1261 1218 1262 if (isset($conf_UAM[2 8]) and $conf_UAM[28] <> '')1219 if (isset($conf_UAM[27]) and $conf_UAM[27] <> '') 1263 1220 { 1264 1221 // Management of Extension flags ([username], [mygallery], [myurl]) … … 1272 1229 if (function_exists('get_user_language_desc')) 1273 1230 { 1274 $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[2 8]))."\n\n";1275 } 1276 else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[2 8]))."\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"; 1277 1234 } 1278 1235 … … 1365 1322 1366 1323 // Set user unvalidated status 1367 if (!is_admin() and $conf_UAM[ 8] <> -1)1324 if (!is_admin() and $conf_UAM[7] <> -1) 1368 1325 { 1369 1326 $query = " 1370 1327 UPDATE ".USER_INFOS_TABLE." 1371 SET status = '".$conf_UAM[ 8]."'1328 SET status = '".$conf_UAM[7]."' 1372 1329 WHERE user_id = '".$user_id."' 1373 1330 ;"; … … 1416 1373 pwg_query($query); 1417 1374 1418 if (!is_admin() and $conf_UAM[ 8] <> -1)1375 if (!is_admin() and $conf_UAM[7] <> -1) 1419 1376 { 1420 1377 $query = " 1421 1378 UPDATE ".USER_INFOS_TABLE." 1422 SET status = '".$conf_UAM[ 8]."'1379 SET status = '".$conf_UAM[7]."' 1423 1380 WHERE user_id = '".$user_id."' 1424 1381 ;"; … … 1852 1809 $conf_UAM = unserialize($conf['UserAdvManager']); 1853 1810 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]); 1857 1814 for ($i = 0 ; $i < count($conf_CharExclusion) ; $i++) 1858 1815 { … … 1886 1843 $conf_UAM = unserialize($conf['UserAdvManager']); 1887 1844 1888 if (isset($email) and isset($conf_UAM[1 2]) and $conf_UAM[12] <> '')1845 if (isset($email) and isset($conf_UAM[11]) and $conf_UAM[11] <> '') 1889 1846 { 1890 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[1 2]);1847 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]); 1891 1848 for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++) 1892 1849 { … … 1940 1897 OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_UAM_ConfirmMail[1].'")'; 1941 1898 1942 if ($conf_UAM[2] <> '-1' and $conf_UAM[ 8] == '-1')1899 if ($conf_UAM[2] <> '-1' and $conf_UAM[7] == '-1') 1943 1900 { 1944 1901 $query.= ' 1945 1902 AND ug.group_id = '.$conf_UAM[2]; 1946 1903 } 1947 if ($conf_UAM[2] == '-1' and $conf_UAM[ 8] <> '-1')1904 if ($conf_UAM[2] == '-1' and $conf_UAM[7] <> '-1') 1948 1905 { 1949 1906 $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') 1953 1910 { 1954 1911 $query.= ' … … 2063 2020 INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv 2064 2021 ON u.'.$conf['user_fields']['id'].' = lv.user_id 2065 WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[1 7].'")2022 WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[16].'") 2066 2023 ORDER BY lv.lastvisit ASC;'; 2067 2024 … … 2108 2065 INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv 2109 2066 ON u.'.$conf['user_fields']['id'].' = lv.user_id 2110 WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[1 7].'")2067 WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[16].'") 2111 2068 ORDER BY lv.lastvisit ASC;'; 2112 2069 … … 2540 2497 2541 2498 /** 2542 * Called from UAM_CheckEmptyCommentAuthor()2543 * Checks if comment's author name is in the allowed group2544 *2545 * @author : author's name2546 *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 configuration2555 $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_id2564 FROM '.USERS_TABLE.' AS u2565 INNER JOIN '.USER_GROUP_TABLE.' AS ug2566 ON u.id = ug.user_id2567 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 else2578 return true;2579 }2580 }2581 2582 2583 /**2584 2499 * Useful for debugging - 4 vars can be set 2585 2500 * Output result to log.txt file -
extensions/UserAdvManager/trunk/include/upgradedb.inc.php
r10976 r11018 427 427 conf_update_param('UserAdvManager', pwg_db_real_escape_string($update_conf)); 428 428 } 429 430 /* upgrade from 2.20.7 to 2.20.8 */ 431 /* ***************************** */ 432 function upgrade_2207_2208() 433 { 434 global $conf; 435 436 // Upgrading options 437 $query = ' 438 SELECT value 439 FROM '.CONFIG_TABLE.' 440 WHERE 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 } 429 494 ?>
Note: See TracChangeset
for help on using the changeset viewer.