- Timestamp:
- May 25, 2010, 6:11:02 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.