- Timestamp:
- Aug 18, 2010, 10:56:53 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/branches/2.15/admin/UAM_admin.php
r6253 r6776 28 28 $UAM_Password_Test_Score = 0; 29 29 $UAM_Exclusionlist_Error = false; 30 31 30 32 31 // +-----------------------------------------------------------------------+ … … 102 101 case 'global': 103 102 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'])) 105 104 { 106 105 107 106 /* 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']))); 109 108 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']))); 113 112 114 113 … … 119 118 $UAM_Exclusionlist_Error = true; 120 119 } 121 120 122 121 $newconf_UAM = array( 123 122 $_POST['UAM_Mail_Info'], 124 $_POST['UAM_No_Casse'],125 123 $_POST['UAM_Confirm_Mail'], 126 124 (isset($_POST['UAM_No_Confirm_Group'])?$_POST['UAM_No_Confirm_Group']:''), … … 142 140 $_POST['UAM_GhostTracker_ReminderText'], 143 141 $_POST['UAM_Add_LastVisit_Column'], 144 $_POST['UAM_Admin_ConfMail']); 142 $_POST['UAM_Admin_ConfMail'], 143 $_POST['UAM_RedirToProfile']); 145 144 146 145 $conf['UserAdvManager'] = serialize($newconf_UAM); … … 155 154 pwg_query($query); 156 155 157 158 156 /* 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']))); 162 160 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']))); 164 162 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 168 165 $newconf_UAM_ConfirmMail = array ( 169 166 $_POST['UAM_ConfirmMail_TimeOut'], … … 220 217 $groups[$row['id']] = $row['name']; 221 218 /* 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 */ 222 224 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'])228 225 { 229 226 $Valid = $row['id']; … … 257 254 { 258 255 $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) 260 257 { 261 258 $No_Valid_Status = $status; … … 276 273 { 277 274 $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) 279 276 { 280 277 $Valid_Status = $status; … … 305 302 'UAM_MAIL_INFO_TRUE' => $conf_UAM[0]=='true' ? 'checked="checked"' : '' , 306 303 '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"' : '' , 338 336 'UAM_PASSWORD_TEST_SCORE' => $UAM_Password_Test_Score, 339 337 'UAM_ERROR_REPORTS4' => $UAM_Exclusionlist_Error, … … 355 353 356 354 /* 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') 358 356 { 359 357 $query = " … … 379 377 380 378 /* 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' ) 382 380 { 383 381 $query = " … … 398 396 399 397 /* Email without forbidden domain */ 400 if ( isset($conf_UAM[1 2]) and $conf_UAM[12] == 'true' )398 if ( isset($conf_UAM[11]) and $conf_UAM[11] == 'true' ) 401 399 { 402 400 $query = " … … 409 407 while($row = pwg_db_fetch_assoc($result)) 410 408 { 411 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[1 3]);409 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[12]); 412 410 for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++) 413 411 { … … 467 465 $conf_UAM = unserialize($conf['UserAdvManager']); 468 466 469 if (isset($conf_UAM[ 20]) and $conf_UAM[20]=='true')467 if (isset($conf_UAM[19]) and $conf_UAM[19]=='true') 470 468 { 471 469 // +-----------------------------------------------------------------------+ … … 495 493 // | Template Init | 496 494 // +-----------------------------------------------------------------------+ 497 $base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';495 /*$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list'; 498 496 499 497 if (isset($_GET['start']) and is_numeric($_GET['start'])) … … 504 502 { 505 503 $start = 0; 506 } 504 }*/ 507 505 508 506 // +-----------------------------------------------------------------------+ … … 510 508 // +-----------------------------------------------------------------------+ 511 509 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')); 513 511 514 512 $navbar = create_navigation_bar( … … 519 517 ); 520 518 521 $template->assign('navbar', $navbar); 519 $template->assign('navbar', $navbar);*/ 522 520 523 521 // +-----------------------------------------------------------------------+ … … 528 526 foreach ($page['filtered_users'] as $num => $local_user) 529 527 { 530 / * simulate LIMIT $start, $conf['users_page'] */531 if ($num < $start)528 // simulate LIMIT $start, $conf['users_page'] 529 /*if ($num < $start) 532 530 { 533 531 continue; … … 536 534 { 537 535 break; 538 } 536 }*/ 539 537 540 538 $visible_user_list[] = $local_user; … … 555 553 $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days 556 554 557 if (isset($conf_UAM[1 7]) and $conf_UAM[17]=='true' and $conf_UAM[18] <> '')555 if (isset($conf_UAM[16]) and $conf_UAM[16]=='true' and $conf_UAM[17] <> '') 558 556 { 559 if ($deltadays <= ($conf_UAM[1 8]/2))557 if ($deltadays <= ($conf_UAM[17]/2)) 560 558 { 561 559 $display = 'green'; 562 560 } 563 561 564 if (($deltadays > ($conf_UAM[1 8]/2)) and ($deltadays < $conf_UAM[18]))562 if (($deltadays > ($conf_UAM[17]/2)) and ($deltadays < $conf_UAM[17])) 565 563 { 566 564 $display = 'orange'; 567 565 } 568 566 569 if ($deltadays >= $conf_UAM[1 8])567 if ($deltadays >= $conf_UAM[17]) 570 568 { 571 569 $display = 'red'; … … 629 627 $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); 630 628 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 { 633 631 // +-----------------------------------------------------------------------+ 634 632 // | initialization | … … 1009 1007 // | Template Init | 1010 1008 // +-----------------------------------------------------------------------+ 1011 $base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';1009 /*$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list'; 1012 1010 1013 1011 if (isset($_GET['start']) and is_numeric($_GET['start'])) … … 1018 1016 { 1019 1017 $start = 0; 1020 } 1018 }*/ 1021 1019 1022 1020 /* Hide radio-button if not allow to assign adviser */ … … 1030 1028 // +-----------------------------------------------------------------------+ 1031 1029 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')); 1033 1031 1034 1032 $navbar = create_navigation_bar( … … 1039 1037 ); 1040 1038 1041 $template->assign('navbar', $navbar); 1039 $template->assign('navbar', $navbar);*/ 1042 1040 1043 1041 // +-----------------------------------------------------------------------+ … … 1052 1050 { 1053 1051 /* simulate LIMIT $start, $conf['users_page'] */ 1054 if ($num < $start)1052 /*if ($num < $start) 1055 1053 { 1056 1054 continue; … … 1059 1057 { 1060 1058 break; 1061 } 1059 }*/ 1062 1060 1063 1061 $visible_user_list[] = $local_user; … … 1115 1113 1116 1114 $expiration = expiration($local_user['id']); 1117 1115 1118 1116 $template->append( 1119 1117 'users', … … 1138 1136 ) 1139 1137 ); 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 1141 1153 /* Plugin version inserted */ 1142 1154 $template->assign( 1143 1155 array( 1156 'CONFIRM_LOCAL'=> $Confirm_Local, 1144 1157 'UAM_VERSION' => $version, 1145 1158 'UAM_PATH' => UAM_PATH, … … 1181 1194 $conf_UAM = unserialize($conf['UserAdvManager']); 1182 1195 1183 if (isset($conf_UAM[1 7]) and $conf_UAM[17]=='true')1196 if (isset($conf_UAM[16]) and $conf_UAM[16]=='true') 1184 1197 { 1185 1198 // +-----------------------------------------------------------------------+ … … 1443 1456 // | Template Init | 1444 1457 // +-----------------------------------------------------------------------+ 1445 $base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';1458 /*$base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list'; 1446 1459 1447 1460 if (isset($_GET['start']) and is_numeric($_GET['start'])) … … 1452 1465 { 1453 1466 $start = 0; 1454 } 1467 }*/ 1455 1468 1456 1469 /* Hide radio-button if not allow to assign adviser */ … … 1464 1477 // +-----------------------------------------------------------------------+ 1465 1478 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')); 1467 1480 1468 1481 $navbar = create_navigation_bar( … … 1473 1486 ); 1474 1487 1475 $template->assign('navbar', $navbar); 1488 $template->assign('navbar', $navbar);*/ 1476 1489 1477 1490 // +-----------------------------------------------------------------------+ … … 1483 1496 { 1484 1497 /* simulate LIMIT $start, $conf['users_page'] */ 1485 if ($num < $start)1498 /*if ($num < $start) 1486 1499 { 1487 1500 continue; … … 1490 1503 { 1491 1504 break; 1492 } 1505 }*/ 1493 1506 1494 1507 $visible_user_list[] = $local_user;
Note: See TracChangeset
for help on using the changeset viewer.