Changeset 6354
- Timestamp:
- May 25, 2010, 6:11:02 PM (14 years ago)
- Location:
- extensions/NBC_UserAdvManager/trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/trunk/ConfirmMail.php
r5633 r6354 14 14 load_language('plugin.lang', UAM_PATH); 15 15 16 /**17 * set in ./language/en_UK.iso-8859-1/local.lang.php (maybe to create)18 * for example for clear theme:19 $lang['Theme: clear'] = 'This is the clear theme based on yoga template. '.20 ' A standard template/theme of PhpWebgallery.';21 *22 * Don't forget php tags !!!23 *24 * Another way is to code it thru the theme itself in ./themeconf.inc.php25 */26 27 16 $title= l10n('confirm_mail_page_title'); 28 17 $page['body_id'] = 'theAboutPage'; … … 31 20 @include(PHPWG_ROOT_PATH.'template/'.$user['template']. 32 21 '/theme/'.$user['theme'].'/themeconf.inc.php'); 22 33 23 34 24 if (isset($_GET['key'])) -
extensions/NBC_UserAdvManager/trunk/admin/UAM_admin.php
r6251 r6354 102 102 case 'global': 103 103 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']))104 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'])) 105 105 { 106 106 … … 122 122 $newconf_UAM = array( 123 123 $_POST['UAM_Mail_Info'], 124 $_POST['UAM_No_Casse'],125 124 $_POST['UAM_Confirm_Mail'], 126 125 (isset($_POST['UAM_No_Confirm_Group'])?$_POST['UAM_No_Confirm_Group']:''), … … 220 219 $groups[$row['id']] = $row['name']; 221 220 /* configuration value for unvalidated users */ 221 if (isset($conf_UAM[2]) and $conf_UAM[2] == $row['id']) 222 { 223 $No_Valid = $row['id']; 224 } 225 /* configuration value for validated users */ 222 226 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 227 { 229 228 $Valid = $row['id']; … … 257 256 { 258 257 $status_options[$status] = l10n('user_status_'.$status); 259 if (isset($conf_UAM[ 9]) and $conf_UAM[9] == $status)258 if (isset($conf_UAM[8]) and $conf_UAM[8] == $status) 260 259 { 261 260 $No_Valid_Status = $status; … … 276 275 { 277 276 $status_options[$status] = l10n('user_status_'.$status); 278 if (isset($conf_UAM[ 5]) and $conf_UAM[5] == $status)277 if (isset($conf_UAM[4]) and $conf_UAM[4] == $status) 279 278 { 280 279 $Valid_Status = $status; … … 305 304 'UAM_MAIL_INFO_TRUE' => $conf_UAM[0]=='true' ? 'checked="checked"' : '' , 306 305 '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"' : '' , 306 'UAM_MAILINFO_TEXT' => $conf_UAM[9], 307 'UAM_USERNAME_CHAR_TRUE' => $conf_UAM[6]=='true' ? 'checked="checked"' : '' , 308 'UAM_USERNAME_CHAR_FALSE' => $conf_UAM[6]=='false' ? 'checked="checked"' : '' , 309 'UAM_USERNAME_CHAR_LIST' => $conf_UAM[7], 310 'UAM_CONFIRM_MAIL_TRUE' => $conf_UAM[1]=='true' ? 'checked="checked"' : '' , 311 'UAM_CONFIRM_MAIL_FALSE' => $conf_UAM[1]=='false' ? 'checked="checked"' : '' , 312 'UAM_CONFIRMMAIL_TEXT' => $conf_UAM[10], 313 'UAM_No_Confirm_Group' => $conf_UAM[2], 314 'UAM_Validated_Group' => $conf_UAM[3], 315 'UAM_No_Confirm_Status' => $conf_UAM[8], 316 'UAM_Validated_Status' => $conf_UAM[4], 317 'UAM_NO_COMMENT_ANO_TRUE' => $conf_UAM[5]=='true' ? 'checked="checked"' : '' , 318 'UAM_NO_COMMENT_ANO_FALSE' => $conf_UAM[5]=='false' ? 'checked="checked"' : '' , 319 'UAM_MAILEXCLUSION_TRUE' => $conf_UAM[11]=='true' ? 'checked="checked"' : '' , 320 'UAM_MAILEXCLUSION_FALSE' => $conf_UAM[11]=='false' ? 'checked="checked"' : '' , 321 'UAM_MAILEXCLUSION_LIST' => $conf_UAM[12], 322 'UAM_PASSWORDENF_TRUE' => $conf_UAM[13]=='true' ? 'checked="checked"' : '' , 323 'UAM_PASSWORDENF_FALSE' => $conf_UAM[13]=='false' ? 'checked="checked"' : '' , 324 'UAM_PASSWORD_SCORE' => $conf_UAM[14], 325 'UAM_ADMINPASSWENF_TRUE' => $conf_UAM[15]=='true' ? 'checked="checked"' : '' , 326 'UAM_ADMINPASSWENF_FALSE' => $conf_UAM[15]=='false' ? 'checked="checked"' : '' , 327 'UAM_GHOSTRACKER_TRUE' => $conf_UAM[16]=='true' ? 'checked="checked"' : '' , 328 'UAM_GHOSTRACKER_FALSE' => $conf_UAM[16]=='false' ? 'checked="checked"' : '' , 329 'UAM_GHOSTRACKER_DAYLIMIT' => $conf_UAM[17], 330 'UAM_GHOSTRACKER_REMINDERTEXT' => $conf_UAM[18], 331 'UAM_ADDLASTVISIT_TRUE' => $conf_UAM[19]=='true' ? 'checked="checked"' : '' , 332 'UAM_ADDLASTVISIT_FALSE' => $conf_UAM[19]=='false' ? 'checked="checked"' : '' , 333 'UAM_ADMINCONFMAIL_TRUE' => $conf_UAM[20]=='true' ? 'checked="checked"' : '' , 334 'UAM_ADMINCONFMAIL_FALSE' => $conf_UAM[20]=='false' ? 'checked="checked"' : '' , 338 335 'UAM_PASSWORD_TEST_SCORE' => $UAM_Password_Test_Score, 339 336 'UAM_ERROR_REPORTS4' => $UAM_Exclusionlist_Error, … … 355 352 356 353 /* username insensible a la casse */ 357 if (isset($conf_UAM[ 3]) and $conf_UAM[3] == 'true')354 if (isset($conf_UAM[2]) and $conf_UAM[2] == 'true') 358 355 { 359 356 $query = " … … 379 376 380 377 /* Username without forbidden keys */ 381 if ( isset($conf_UAM[ 7]) and $conf_UAM[7] == 'true' )378 if ( isset($conf_UAM[6]) and $conf_UAM[6] == 'true' ) 382 379 { 383 380 $query = " … … 398 395 399 396 /* Email without forbidden domain */ 400 if ( isset($conf_UAM[1 2]) and $conf_UAM[12] == 'true' )397 if ( isset($conf_UAM[11]) and $conf_UAM[11] == 'true' ) 401 398 { 402 399 $query = " … … 409 406 while($row = pwg_db_fetch_assoc($result)) 410 407 { 411 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[1 3]);408 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[12]); 412 409 for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++) 413 410 { … … 467 464 $conf_UAM = unserialize($conf['UserAdvManager']); 468 465 469 if (isset($conf_UAM[ 20]) and $conf_UAM[20]=='true')466 if (isset($conf_UAM[19]) and $conf_UAM[19]=='true') 470 467 { 471 468 // +-----------------------------------------------------------------------+ … … 555 552 $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days 556 553 557 if (isset($conf_UAM[1 7]) and $conf_UAM[17]=='true' and $conf_UAM[18] <> '')554 if (isset($conf_UAM[16]) and $conf_UAM[16]=='true' and $conf_UAM[17] <> '') 558 555 { 559 if ($deltadays <= ($conf_UAM[1 8]/2))556 if ($deltadays <= ($conf_UAM[17]/2)) 560 557 { 561 558 $display = 'green'; 562 559 } 563 560 564 if (($deltadays > ($conf_UAM[1 8]/2)) and ($deltadays < $conf_UAM[18]))561 if (($deltadays > ($conf_UAM[17]/2)) and ($deltadays < $conf_UAM[17])) 565 562 { 566 563 $display = 'orange'; 567 564 } 568 565 569 if ($deltadays >= $conf_UAM[1 8])566 if ($deltadays >= $conf_UAM[17]) 570 567 { 571 568 $display = 'red'; … … 629 626 $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); 630 627 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')628 if (isset($conf_UAM[1]) and $conf_UAM[1]=='true' and ((isset($conf_UAM[2]) and $conf_UAM[2] <> '-1') or (isset($conf_UAM[8]) and $conf_UAM[8] <> '-1')) and isset($conf_UAM_ConfirmMail[0]) and $conf_UAM_ConfirmMail[0]=='true') 632 629 { 633 630 // +-----------------------------------------------------------------------+ … … 1181 1178 $conf_UAM = unserialize($conf['UserAdvManager']); 1182 1179 1183 if (isset($conf_UAM[1 7]) and $conf_UAM[17]=='true')1180 if (isset($conf_UAM[16]) and $conf_UAM[16]=='true') 1184 1181 { 1185 1182 // +-----------------------------------------------------------------------+ -
extensions/NBC_UserAdvManager/trunk/admin/template/global.tpl
r5716 r6354 69 69 <fieldset> 70 70 <ul> 71 <li>72 <label class="cluetip" title="{'UAM_casenTitle'|translate}|{'UAM_casenTitle_d'|translate}">73 {'UAM_No_Casse'|@translate}74 </label>75 <br><br>76 <input type="radio" value="false" {$UAM_NO_CASSE_FALSE} name="UAM_No_Casse">77 {'UAM_No_Casse_false'|@translate}<br>78 <input type="radio" value="true" {$UAM_NO_CASSE_TRUE} name="UAM_No_Casse">79 {'UAM_No_Casse_true'|@translate}<br><br>80 </li>81 82 71 <li> 83 72 <label class="cluetip" title="{'UAM_carexcTitle'|translate}|{'UAM_carexcTitle_d'|translate}"> -
extensions/NBC_UserAdvManager/trunk/include/functions.inc.php
r5633 r6354 45 45 $password = $password <> '' ? $password : l10n('UAM_empty_pwd'); 46 46 47 if (isset($conf_UAM[ 10]) and $conf_UAM[10] <> '')47 if (isset($conf_UAM[9]) and $conf_UAM[9] <> '') 48 48 { 49 49 if (function_exists('get_user_language_desc')) 50 50 { 51 $infos1_perso = get_user_language_desc($conf_UAM[ 10])."\n\n";51 $infos1_perso = get_user_language_desc($conf_UAM[9])."\n\n"; 52 52 } 53 else $infos1_perso = l10n($conf_UAM[ 10])."\n\n";53 else $infos1_perso = l10n($conf_UAM[9])."\n\n"; 54 54 } 55 55 … … 81 81 82 82 83 if ( isset($conf_UAM[ 2]) and $conf_UAM[2] == 'true' and $confirm)83 if ( isset($conf_UAM[1]) and $conf_UAM[1] == 'true' and $confirm) 84 84 { 85 85 $infos2 = array … … 89 89 ); 90 90 91 if (isset($conf_UAM[1 1]) and $conf_UAM[11] <> '')91 if (isset($conf_UAM[10]) and $conf_UAM[10] <> '') 92 92 { 93 93 if (function_exists('get_user_language_desc')) 94 94 { 95 $infos2_perso = get_user_language_desc($conf_UAM[1 1])."\n\n";95 $infos2_perso = get_user_language_desc($conf_UAM[10])."\n\n"; 96 96 } 97 else $infos2_perso = l10n($conf_UAM[1 1])."\n\n";97 else $infos2_perso = l10n($conf_UAM[10])."\n\n"; 98 98 } 99 99 } … … 275 275 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Ghost_reminder_of_%s', $username)); 276 276 277 if (isset($conf_UAM[1 9]) and $conf_UAM[19] <> '' and isset($conf_UAM[17]) and $conf_UAM[17] == 'true')277 if (isset($conf_UAM[18]) and $conf_UAM[18] <> '' and isset($conf_UAM[16]) and $conf_UAM[16] == 'true') 278 278 { 279 279 if (function_exists('get_user_language_desc')) 280 280 { 281 $infos1 = get_user_language_desc($conf_UAM[1 9])."\n\n";281 $infos1 = get_user_language_desc($conf_UAM[18])."\n\n"; 282 282 } 283 283 else 284 284 { 285 $infos1 = l10n($conf_UAM[1 9])."\n\n";285 $infos1 = l10n($conf_UAM[18])."\n\n"; 286 286 } 287 287 … … 359 359 WHERE user_id = '".$user_id."' 360 360 AND ( 361 group_id = '".$conf_UAM[2]."' 362 OR 361 363 group_id = '".$conf_UAM[3]."' 362 OR363 group_id = '".$conf_UAM[4]."'364 364 ) 365 365 ;"; 366 366 pwg_query($query); 367 367 368 if (!is_admin() and $conf_UAM[ 9] <> -1)368 if (!is_admin() and $conf_UAM[8] <> -1) 369 369 { 370 370 $query = " 371 371 UPDATE ".USER_INFOS_TABLE." 372 SET status = '".$conf_UAM[ 9]."'372 SET status = '".$conf_UAM[8]."' 373 373 WHERE user_id = '".$user_id."' 374 374 ;"; … … 376 376 } 377 377 378 if ( $conf_UAM[ 3] <> -1 )378 if ( $conf_UAM[2] <> -1 ) 379 379 { 380 380 $query = " … … 382 382 (user_id, group_id) 383 383 VALUES 384 ('".$user_id."', '".$conf_UAM[ 3]."')384 ('".$user_id."', '".$conf_UAM[2]."') 385 385 ;"; 386 386 pwg_query($query); … … 525 525 pwg_query($query); 526 526 527 if ($conf_UAM[ 3] <> -1) // Delete user from unvalidated users group527 if ($conf_UAM[2] <> -1) // Delete user from unvalidated users group 528 528 { 529 529 $query = " 530 530 DELETE FROM ".USER_GROUP_TABLE." 531 531 WHERE user_id = '".$data['user_id']."' 532 AND group_id = '".$conf_UAM[ 3]."'532 AND group_id = '".$conf_UAM[2]."' 533 533 ;"; 534 534 pwg_query($query); 535 535 } 536 536 537 if ($conf_UAM[ 4] <> -1) // Add user to validated users group537 if ($conf_UAM[3] <> -1) // Add user to validated users group 538 538 { 539 539 $query = " … … 541 541 (user_id, group_id) 542 542 VALUES 543 ('".$data['user_id']."', '".$conf_UAM[ 4]."')543 ('".$data['user_id']."', '".$conf_UAM[3]."') 544 544 ;"; 545 545 pwg_query($query); 546 546 } 547 547 548 if (($conf_UAM[ 5] <> -1 or isset($data['status']))) // Change user's status548 if (($conf_UAM[4] <> -1 or isset($data['status']))) // Change user's status 549 549 { 550 550 $query = " 551 551 UPDATE ".USER_INFOS_TABLE." 552 SET status = '".(isset($data['status']) ? $data['status'] : $conf_UAM[ 5])."'552 SET status = '".(isset($data['status']) ? $data['status'] : $conf_UAM[4])."' 553 553 WHERE user_id = '".$data['user_id']."' 554 554 ;"; … … 577 577 pwg_query($query); 578 578 579 if ($conf_UAM[2] <> -1) 580 { 581 $query = " 582 DELETE FROM ".USER_GROUP_TABLE." 583 WHERE user_id = '".$data['user_id']."' 584 AND group_id = '".$conf_UAM[2]."' 585 ;"; 586 pwg_query($query); 587 } 588 579 589 if ($conf_UAM[3] <> -1) 580 590 { … … 585 595 ;"; 586 596 pwg_query($query); 587 }588 589 if ($conf_UAM[4] <> -1)590 {591 $query = "592 DELETE FROM ".USER_GROUP_TABLE."593 WHERE user_id = '".$data['user_id']."'594 AND group_id = '".$conf_UAM[4]."'595 ;";596 pwg_query($query);597 597 598 598 $query = " … … 600 600 (user_id, group_id) 601 601 VALUES 602 ('".$data['user_id']."', '".$conf_UAM[ 4]."')602 ('".$data['user_id']."', '".$conf_UAM[3]."') 603 603 ;"; 604 604 pwg_query($query); 605 605 } 606 606 607 if (($conf_UAM[ 5] <> -1 or isset($data['status'])))607 if (($conf_UAM[4] <> -1 or isset($data['status']))) 608 608 { 609 609 $query = " 610 610 UPDATE ".USER_INFOS_TABLE." 611 SET status = '".(isset($data['status']) ? $data['status'] : $conf_UAM[ 5])."'611 SET status = '".(isset($data['status']) ? $data['status'] : $conf_UAM[4])."' 612 612 WHERE user_id = '".$data['user_id']."' 613 613 ;"; … … 662 662 pwg_query($query); 663 663 664 if ($conf_UAM[2] <> -1) 665 { 666 $query = " 667 DELETE FROM ".USER_GROUP_TABLE." 668 WHERE user_id = '".$data['user_id']."' 669 AND group_id = '".$conf_UAM[2]."' 670 ;"; 671 pwg_query($query); 672 } 673 664 674 if ($conf_UAM[3] <> -1) 665 675 { … … 668 678 WHERE user_id = '".$data['user_id']."' 669 679 AND group_id = '".$conf_UAM[3]."' 670 ;";671 pwg_query($query);672 }673 674 if ($conf_UAM[4] <> -1)675 {676 $query = "677 DELETE FROM ".USER_GROUP_TABLE."678 WHERE user_id = '".$data['user_id']."'679 AND group_id = '".$conf_UAM[4]."'680 680 ;"; 681 681 pwg_query($query); … … 685 685 (user_id, group_id) 686 686 VALUES 687 ('".$data['user_id']."', '".$conf_UAM[ 4]."')687 ('".$data['user_id']."', '".$conf_UAM[3]."') 688 688 ;"; 689 689 pwg_query($query); 690 690 } 691 691 692 if (($conf_UAM[ 5] <> -1 or isset($data['status'])))692 if (($conf_UAM[4] <> -1 or isset($data['status']))) 693 693 { 694 694 $query = " 695 695 UPDATE ".USER_INFOS_TABLE." 696 SET status = '".(isset($data['status']) ? $data['status'] : $conf_UAM[ 5])."'696 SET status = '".(isset($data['status']) ? $data['status'] : $conf_UAM[4])."' 697 697 WHERE user_id = '".$data['user_id']."' 698 698 ;"; … … 706 706 } 707 707 708 /* Function called from main.inc.php - Get username case insensitive */709 function NotSensibleSearchUsername($username)710 {711 global $conf;712 713 if (isset($username))714 {715 $query = "716 SELECT ".$conf['user_fields']['username']."717 FROM ".USERS_TABLE."718 WHERE LOWER(".stripslashes($conf['user_fields']['username']).") = '".strtolower($username)."'719 ;";720 $users = pwg_db_num_rows(pwg_query($query));721 if ($users > 0)722 {723 return true;724 }725 else726 {727 return false;728 }729 }730 }731 732 708 733 709 /* Function called from main.inc.php - Check if username matches forbidden caracters */ … … 738 714 $conf_UAM = unserialize($conf['UserAdvManager']); 739 715 740 if (isset($login) and isset($conf_UAM[ 8]) and $conf_UAM[8] <> '')741 { 742 $conf_CharExclusion = preg_split("/,/",$conf_UAM[ 8]);716 if (isset($login) and isset($conf_UAM[7]) and $conf_UAM[7] <> '') 717 { 718 $conf_CharExclusion = preg_split("/,/",$conf_UAM[7]); 743 719 for ($i = 0 ; $i < count($conf_CharExclusion) ; $i++) 744 720 { … … 765 741 $conf_UAM = unserialize($conf['UserAdvManager']); 766 742 767 if (isset($email) and isset($conf_UAM[1 3]) and $conf_UAM[13] <> '')743 if (isset($email) and isset($conf_UAM[12]) and $conf_UAM[12] <> '') 768 744 { 769 745 //$ncsemail = strtolower($email); 770 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[1 3]);746 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[12]); 771 747 for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++) 772 748 { … … 816 792 OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_UAM_ConfirmMail[1].'")'; 817 793 818 if ($conf_UAM[ 3] <> '-1' and $conf_UAM[9] == '-1')794 if ($conf_UAM[2] <> '-1' and $conf_UAM[8] == '-1') 819 795 { 820 796 $query.= ' 821 AND ug.group_id = '.$conf_UAM[ 3];822 } 823 if ($conf_UAM[ 3] == '-1' and $conf_UAM[9] <> '-1')797 AND ug.group_id = '.$conf_UAM[2]; 798 } 799 if ($conf_UAM[2] == '-1' and $conf_UAM[8] <> '-1') 824 800 { 825 801 $query.= ' 826 AND ui.status = \''.$conf_UAM[ 9]."'";827 } 828 if ($conf_UAM[ 3] <> '-1' and $conf_UAM[9] <> '-1')802 AND ui.status = \''.$conf_UAM[8]."'"; 803 } 804 if ($conf_UAM[2] <> '-1' and $conf_UAM[8] <> '-1') 829 805 { 830 806 $query.= ' 831 AND ug.group_id = \''.$conf_UAM[ 3]."'";807 AND ug.group_id = \''.$conf_UAM[2]."'"; 832 808 } 833 809 $query.= ' … … 896 872 INNER JOIN '.USER_LASTVISIT_TABLE.' AS lv 897 873 ON u.'.$conf['user_fields']['id'].' = lv.user_id 898 WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[1 8].'")874 WHERE (TO_DAYS(NOW()) - TO_DAYS(lv.lastvisit) >= "'.$conf_UAM[17].'") 899 875 ORDER BY id ASC;'; 900 876 -
extensions/NBC_UserAdvManager/trunk/include/upgradedb.inc.php
r6255 r6354 204 204 205 205 pwg_query($query); 206 207 upgrade_2153_2154(); 208 } 209 210 /* upgrade from branch 2.15.3 to 2.15.4 */ 211 /* ************************************ */ 212 function upgrade_2153_2154() 213 { 214 global $conf; 215 216 /* Upgrading options */ 217 $query = ' 218 SELECT value 219 FROM '.CONFIG_TABLE.' 220 WHERE param = "UserAdvManager" 221 ;'; 222 223 $result = pwg_query($query); 224 $conf_UAM = pwg_db_fetch_assoc($result); 225 226 $Newconf_UAM = unserialize($conf_UAM['value']); 227 228 $Newconf_UAM[0] = $Newconf_UAM[0]; 229 $Newconf_UAM[1] = $Newconf_UAM[2]; 230 $Newconf_UAM[2] = $Newconf_UAM[3]; 231 $Newconf_UAM[3] = $Newconf_UAM[4]; 232 $Newconf_UAM[4] = $Newconf_UAM[5]; 233 $Newconf_UAM[5] = $Newconf_UAM[6]; 234 $Newconf_UAM[6] = $Newconf_UAM[7]; 235 $Newconf_UAM[7] = $Newconf_UAM[8]; 236 $Newconf_UAM[8] = $Newconf_UAM[9]; 237 $Newconf_UAM[9] = $Newconf_UAM[10]; 238 $Newconf_UAM[10] = $Newconf_UAM[11]; 239 $Newconf_UAM[11] = $Newconf_UAM[12]; 240 $Newconf_UAM[12] = $Newconf_UAM[13]; 241 $Newconf_UAM[13] = $Newconf_UAM[14]; 242 $Newconf_UAM[14] = $Newconf_UAM[15]; 243 $Newconf_UAM[15] = $Newconf_UAM[16]; 244 $Newconf_UAM[16] = $Newconf_UAM[17]; 245 $Newconf_UAM[17] = $Newconf_UAM[18]; 246 $Newconf_UAM[18] = $Newconf_UAM[19]; 247 $Newconf_UAM[19] = $Newconf_UAM[20]; 248 $Newconf_UAM[20] = $Newconf_UAM[21]; 249 unset($Newconf_UAM[21]); 250 251 $update_conf = serialize($Newconf_UAM); 252 253 $query = ' 254 UPDATE '.CONFIG_TABLE.' 255 SET value="'.addslashes($update_conf).'" 256 WHERE param="UserAdvManager" 257 LIMIT 1 258 ;'; 259 260 pwg_query($query); 206 261 } 207 262 ?> -
extensions/NBC_UserAdvManager/trunk/main.inc.php
r6255 r6354 80 80 if (!is_admin() and !is_a_guest()) 81 81 { 82 if ((isset($conf_UAM[1 7]) and $conf_UAM[17] == 'true') or (isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))82 if ((isset($conf_UAM[16]) and $conf_UAM[16] == 'true') or (isset($conf_UAM[19]) and $conf_UAM[19] == 'true')) 83 83 { 84 84 … … 129 129 130 130 /* Sending registration confirmation by email */ 131 if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[ 2]) and $conf_UAM[2] == 'true'))132 { 133 if (is_admin() and isset($conf_UAM[2 1]) and $conf_UAM[21] == 'true')131 if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'true')) 132 { 133 if (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'true') 134 134 { 135 135 $passwd = (isset($_POST['password'])) ? $_POST['password'] : ''; 136 136 SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true); 137 137 } 138 elseif (is_admin() and isset($conf_UAM[2 1]) and $conf_UAM[21] == 'false')138 elseif (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'false') 139 139 { 140 140 $passwd = (isset($_POST['password'])) ? $_POST['password'] : ''; … … 253 253 254 254 /* Password enforcement control */ 255 if (isset($conf_UAM[1 4]) and $conf_UAM[14] == 'true' and !empty($conf_UAM[15]))255 if (isset($conf_UAM[13]) and $conf_UAM[13] == 'true' and !empty($conf_UAM[14])) 256 256 { 257 257 if (!empty($user['password']) and !is_admin()) … … 259 259 $PasswordCheck = testpassword($user['password']); 260 260 261 if ($PasswordCheck < $conf_UAM[1 5])261 if ($PasswordCheck < $conf_UAM[14]) 262 262 { 263 263 $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck); 264 return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[1 5]);265 } 266 } 267 else if (!empty($user['password']) and is_admin() and isset($conf_UAM[1 6]) and $conf_UAM[16] == 'true')264 return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]); 265 } 266 } 267 else if (!empty($user['password']) and is_admin() and isset($conf_UAM[15]) and $conf_UAM[15] == 'true') 268 268 { 269 269 $PasswordCheck = testpassword($user['password']); 270 270 271 if ($PasswordCheck < $conf_UAM[1 5])271 if ($PasswordCheck < $conf_UAM[14]) 272 272 { 273 273 $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck); 274 return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[15]); 275 } 276 } 277 } 278 279 /* Username non case sensitive */ 280 if (isset($conf_UAM[1]) and $conf_UAM[1] == 'true' and NotSensibleSearchUsername($_POST['login'])) 281 { 282 return($lang['reg_err_login5'] = l10n('reg_err_login5')); 274 return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]); 275 } 276 } 283 277 } 284 278 285 279 /* Username without forbidden keys */ 286 if (isset($conf_UAM[ 7]) and $conf_UAM[7] == 'true' and !empty($_POST['login']) and ValidateUsername($_POST['login']) and !is_admin())280 if (isset($conf_UAM[6]) and $conf_UAM[6] == 'true' and !empty($_POST['login']) and ValidateUsername($_POST['login']) and !is_admin()) 287 281 { 288 282 $_POST['login'] = ''; 289 return($lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_UAM[ 8]."'");283 return($lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_UAM[7]."'"); 290 284 } 291 285 292 286 /* Email without forbidden domains */ 293 if (isset($conf_UAM[1 2]) and $conf_UAM[12] == 'true' and !empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']) and !is_admin())287 if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']) and !is_admin()) 294 288 { 295 289 $_POST['mail_address'] = ''; 296 return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_UAM[1 3]."'");290 return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_UAM[12]."'"); 297 291 } 298 292 } … … 312 306 { 313 307 /* Email without forbidden domains */ 314 if (isset($conf_UAM[1 2]) and $conf_UAM[12] == 'true' and !empty($_POST['mail_address']))308 if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['mail_address'])) 315 309 { 316 310 if (ValidateEmailProvider($_POST['mail_address'])) 317 311 { 318 $template->append('errors', l10n('reg_err_login7')."'".$conf_UAM[1 3]."'");312 $template->append('errors', l10n('reg_err_login7')."'".$conf_UAM[12]."'"); 319 313 unset($_POST['validate']); 320 314 } … … 328 322 329 323 /* Password enforcement control */ 330 if (isset($conf_UAM[1 4]) and $conf_UAM[14] == 'true' and !empty($conf_UAM[15]))324 if (isset($conf_UAM[13]) and $conf_UAM[13] == 'true' and !empty($conf_UAM[14])) 331 325 { 332 326 $PasswordCheck = testpassword($_POST['use_new_pwd']); 333 327 334 if ($PasswordCheck < $conf_UAM[1 5])328 if ($PasswordCheck < $conf_UAM[14]) 335 329 { 336 330 $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck); 337 $template->append('errors', l10n_args($message).$conf_UAM[1 5]);331 $template->append('errors', l10n_args($message).$conf_UAM[14]); 338 332 unset($_POST['use_new_pwd']); 339 333 unset($_POST['validate']); … … 343 337 344 338 /* Sending registration confirmation by email */ 345 if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[ 2]) and $conf_UAM[2] == 'true'))339 if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'true')) 346 340 { 347 341 $confirm_mail_need = false; … … 357 351 list($current_email) = pwg_db_fetch_row(pwg_query($query)); 358 352 359 if ($_POST['mail_address'] != $current_email and ( isset($conf_UAM[ 2]) and $conf_UAM[2] == 'true'))353 if ($_POST['mail_address'] != $current_email and ( isset($conf_UAM[1]) and $conf_UAM[1] == 'true')) 360 354 361 355 $confirm_mail_need = true; … … 395 389 { 396 390 /* Email without forbidden domains */ 397 if (isset($conf_UAM[1 2]) and $conf_UAM[12] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email']))398 { 399 $template->append('errors', l10n('reg_err_login7')."'".$conf_UAM[1 3]."'");391 if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email'])) 392 { 393 $template->append('errors', l10n('reg_err_login7')."'".$conf_UAM[12]."'"); 400 394 unset($_POST['submit_add']); 401 395 } … … 415 409 416 410 /* User creation OR update */ 417 if (isset($conf_UAM[ 6]) and $conf_UAM[6] == 'true' and $conf['comments_forall'] == 'true' and $comm['author'] == 'guest')411 if (isset($conf_UAM[5]) and $conf_UAM[5] == 'true' and $conf['comments_forall'] == 'true' and $comm['author'] == 'guest') 418 412 { 419 413 $comment_action = 'reject'; -
extensions/NBC_UserAdvManager/trunk/maintain.inc.php
r6255 r6354 163 163 /* ****************************** */ 164 164 // In preparation of next releases 165 /*$query = '165 $query = ' 166 166 SELECT param 167 167 FROM '.CONFIG_TABLE.' … … 172 172 if ($count == 2) 173 173 { 174 upgrade_2151_2152(); 175 } 176 */ 174 $query = ' 175 SELECT value 176 FROM '.CONFIG_TABLE.' 177 WHERE param = "UserAdvManager" 178 ;'; 179 180 $result = pwg_query($query); 181 $conf = pwg_db_fetch_assoc($result); 182 183 $conf_UAM = unserialize($conf['value']); 184 $Nb_values = count($conf_UAM); 185 if ($Nb_values = 22) 186 { 187 upgrade_2153_2154(); 188 } 189 } 190 177 191 load_conf_from_db('param like \'UserAdvManager\\_%\''); 178 192 }
Note: See TracChangeset
for help on using the changeset viewer.