Changeset 18160 for extensions/UserAdvManager
- Timestamp:
- Sep 22, 2012, 5:39:31 PM (12 years ago)
- Location:
- extensions/UserAdvManager/branches/2.40
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserAdvManager/branches/2.40/ConfirmMail.php
r14730 r18160 39 39 { 40 40 $status = true; 41 42 41 log_user($userid, false); 43 42 if (isset($conf_UAM[1]) and $conf_UAM[1] == 'local') 43 { 44 validation_mail($userid); 45 } 44 46 // We have to get the user's language in database 45 47 // ---------------------------------------------- … … 119 121 'REDIRECT' => $redirect, 120 122 'STATUS' => $status, 121 'CONFIRM_MAIL_MESSAGE' => $custom_text,123 'CONFIRM_MAIL_MESSAGE' => $custom_text, 122 124 ) 123 125 ); -
extensions/UserAdvManager/branches/2.40/admin/UAM_admin.php
r14730 r18160 46 46 $page['tab'] = 'global'; 47 47 else 48 48 $page['tab'] = $_GET['tab']; 49 49 50 50 $tabsheet = new tabsheet(); … … 52 52 l10n('UAM_Tab_Global'), 53 53 $my_base_url.'&tab=global'); 54 55 56 54 $tabsheet->add('userlist', 55 l10n('UAM_Tracking registered users'), 56 $my_base_url.'&tab=userlist'); 57 57 $tabsheet->add('usermanager', 58 58 l10n('UAM_Tracking confirmations'), … … 83 83 if (function_exists('set_fckeditor_instance')) 84 84 { 85 85 $fcke_config = unserialize($conf['FCKEditor']); 86 86 foreach($areas as $area) 87 87 { 88 88 if (!isset($fcke_config[$area])) 89 89 { 90 90 $fcke_config[$area] = false; 91 91 } 92 92 } 93 94 95 93 $conf['FCKEditor'] = serialize($fcke_config); 94 95 set_fckeditor_instance($areas, $toolbar, $width, $height); 96 96 } 97 97 … … 108 108 // +-----------------------------------------------------------------------+ 109 109 // ************************************************************************* 110 111 112 if (isset($_POST['submit']) and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) 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']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']) and isset($_POST['UAM_PwdReset']) and isset($_POST['UAM_RejectConnexion']))113 110 case 'global': 111 112 if (isset($_POST['submit']) and isset($_POST['UAM_Mail_Info']) and isset($_POST['UAM_Username_Char']) and isset($_POST['UAM_Confirm_Mail']) 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']) and isset($_POST['UAM_GTAuto']) and isset($_POST['UAM_GTAutoMail']) and isset($_POST['UAM_CustomPasswRetr']) and isset($_POST['UAM_USRAuto']) and isset($_POST['UAM_USRAutoMail']) and isset($_POST['UAM_Stuffs']) and isset($_POST['UAM_HidePassw']) and isset($_POST['UAM_PwdReset']) and isset($_POST['UAM_RejectConnexion'])) 113 { 114 114 115 115 // Render email contents fields 116 116 // ---------------------------- 117 $_POST['UAM_MailInfo_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_MailInfo_Text'])));118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 117 $_POST['UAM_MailInfo_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_MailInfo_Text']))); 118 119 $_POST['UAM_ConfirmMail_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Text']))); 120 121 $_POST['UAM_GhostTracker_ReminderText'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_GhostTracker_ReminderText']))); 122 123 $_POST['UAM_GTAutoDelText'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_GTAutoDelText']))); 124 125 $_POST['UAM_GTAutoMailText'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_GTAutoMailText']))); 126 127 $_POST['UAM_AdminValidationMail_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_AdminValidationMail_Text']))); 128 129 $_POST['UAM_CustomPasswRetr_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_CustomPasswRetr_Text']))); 130 131 $_POST['UAM_USRAutoDelText'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_GTAutoDelText']))); 132 133 $_POST['UAM_CustomRejectConnexion_Text'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_CustomRejectConnexion_Text']))); 134 135 // Render email subjects fields 136 136 // --------------------------- 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 // --------------------------------------------------------------------------------------156 if (preg_match('/^[\s]+/', $_POST['UAM_MailExclusion_List']))157 {158 array_push($page['errors'], l10n('UAM_mail_exclusionlist_error'));159 $UAM_Exclusionlist_Error = true;160 }161 }162 elseif (!$conf['obligatory_user_mail_address'])163 {164 $_POST['UAM_MailExclusion_List'] = '';165 }137 $_POST['UAM_ConfirmMail_Subject'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Subject']))); 138 139 $_POST['UAM_ConfirmMail_Remail_Subject'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Remail_Subject']))); 140 141 $_POST['UAM_InfoMail_Subject'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_InfoMail_Subject']))); 142 143 $_POST['UAM_GTAutoMail_Subject'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_GTAutoMail_Subject']))); 144 145 $_POST['UAM_GTReminder_Subject'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_GTReminder_Subject']))); 146 147 $_POST['UAM_AdminValidationMail_Subject'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_AdminValidationMail_Subject']))); 148 149 150 // Check if emails are mandatory for registrations (needed for email exclusion option) 151 // ----------------------------------------------------------------------------------- 152 if ($conf['obligatory_user_mail_address']) 153 { 154 // Check if CR-LF exist at begining and end of mail exclusion list - If yes, removes them 155 // -------------------------------------------------------------------------------------- 156 if (preg_match('/^[\s]+/', $_POST['UAM_MailExclusion_List'])) 157 { 158 array_push($page['errors'], l10n('UAM_mail_exclusionlist_error')); 159 $UAM_Exclusionlist_Error = true; 160 } 161 } 162 elseif (!$conf['obligatory_user_mail_address']) 163 { 164 $_POST['UAM_MailExclusion_List'] = ''; 165 } 166 166 167 167 // Consistency check between ConfirmMail and AutoMail - We cannot use GTAutoMail if ConfirmMail is disabled … … 172 172 if (((isset($conf_UAM['1']) and ($conf_UAM['1'] == 'false' or $conf_UAM['1'] == 'local')) or ($_POST['UAM_Confirm_Mail'] == 'false' or $_POST['UAM_Confirm_Mail'] == 'local')) and $_POST['UAM_GTAutoMail'] == 'true') 173 173 { 174 174 $newvalue = 'false'; 175 175 $_POST['UAM_GTAutoMail'] = $newvalue; 176 176 array_push($page['errors'], l10n('UAM_Error_GTAutoMail_cannot_be_set_without_ConfirmMail')); … … 187 187 // Save global UAM configuration 188 188 // ----------------------------- 189 $newconf_UAM = array(190 189 $newconf_UAM = array( 190 $_POST['UAM_Mail_Info'], 191 191 $_POST['UAM_Confirm_Mail'], 192 192 (isset($_POST['UAM_No_Confirm_Group'])?$_POST['UAM_No_Confirm_Group']:''), … … 246 246 247 247 $_POST['UAM_ConfirmMail_ReMail_Txt2'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_ReMail_Txt2']))); 248 248 249 249 $_POST['UAM_ConfirmMail_Custom_Txt1'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Custom_Txt1']))); 250 250 251 251 $_POST['UAM_ConfirmMail_Custom_Txt2'] = str_replace('\"', '"', str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UAM_ConfirmMail_Custom_Txt2']))); 252 252 … … 266 266 // Save ConfirmMail settings 267 267 // ------------------------- 268 $newconf_UAM_ConfirmMail = array (268 $newconf_UAM_ConfirmMail = array ( 269 269 $_POST['UAM_ConfirmMail_TimeOut'], 270 270 $_POST['UAM_ConfirmMail_Delay'], … … 279 279 conf_update_param('UserAdvManager_ConfirmMail', pwg_db_real_escape_string($conf['UserAdvManager_ConfirmMail'])); 280 280 281 array_push($page['infos'], l10n('UAM_save_config'));281 array_push($page['infos'], l10n('UAM_save_config')); 282 282 } 283 283 … … 352 352 $query = ' 353 353 SELECT id, name 354 FROM '.GROUPS_TABLE.'354 FROM '.GROUPS_TABLE.' 355 355 ORDER BY name ASC 356 356 ;'; … … 364 364 if (isset($conf_UAM[2]) and $conf_UAM[2] == $row['id']) 365 365 { 366 $No_Valid = $row['id'];367 }366 $No_Valid = $row['id']; 367 } 368 368 //configuration value for validated users 369 369 if (isset($conf_UAM[3]) and $conf_UAM[3] == $row['id']) 370 {371 $Valid = $row['id'];372 }370 { 371 $Valid = $row['id']; 372 } 373 373 //configuration value for downgrade users 374 374 if (isset($conf_UAM[25]) and $conf_UAM[25] == $row['id']) 375 {376 $Downgrade = $row['id'];377 }375 { 376 $Downgrade = $row['id']; 377 } 378 378 } 379 379 … … 381 381 // --------------------------------------------------- 382 382 $template->assign( 383 384 array(385 'group_options'=> $groups,386 'group_selected' => $No_Valid387 )383 'No_Confirm_Group', 384 array( 385 'group_options'=> $groups, 386 'group_selected' => $No_Valid 387 ) 388 388 ); 389 389 … … 391 391 // ------------------------------------------------- 392 392 $template->assign( 393 394 array(395 'group_options'=> $groups,396 'group_selected' => $Valid397 )393 'Validated_Group', 394 array( 395 'group_options'=> $groups, 396 'group_selected' => $Valid 397 ) 398 398 ); 399 399 … … 402 402 $template->assign( 403 403 'Downgrade_Group', 404 array(405 'group_options'=> $groups,406 'group_selected' => $Downgrade407 )404 array( 405 'group_options'=> $groups, 406 'group_selected' => $Downgrade 407 ) 408 408 ); 409 409 … … 428 428 // ---------------------------------------------------- 429 429 $template->assign( 430 431 432 'Status_options' => $status_options,433 'Status_selected' => $No_Valid_Status434 )435 );430 'No_Confirm_Status', 431 array( 432 'Status_options' => $status_options, 433 'Status_selected' => $No_Valid_Status 434 ) 435 ); 436 436 } 437 437 … … 439 439 // -------------------------- 440 440 foreach (get_enums(USER_INFOS_TABLE, 'status') as $status) 441 {442 $status_options[$status] = l10n('user_status_'.$status);443 if (isset($conf_UAM[4]) and $conf_UAM[4] == $status)444 441 { 445 $Valid_Status = $status; 446 } 442 $status_options[$status] = l10n('user_status_'.$status); 443 if (isset($conf_UAM[4]) and $conf_UAM[4] == $status) 444 { 445 $Valid_Status = $status; 446 } 447 447 448 448 // Template initialization for validated users status 449 449 // -------------------------------------------------- 450 450 $template->assign( 451 452 array(453 'Status_options' => $status_options,454 'Status_selected' => $Valid_Status455 )456 457 }451 'Confirm_Status', 452 array( 453 'Status_options' => $status_options, 454 'Status_selected' => $Valid_Status 455 ) 456 ); 457 } 458 458 459 459 // Get downgrade status values … … 461 461 foreach (get_enums(USER_INFOS_TABLE, 'status') as $status) 462 462 { 463 464 465 {466 $Downgrade_Status = $status;467 }463 $status_options[$status] = l10n('user_status_'.$status); 464 if (isset($conf_UAM[26]) and $conf_UAM[26] == $status) 465 { 466 $Downgrade_Status = $status; 467 } 468 468 469 469 // Template initialization for validated users status 470 470 // -------------------------------------------------- 471 471 $template->assign( 472 473 474 475 476 477 478 }472 'Downgrade_Status', 473 array( 474 'Status_options' => $status_options, 475 'Status_selected' => $Downgrade_Status 476 ) 477 ); 478 } 479 479 480 480 … … 490 490 foreach ($conf['available_permission_levels'] as $level) 491 491 { 492 493 494 495 496 492 $level_options[$level] = l10n(sprintf('Level %d', $level)); 493 if (isset($conf_UAM[35]) and $conf_UAM[35] == $level) 494 { 495 $No_Valid_Level = $level; 496 } 497 497 498 498 // Template initialization for unvalidated users level 499 499 // --------------------------------------------------- 500 500 $template->assign( 501 502 503 504 505 )506 501 'No_Valid_Level', 502 array( 503 'Level_options' => $level_options, 504 'Level_selected' => $No_Valid_Level 505 ) 506 ); 507 507 } 508 508 … … 511 511 foreach ($conf['available_permission_levels'] as $level) 512 512 { 513 514 515 516 517 513 $level_options[$level] = l10n(sprintf('Level %d', $level)); 514 if (isset($conf_UAM[36]) and $conf_UAM[36] == $level) 515 { 516 $Valid_Level = $level; 517 } 518 518 519 519 // Template initialization for unvalidated users level 520 520 // --------------------------------------------------- 521 521 $template->assign( 522 523 524 525 526 )527 522 'Valid_Level', 523 array( 524 'Level_options' => $level_options, 525 'Level_selected' => $Valid_Level 526 ) 527 ); 528 528 } 529 529 … … 532 532 foreach ($conf['available_permission_levels'] as $level) 533 533 { 534 535 536 537 538 534 $level_options[$level] = l10n(sprintf('Level %d', $level)); 535 if (isset($conf_UAM[37]) and $conf_UAM[37] == $level) 536 { 537 $Downgrade_Level = $level; 538 } 539 539 540 540 // Template initialization for unvalidated users level 541 541 // --------------------------------------------------- 542 542 $template->assign( 543 544 545 546 547 )548 543 'Downgrade_Level', 544 array( 545 'Level_options' => $level_options, 546 'Level_selected' => $Downgrade_Level 547 ) 548 ); 549 549 } 550 550 … … 570 570 571 571 $template->assign( 572 573 574 'nb_para2' => $nb_para2,575 'UAM_VERSION' => $version,576 'UAM_PATH' => UAM_PATH,577 'UAM_DUMP_DOWNLOAD' => $dump_download,578 'UAM_THEME' => $UAM_theme,579 'UAM_MAIL_INFO_TRUE' => $conf_UAM[0]=='true' ? 'checked="checked"' : '' ,580 'UAM_MAIL_INFO_FALSE' => $conf_UAM[0]=='false' ? 'checked="checked"' : '' ,581 'UAM_MAILINFO_TEXT' => $conf_UAM[8],582 'UAM_USERNAME_CHAR_TRUE' => $conf_UAM[5]=='true' ? 'checked="checked"' : '' ,583 'UAM_USERNAME_CHAR_FALSE' => $conf_UAM[5]=='false' ? 'checked="checked"' : '' ,584 'UAM_USERNAME_CHAR_LIST' => $conf_UAM[6],585 'UAM_CONFIRM_MAIL_TRUE' => $conf_UAM[1]=='true' ? 'checked="checked"' : '' ,586 'UAM_CONFIRM_MAIL_FALSE' => $conf_UAM[1]=='false' ? 'checked="checked"' : '' ,587 588 'UAM_CONFIRMMAIL_TEXT' => $conf_UAM[9],589 'UAM_No_Confirm_Group' => $conf_UAM[2],590 'UAM_Validated_Group' => $conf_UAM[3],591 'UAM_No_Confirm_Status' => $conf_UAM[7],592 'UAM_Validated_Status' => $conf_UAM[4],593 'UAM_MAILEXCLUSION_TRUE' => $conf_UAM[10]=='true' ? 'checked="checked"' : '' ,594 'UAM_MAILEXCLUSION_FALSE' => $conf_UAM[10]=='false' ? 'checked="checked"' : '' ,595 'UAM_MAILEXCLUSION_LIST' => $conf_UAM[11],596 'UAM_PASSWORDENF_TRUE' => $conf_UAM[12]=='true' ? 'checked="checked"' : '' ,597 'UAM_PASSWORDENF_FALSE' => $conf_UAM[12]=='false' ? 'checked="checked"' : '' ,598 'UAM_PASSWORD_SCORE' => $conf_UAM[13],599 600 'UAM_ADMINPASSWENF_FALSE' => $conf_UAM[14]=='false' ? 'checked="checked"' : '' ,601 'UAM_GHOSTRACKER_TRUE' => $conf_UAM[15]=='true' ? 'checked="checked"' : '' ,602 'UAM_GHOSTRACKER_FALSE' => $conf_UAM[15]=='false' ? 'checked="checked"' : '' ,603 'UAM_GHOSTRACKER_DAYLIMIT' => $conf_UAM[16],604 'UAM_GHOSTRACKER_REMINDERTEXT' => $conf_UAM[17],605 'UAM_ADDLASTVISIT_TRUE' => $conf_UAM[18]=='true' ? 'checked="checked"' : '' ,606 'UAM_ADDLASTVISIT_FALSE' => $conf_UAM[18]=='false' ? 'checked="checked"' : '' ,607 'UAM_ADMINCONFMAIL_TRUE' => $conf_UAM[19]=='true' ? 'checked="checked"' : '' ,608 'UAM_ADMINCONFMAIL_FALSE' => $conf_UAM[19]=='false' ? 'checked="checked"' : '' ,609 'UAM_REDIRTOPROFILE_TRUE' => $conf_UAM[20]=='true' ? 'checked="checked"' : '' ,610 'UAM_REDIRTOPROFILE_FALSE' => $conf_UAM[20]=='false' ? 'checked="checked"' : '' ,611 'UAM_GTAUTO_TRUE' => $conf_UAM[21]=='true' ? 'checked="checked"' : '' ,612 'UAM_GTAUTO_FALSE' => $conf_UAM[21]=='false' ? 'checked="checked"' : '' ,613 'UAM_GTAUTOMAIL_TRUE' => $conf_UAM[22]=='true' ? 'checked="checked"' : '' ,614 'UAM_GTAUTOMAIL_FALSE' => $conf_UAM[22]=='false' ? 'checked="checked"' : '' ,615 'UAM_GTAUTODEL_TEXT' => $conf_UAM[23],616 'UAM_GTAUTOMAILTEXT' => $conf_UAM[24],617 'UAM_Downgrade_Group' => $conf_UAM[25],618 'UAM_Downgrade_Status' => $conf_UAM[26],619 'UAM_ADMINVALIDATIONMAIL_TEXT' => $conf_UAM[27],620 'UAM_CUSTOMPASSWRETR_TRUE' => $conf_UAM[28]=='true' ? 'checked="checked"' : '' ,621 'UAM_CUSTOMPASSWRETR_FALSE' => $conf_UAM[28]=='false' ? 'checked="checked"' : '' ,622 'UAM_CUSTOMPASSWRETR_TEXT' => $conf_UAM[29],623 'UAM_USRAUTO_TRUE' => $conf_UAM[30]=='true' ? 'checked="checked"' : '' ,624 'UAM_USRAUTO_FALSE' => $conf_UAM[30]=='false' ? 'checked="checked"' : '' ,625 'UAM_USRAUTODEL_TEXT' => $conf_UAM[31],626 'UAM_USRAUTOMAIL_TRUE' => $conf_UAM[32]=='true' ? 'checked="checked"' : '' ,627 'UAM_USRAUTOMAIL_FALSE' => $conf_UAM[32]=='false' ? 'checked="checked"' : '' ,628 'UAM_STUFFS_TRUE' => $conf_UAM[33]=='true' ? 'checked="checked"' : '' ,629 'UAM_STUFFS_FALSE' => $conf_UAM[33]=='false' ? 'checked="checked"' : '' ,630 'UAM_HIDEPASSW_TRUE' => $conf_UAM[34]=='true' ? 'checked="checked"' : '' ,631 'UAM_HIDEPASSW_FALSE' => $conf_UAM[34]=='false' ? 'checked="checked"' : '' ,632 'UAM_NO_VALID_LEVEL' => $conf_UAM[35],633 'UAM_VALID_LEVEL' => $conf_UAM[36],634 'UAM_DOWNGRADE_LEVEL' => $conf_UAM[37],635 'UAM_PWDRESET_TRUE' => $conf_UAM[38]=='true' ? 'checked="checked"' : '' ,636 'UAM_PWDRESET_FALSE' => $conf_UAM[38]=='false' ? 'checked="checked"' : '' ,637 'UAM_REJECTCONNECT_TRUE' => $conf_UAM[39]=='true' ? 'checked="checked"' : '' ,638 'UAM_REJECTCONNECT_FALSE' => $conf_UAM[39]=='false' ? 'checked="checked"' : '' ,639 'UAM_REJECTCONNECT_TEXT' => $conf_UAM[40],640 'UAM_CONFIRMMAIL_SUBJECT' => $conf_UAM[41],641 'UAM_CONFIRMMAIL_REMAIL_SUBJECT' => $conf_UAM[42],642 'UAM_INFOMAIL_SUBJECT' => $conf_UAM[43],643 'UAM_GTAUTOMAIL_SUBJECT' => $conf_UAM[44],644 'UAM_GTREMINDER_SUBJECT' => $conf_UAM[45],645 'UAM_ADMINVALIDATIONMAIL_SUBJECT' => $conf_UAM[46],646 'UAM_PASSWORD_TEST_SCORE' => $UAM_Password_Test_Score,647 'UAM_ERROR_REPORTS1' => $UAM_Exclusionlist_Error,648 'UAM_ERROR_REPORTS2' => $UAM_Illegal_Flag_Error1,649 'UAM_ERROR_REPORTS3' => $UAM_Illegal_Flag_Error2,650 'UAM_ERROR_REPORTS4' => $UAM_Illegal_Flag_Error3,651 'UAM_EMAIL_MANDATORY' => $UAM_Email_Mandatory_Check,652 'UAM_CONFIRMMAIL_TIMEOUT_TRUE'=> $conf_UAM_ConfirmMail[0]=='true' ? 'checked="checked"' : '' ,653 'UAM_CONFIRMMAIL_TIMEOUT_FALSE' => $conf_UAM_ConfirmMail[0]=='false' ? 'checked="checked"' : '' ,654 'UAM_CONFIRMMAIL_DELAY'=> $conf_UAM_ConfirmMail[1],655 'UAM_CONFIRMMAIL_REMAIL_TRUE' => $conf_UAM_ConfirmMail[3]=='true' ? 'checked="checked"' : '',656 'UAM_CONFIRMMAIL_REMAIL_FALSE' => $conf_UAM_ConfirmMail[3]=='false' ? 'checked="checked"' : '',657 'UAM_CONFIRMMAIL_REMAIL_TXT1' => $conf_UAM_ConfirmMail[2],658 'UAM_CONFIRMMAIL_REMAIL_TXT2' => $conf_UAM_ConfirmMail[4],659 'UAM_CONFIRMMAIL_CUSTOM_TXT1' => $conf_UAM_ConfirmMail[5],660 'UAM_CONFIRMMAIL_CUSTOM_TXT2' => $conf_UAM_ConfirmMail[6],572 array( 573 'nb_para' => $nb_para, 574 'nb_para2' => $nb_para2, 575 'UAM_VERSION' => $version, 576 'UAM_PATH' => UAM_PATH, 577 'UAM_DUMP_DOWNLOAD' => $dump_download, 578 'UAM_THEME' => $UAM_theme, 579 'UAM_MAIL_INFO_TRUE' => $conf_UAM[0]=='true' ? 'checked="checked"' : '' , 580 'UAM_MAIL_INFO_FALSE' => $conf_UAM[0]=='false' ? 'checked="checked"' : '' , 581 'UAM_MAILINFO_TEXT' => $conf_UAM[8], 582 'UAM_USERNAME_CHAR_TRUE' => $conf_UAM[5]=='true' ? 'checked="checked"' : '' , 583 'UAM_USERNAME_CHAR_FALSE' => $conf_UAM[5]=='false' ? 'checked="checked"' : '' , 584 'UAM_USERNAME_CHAR_LIST' => $conf_UAM[6], 585 'UAM_CONFIRM_MAIL_TRUE' => $conf_UAM[1]=='true' ? 'checked="checked"' : '' , 586 'UAM_CONFIRM_MAIL_FALSE' => $conf_UAM[1]=='false' ? 'checked="checked"' : '' , 587 'UAM_CONFIRM_MAIL_LOCAL' => $conf_UAM[1]=='local' ? 'checked="checked"' : '' , 588 'UAM_CONFIRMMAIL_TEXT' => $conf_UAM[9], 589 'UAM_No_Confirm_Group' => $conf_UAM[2], 590 'UAM_Validated_Group' => $conf_UAM[3], 591 'UAM_No_Confirm_Status' => $conf_UAM[7], 592 'UAM_Validated_Status' => $conf_UAM[4], 593 'UAM_MAILEXCLUSION_TRUE' => $conf_UAM[10]=='true' ? 'checked="checked"' : '' , 594 'UAM_MAILEXCLUSION_FALSE' => $conf_UAM[10]=='false' ? 'checked="checked"' : '' , 595 'UAM_MAILEXCLUSION_LIST' => $conf_UAM[11], 596 'UAM_PASSWORDENF_TRUE' => $conf_UAM[12]=='true' ? 'checked="checked"' : '' , 597 'UAM_PASSWORDENF_FALSE' => $conf_UAM[12]=='false' ? 'checked="checked"' : '' , 598 'UAM_PASSWORD_SCORE' => $conf_UAM[13], 599 'UAM_ADMINPASSWENF_TRUE' => $conf_UAM[14]=='true' ? 'checked="checked"' : '' , 600 'UAM_ADMINPASSWENF_FALSE' => $conf_UAM[14]=='false' ? 'checked="checked"' : '' , 601 'UAM_GHOSTRACKER_TRUE' => $conf_UAM[15]=='true' ? 'checked="checked"' : '' , 602 'UAM_GHOSTRACKER_FALSE' => $conf_UAM[15]=='false' ? 'checked="checked"' : '' , 603 'UAM_GHOSTRACKER_DAYLIMIT' => $conf_UAM[16], 604 'UAM_GHOSTRACKER_REMINDERTEXT' => $conf_UAM[17], 605 'UAM_ADDLASTVISIT_TRUE' => $conf_UAM[18]=='true' ? 'checked="checked"' : '' , 606 'UAM_ADDLASTVISIT_FALSE' => $conf_UAM[18]=='false' ? 'checked="checked"' : '' , 607 'UAM_ADMINCONFMAIL_TRUE' => $conf_UAM[19]=='true' ? 'checked="checked"' : '' , 608 'UAM_ADMINCONFMAIL_FALSE' => $conf_UAM[19]=='false' ? 'checked="checked"' : '' , 609 'UAM_REDIRTOPROFILE_TRUE' => $conf_UAM[20]=='true' ? 'checked="checked"' : '' , 610 'UAM_REDIRTOPROFILE_FALSE' => $conf_UAM[20]=='false' ? 'checked="checked"' : '' , 611 'UAM_GTAUTO_TRUE' => $conf_UAM[21]=='true' ? 'checked="checked"' : '' , 612 'UAM_GTAUTO_FALSE' => $conf_UAM[21]=='false' ? 'checked="checked"' : '' , 613 'UAM_GTAUTOMAIL_TRUE' => $conf_UAM[22]=='true' ? 'checked="checked"' : '' , 614 'UAM_GTAUTOMAIL_FALSE' => $conf_UAM[22]=='false' ? 'checked="checked"' : '' , 615 'UAM_GTAUTODEL_TEXT' => $conf_UAM[23], 616 'UAM_GTAUTOMAILTEXT' => $conf_UAM[24], 617 'UAM_Downgrade_Group' => $conf_UAM[25], 618 'UAM_Downgrade_Status' => $conf_UAM[26], 619 'UAM_ADMINVALIDATIONMAIL_TEXT' => $conf_UAM[27], 620 'UAM_CUSTOMPASSWRETR_TRUE' => $conf_UAM[28]=='true' ? 'checked="checked"' : '' , 621 'UAM_CUSTOMPASSWRETR_FALSE' => $conf_UAM[28]=='false' ? 'checked="checked"' : '' , 622 'UAM_CUSTOMPASSWRETR_TEXT' => $conf_UAM[29], 623 'UAM_USRAUTO_TRUE' => $conf_UAM[30]=='true' ? 'checked="checked"' : '' , 624 'UAM_USRAUTO_FALSE' => $conf_UAM[30]=='false' ? 'checked="checked"' : '' , 625 'UAM_USRAUTODEL_TEXT' => $conf_UAM[31], 626 'UAM_USRAUTOMAIL_TRUE' => $conf_UAM[32]=='true' ? 'checked="checked"' : '' , 627 'UAM_USRAUTOMAIL_FALSE' => $conf_UAM[32]=='false' ? 'checked="checked"' : '' , 628 'UAM_STUFFS_TRUE' => $conf_UAM[33]=='true' ? 'checked="checked"' : '' , 629 'UAM_STUFFS_FALSE' => $conf_UAM[33]=='false' ? 'checked="checked"' : '' , 630 'UAM_HIDEPASSW_TRUE' => $conf_UAM[34]=='true' ? 'checked="checked"' : '' , 631 'UAM_HIDEPASSW_FALSE' => $conf_UAM[34]=='false' ? 'checked="checked"' : '' , 632 'UAM_NO_VALID_LEVEL' => $conf_UAM[35], 633 'UAM_VALID_LEVEL' => $conf_UAM[36], 634 'UAM_DOWNGRADE_LEVEL' => $conf_UAM[37], 635 'UAM_PWDRESET_TRUE' => $conf_UAM[38]=='true' ? 'checked="checked"' : '' , 636 'UAM_PWDRESET_FALSE' => $conf_UAM[38]=='false' ? 'checked="checked"' : '' , 637 'UAM_REJECTCONNECT_TRUE' => $conf_UAM[39]=='true' ? 'checked="checked"' : '' , 638 'UAM_REJECTCONNECT_FALSE' => $conf_UAM[39]=='false' ? 'checked="checked"' : '' , 639 'UAM_REJECTCONNECT_TEXT' => $conf_UAM[40], 640 'UAM_CONFIRMMAIL_SUBJECT' => $conf_UAM[41], 641 'UAM_CONFIRMMAIL_REMAIL_SUBJECT' => $conf_UAM[42], 642 'UAM_INFOMAIL_SUBJECT' => $conf_UAM[43], 643 'UAM_GTAUTOMAIL_SUBJECT' => $conf_UAM[44], 644 'UAM_GTREMINDER_SUBJECT' => $conf_UAM[45], 645 'UAM_ADMINVALIDATIONMAIL_SUBJECT' => $conf_UAM[46], 646 'UAM_PASSWORD_TEST_SCORE' => $UAM_Password_Test_Score, 647 'UAM_ERROR_REPORTS1' => $UAM_Exclusionlist_Error, 648 'UAM_ERROR_REPORTS2' => $UAM_Illegal_Flag_Error1, 649 'UAM_ERROR_REPORTS3' => $UAM_Illegal_Flag_Error2, 650 'UAM_ERROR_REPORTS4' => $UAM_Illegal_Flag_Error3, 651 'UAM_EMAIL_MANDATORY' => $UAM_Email_Mandatory_Check, 652 'UAM_CONFIRMMAIL_TIMEOUT_TRUE' => $conf_UAM_ConfirmMail[0]=='true' ? 'checked="checked"' : '' , 653 'UAM_CONFIRMMAIL_TIMEOUT_FALSE' => $conf_UAM_ConfirmMail[0]=='false' ? 'checked="checked"' : '' , 654 'UAM_CONFIRMMAIL_DELAY' => $conf_UAM_ConfirmMail[1], 655 'UAM_CONFIRMMAIL_REMAIL_TRUE' => $conf_UAM_ConfirmMail[3]=='true' ? 'checked="checked"' : '', 656 'UAM_CONFIRMMAIL_REMAIL_FALSE' => $conf_UAM_ConfirmMail[3]=='false' ? 'checked="checked"' : '', 657 'UAM_CONFIRMMAIL_REMAIL_TXT1' => $conf_UAM_ConfirmMail[2], 658 'UAM_CONFIRMMAIL_REMAIL_TXT2' => $conf_UAM_ConfirmMail[4], 659 'UAM_CONFIRMMAIL_CUSTOM_TXT1' => $conf_UAM_ConfirmMail[5], 660 'UAM_CONFIRMMAIL_CUSTOM_TXT2' => $conf_UAM_ConfirmMail[6], 661 661 ) 662 662 ); 663 663 664 664 if (isset($_POST['audit'])) 665 {666 $msg_error1 = '';665 { 666 $msg_error1 = ''; 667 667 668 668 // Username without forbidden keys 669 669 // ------------------------------- 670 670 if ( isset($conf_UAM[5]) and $conf_UAM[5] == 'true' ) 671 {672 $query = "673 SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."674 FROM ".USERS_TABLE." 675 ; ";671 { 672 $query = ' 673 SELECT '.$conf['user_fields']['username'].', '.$conf['user_fields']['email'].' 674 FROM '.USERS_TABLE.' 675 ;'; 676 676 677 $result = pwg_query($query);677 $result = pwg_query($query); 678 678 679 while($row = pwg_db_fetch_assoc($result))680 {681 if (!ValidateUsername(stripslashes($row['username'])))682 $msg_error1 .= (($msg_error1 <> '') ? '<br>' : '').l10n('UAM_Err_audit_username_char').stripslashes($row['username']);683 }684 }685 686 $msg_error2 = '';679 while($row = pwg_db_fetch_assoc($result)) 680 { 681 if (!ValidateUsername(stripslashes($row['username']))) 682 $msg_error1 .= (($msg_error1 <> '') ? '<br>' : '').l10n('UAM_Err_audit_username_char').stripslashes($row['username']); 683 } 684 } 685 686 $msg_error2 = ''; 687 687 688 688 // Email without forbidden domain 689 689 // ------------------------------ 690 690 if ( isset($conf_UAM[10]) and $conf_UAM[10] == 'true' ) 691 692 $query = "693 SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."694 FROM ".USERS_TABLE."695 ; ";691 { 692 $query = ' 693 SELECT '.$conf['user_fields']['username'].', '.$conf['user_fields']['email'].' 694 FROM '.USERS_TABLE.' 695 ;'; 696 696 697 $result = pwg_query($query);697 $result = pwg_query($query); 698 698 699 while($row = pwg_db_fetch_assoc($result))700 {701 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]);702 for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++)703 {704 $pattern = '/'.$conf_MailExclusion[$i].'/';705 if (preg_match($pattern, $row['mail_address']))706 {707 $msg_error2 .= (($msg_error2 <> '') ? '<br>' : '').l10n('UAM_Err_audit_email_forbidden').stripslashes($row['username']).' ('.$row['mail_address'].')';708 }709 }710 }711 }699 while($row = pwg_db_fetch_assoc($result)) 700 { 701 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]); 702 for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++) 703 { 704 $pattern = '/'.$conf_MailExclusion[$i].'/'; 705 if (preg_match($pattern, $row['mail_address'])) 706 { 707 $msg_error2 .= (($msg_error2 <> '') ? '<br>' : '').l10n('UAM_Err_audit_email_forbidden').stripslashes($row['username']).' ('.$row['mail_address'].')'; 708 } 709 } 710 } 711 } 712 712 713 if ($msg_error1 <> '')714 $errors[] = $msg_error1.'<br><br>';713 if ($msg_error1 <> '') 714 $errors[] = $msg_error1.'<br><br>'; 715 715 716 if ($msg_error2 <> '')717 $errors[] = $msg_error2.'<br><br>';716 if ($msg_error2 <> '') 717 $errors[] = $msg_error2.'<br><br>'; 718 718 719 if ($msg_error1 <> '' or $msg_error2 <> '')720 array_push($page['errors'], l10n('UAM_Err_audit_advise'));721 else722 array_push($page['infos'], l10n('UAM_audit_ok'));723 719 if ($msg_error1 <> '' or $msg_error2 <> '') 720 array_push($page['errors'], l10n('UAM_Err_audit_advise')); 721 else 722 array_push($page['infos'], l10n('UAM_audit_ok')); 723 } 724 724 725 725 … … 727 727 // | errors display | 728 728 // +-----------------------------------------------------------------------+ 729 729 if (isset ($errors) and count($errors) != 0) 730 730 { 731 732 foreach ($errors as $error)733 {734 array_push($page['errors'], $error);735 }736 }731 $template->assign('errors',array()); 732 foreach ($errors as $error) 733 { 734 array_push($page['errors'], $error); 735 } 736 } 737 737 738 738 // +-----------------------------------------------------------------------+ … … 760 760 // +-----------------------------------------------------------------------+ 761 761 762 if (!defined('PHPWG_ROOT_PATH'))763 764 765 762 if (!defined('PHPWG_ROOT_PATH')) 763 { 764 die('Hacking attempt!'); 765 } 766 766 767 767 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 768 768 769 769 // +-----------------------------------------------------------------------+ 770 770 // | Check Access and exit when user status is not ok | 771 771 // +-----------------------------------------------------------------------+ 772 check_status(ACCESS_ADMINISTRATOR);772 check_status(ACCESS_ADMINISTRATOR); 773 773 774 774 … … 777 777 // +-----------------------------------------------------------------------+ 778 778 779 $page['filtered_users'] = get_user_list();779 $page['filtered_users'] = get_user_list(); 780 780 781 781 // +-----------------------------------------------------------------------+ … … 783 783 // +-----------------------------------------------------------------------+ 784 784 785 $visible_user_list = array(); 786 foreach ($page['filtered_users'] as $num => $local_user) 787 { 788 $visible_user_list[] = $local_user; 785 $visible_user_list = array(); 786 foreach ($page['filtered_users'] as $num => $local_user) 787 { 788 $visible_user_list[] = $local_user; 789 } 790 791 foreach ($visible_user_list as $local_user) 792 { 793 // dates formating and compare 794 // --------------------------- 795 $today = date("d-m-Y"); // Get today's date 796 list($day, $month, $year) = explode('-', $today); // explode date of today 797 $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp 798 799 list($regdate, $regtime) = explode(' ', $local_user['lastvisit']); // Explode date and time from registration date 800 list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date 801 $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp 802 803 $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps 804 $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days 805 806 if (isset($conf_UAM[15]) and $conf_UAM[15]=='true' and $conf_UAM[16] <> '') 807 { 808 if ($deltadays <= ($conf_UAM[16]/2)) 809 { 810 $display = 'green'; 811 } 812 813 if (($deltadays > ($conf_UAM[16]/2)) and ($deltadays < $conf_UAM[16])) 814 { 815 $display = 'orange'; 816 } 817 818 if ($deltadays >= $conf_UAM[16]) 819 { 820 $display = 'red'; 821 } 822 } 823 else $display = ''; 824 825 // Template initialization 826 // ----------------------- 827 $template->append( 828 'users', 829 array( 830 'ID' => $local_user['id'], 831 'USERNAME' => stripslashes($local_user['username']), 832 'EMAIL' => get_email_address_as_display_text($local_user['email']), 833 'LASTVISIT' => $local_user['lastvisit'], 834 'DAYS' => $deltadays, 835 'DISPLAY' => $display, 836 ) 837 ); 838 } 839 840 // Plugin version inserted 841 // ----------------------- 842 $template->assign( 843 array( 844 'UAM_VERSION' => $version, 845 'UAM_PATH' => UAM_PATH, 846 ) 847 ); 848 849 // +-----------------------------------------------------------------------+ 850 // | errors display | 851 // +-----------------------------------------------------------------------+ 852 if ( isset ($errors) and count($errors) != 0) 853 { 854 $template->assign('errors',array()); 855 foreach ($errors as $error) 856 { 857 array_push($page['errors'], $error); 858 } 859 } 860 861 // +-----------------------------------------------------------------------+ 862 // | templates display | 863 // +-----------------------------------------------------------------------+ 864 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/userlist.tpl'); 865 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 789 866 } 790 791 foreach ($visible_user_list as $local_user) 792 { 793 // dates formating and compare 794 // --------------------------- 795 $today = date("d-m-Y"); // Get today's date 796 list($day, $month, $year) = explode('-', $today); // explode date of today 797 $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp 798 799 list($regdate, $regtime) = explode(' ', $local_user['lastvisit']); // Explode date and time from registration date 800 list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date 801 $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp 802 803 $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps 804 $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days 805 806 if (isset($conf_UAM[15]) and $conf_UAM[15]=='true' and $conf_UAM[16] <> '') 807 { 808 if ($deltadays <= ($conf_UAM[16]/2)) 809 { 810 $display = 'green'; 811 } 812 813 if (($deltadays > ($conf_UAM[16]/2)) and ($deltadays < $conf_UAM[16])) 814 { 815 $display = 'orange'; 816 } 817 818 if ($deltadays >= $conf_UAM[16]) 819 { 820 $display = 'red'; 821 } 822 } 823 else $display = ''; 824 825 // Template initialization 826 // ----------------------- 827 $template->append( 828 'users', 829 array( 830 'ID' => $local_user['id'], 831 'USERNAME' => stripslashes($local_user['username']), 832 'EMAIL' => get_email_address_as_display_text($local_user['email']), 833 'LASTVISIT' => $local_user['lastvisit'], 834 'DAYS' => $deltadays, 835 'DISPLAY' => $display, 836 ) 837 ); 867 else 868 { 869 array_push($page['errors'], l10n('UAM_Err_Userlist_Settings')); 838 870 } 839 // Plugin version inserted 840 // ----------------------- 841 $template->assign( 842 array( 843 'UAM_VERSION' => $version, 844 'UAM_PATH' => UAM_PATH, 845 ) 846 ); 847 // +-----------------------------------------------------------------------+ 848 // | errors display | 849 // +-----------------------------------------------------------------------+ 850 if ( isset ($errors) and count($errors) != 0) 851 { 852 $template->assign('errors',array()); 853 foreach ($errors as $error) 854 { 855 array_push($page['errors'], $error); 856 } 857 } 858 859 // +-----------------------------------------------------------------------+ 860 // | templates display | 861 // +-----------------------------------------------------------------------+ 862 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/userlist.tpl'); 863 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 864 } 865 else 866 { 867 array_push($page['errors'], l10n('UAM_Err_Userlist_Settings')); 868 } 869 break; 871 872 break; 870 873 871 874 … … 881 884 $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); 882 885 883 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[7]) and $conf_UAM[7] <> '-1')))886 if (isset($conf_UAM[1]) and ($conf_UAM[1]=='true' or $conf_UAM[1]=='local')) 884 887 { 885 888 // +-----------------------------------------------------------------------+ … … 887 890 // +-----------------------------------------------------------------------+ 888 891 889 if (!defined('PHPWG_ROOT_PATH'))892 if (!defined('PHPWG_ROOT_PATH')) 890 893 { 891 die('Hacking attempt!');894 die('Hacking attempt!'); 892 895 } 893 896 … … 897 900 // | Check Access and exit when user status is not ok | 898 901 // +-----------------------------------------------------------------------+ 899 check_status(ACCESS_ADMINISTRATOR);902 check_status(ACCESS_ADMINISTRATOR); 900 903 901 904 // +-----------------------------------------------------------------------+ … … 903 906 // +-----------------------------------------------------------------------+ 904 907 905 $page['filtered_users'] = get_unvalid_user_list();908 $page['filtered_users'] = get_unvalid_user_list(); 906 909 907 910 // +-----------------------------------------------------------------------+ 908 911 // | selected users | 909 912 // +-----------------------------------------------------------------------+ 910 if (isset($_POST['Del_Selected']))911 {912 $collection = array();913 914 switch ($_POST['target'])915 916 917 {918 919 {920 array_push($collection, $local_user['id']);921 }922 break;923 }924 case 'selection' :925 {926 if (isset($_POST['selection']))927 {928 $collection = $_POST['selection'];929 }930 931 }932 }933 934 if (count($collection) == 0)935 {936 array_push($page['errors'], l10n('Select at least one user'));937 }938 }913 if (isset($_POST['Del_Selected'])) 914 { 915 $collection = array(); 916 917 switch ($_POST['target']) 918 { 919 case 'all' : 920 { 921 foreach($page['filtered_users'] as $local_user) 922 { 923 array_push($collection, $local_user['id']); 924 } 925 break; 926 } 927 case 'selection' : 928 { 929 if (isset($_POST['selection'])) 930 { 931 $collection = $_POST['selection']; 932 } 933 break; 934 } 935 } 936 937 if (count($collection) == 0) 938 { 939 array_push($page['errors'], l10n('Select at least one user')); 940 } 941 } 939 942 940 943 // +-----------------------------------------------------------------------+ 941 944 // | delete users | 942 945 // +-----------------------------------------------------------------------+ 943 if (isset($_POST['Del_Selected']) and count($collection) > 0)944 {945 946 {947 array_push($page['errors'], l10n('Guest cannot be deleted'));948 }949 950 in_array($conf['default_user_id'], $collection))951 {952 array_push($page['errors'], l10n('Default user cannot be deleted'));953 }954 if (in_array($conf['webmaster_id'], $collection))955 {956 array_push($page['errors'], l10n('Webmaster cannot be deleted'));957 }958 if (in_array($user['id'], $collection))959 {960 array_push($page['errors'], l10n('You cannot delete your account'));961 }962 963 if (count($page['errors']) == 0)964 {965 966 {967 delete_user($user_id);968 969 970 $page['infos'],971 972 973 count($collection)974 975 );976 977 foreach ($page['filtered_users'] as $filter_key => $filter_user)978 {979 980 981 unset($page['filtered_users'][$filter_key]);982 }983 }984 }985 }946 if (isset($_POST['Del_Selected']) and count($collection) > 0) 947 { 948 if (in_array($conf['guest_id'], $collection)) 949 { 950 array_push($page['errors'], l10n('Guest cannot be deleted')); 951 } 952 if (($conf['guest_id'] != $conf['default_user_id']) and 953 in_array($conf['default_user_id'], $collection)) 954 { 955 array_push($page['errors'], l10n('Default user cannot be deleted')); 956 } 957 if (in_array($conf['webmaster_id'], $collection)) 958 { 959 array_push($page['errors'], l10n('Webmaster cannot be deleted')); 960 } 961 if (in_array($user['id'], $collection)) 962 { 963 array_push($page['errors'], l10n('You cannot delete your account')); 964 } 965 966 if (count($page['errors']) == 0) 967 { 968 foreach ($collection as $user_id) 969 { 970 delete_user($user_id); 971 } 972 array_push( 973 $page['infos'], 974 l10n_dec( 975 '%d user deleted', '%d users deleted', 976 count($collection) 977 ) 978 ); 979 980 foreach ($page['filtered_users'] as $filter_key => $filter_user) 981 { 982 if (in_array($filter_user['id'], $collection)) 983 { 984 unset($page['filtered_users'][$filter_key]); 985 } 986 } 987 } 988 } 986 989 987 990 // +-----------------------------------------------------------------------+ … … 991 994 // | selected users | 992 995 // +-----------------------------------------------------------------------+ 993 if (isset($_POST['Mail_With_Key']))994 {995 $collection = array();996 997 switch ($_POST['target'])998 {999 case 'all' :1000 {1001 foreach($page['filtered_users'] as $local_user)1002 {1003 array_push($collection, $local_user['id']);1004 }1005 1006 }1007 case 'selection' :1008 {1009 if (isset($_POST['selection']))1010 {1011 $collection = $_POST['selection'];1012 1013 1014 }1015 }1016 1017 if (count($collection) == 0)1018 {1019 array_push($page['errors'], l10n('Select at least one user'));1020 }1021 }996 if (isset($_POST['Mail_With_Key'])) 997 { 998 $collection = array(); 999 1000 switch ($_POST['target']) 1001 { 1002 case 'all' : 1003 { 1004 foreach($page['filtered_users'] as $local_user) 1005 { 1006 array_push($collection, $local_user['id']); 1007 } 1008 break; 1009 } 1010 case 'selection' : 1011 { 1012 if (isset($_POST['selection'])) 1013 { 1014 $collection = $_POST['selection']; 1015 } 1016 break; 1017 } 1018 } 1019 1020 if (count($collection) == 0) 1021 { 1022 array_push($page['errors'], l10n('Select at least one user')); 1023 } 1024 } 1022 1025 // +-----------------------------------------------------------------------+ 1023 1026 // | Resend new validation key to users | 1024 1027 // +-----------------------------------------------------------------------+ 1025 if (isset($_POST['Mail_With_Key']) and count($collection) > 0)1026 {1027 if (in_array($conf['guest_id'], $collection))1028 {1029 array_push($page['errors'], l10n('UAM_No_validation_for_Guest'));1030 1031 if (($conf['guest_id'] != $conf['default_user_id']) and1032 in_array($conf['default_user_id'], $collection))1033 {1034 array_push($page['errors'], l10n('UAM_No_validation_for_default_user'));1035 1036 if (in_array($conf['webmaster_id'], $collection))1037 {1038 array_push($page['errors'], l10n('UAM_No_validation_for_Webmaster'));1039 }1040 if (in_array($user['id'], $collection))1041 {1042 array_push($page['errors'], l10n('UAM_No_validation_for_your_account'));1043 }1044 1045 if (count($page['errors']) == 0)1046 {1047 foreach ($collection as $user_id)1048 {1049 $typemail = 1;1050 $query = "1028 if (isset($_POST['Mail_With_Key']) and count($collection) > 0) 1029 { 1030 if (in_array($conf['guest_id'], $collection)) 1031 { 1032 array_push($page['errors'], l10n('UAM_No_validation_for_Guest')); 1033 } 1034 if (($conf['guest_id'] != $conf['default_user_id']) and 1035 in_array($conf['default_user_id'], $collection)) 1036 { 1037 array_push($page['errors'], l10n('UAM_No_validation_for_default_user')); 1038 } 1039 if (in_array($conf['webmaster_id'], $collection)) 1040 { 1041 array_push($page['errors'], l10n('UAM_No_validation_for_Webmaster')); 1042 } 1043 if (in_array($user['id'], $collection)) 1044 { 1045 array_push($page['errors'], l10n('UAM_No_validation_for_your_account')); 1046 } 1047 1048 if (count($page['errors']) == 0) 1049 { 1050 foreach ($collection as $user_id) 1051 { 1052 $typemail = 1; 1053 $query = ' 1051 1054 SELECT id, username, mail_address 1052 FROM ".USERS_TABLE."1053 WHERE id = ' ".$user_id."'1054 ; ";1055 $data = pwg_db_fetch_assoc(pwg_query($query));1055 FROM '.USERS_TABLE.' 1056 WHERE id = '.$user_id.' 1057 ;'; 1058 $data = pwg_db_fetch_assoc(pwg_query($query)); 1056 1059 1057 ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],true);1058 }1059 array_push(1060 $page['infos'],1061 1062 'UAM_%d_Mail_With_Key', 'UAM_%d_Mails_With_Key',1063 count($collection)1064 )1065 );1060 ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],true); 1061 } 1062 array_push( 1063 $page['infos'], 1064 l10n_dec( 1065 'UAM_%d_Mail_With_Key', 'UAM_%d_Mails_With_Key', 1066 count($collection) 1067 ) 1068 ); 1066 1069 1067 $page['filtered_users'] = get_unvalid_user_list();1068 }1069 }1070 $page['filtered_users'] = get_unvalid_user_list(); 1071 } 1072 } 1070 1073 1071 1074 // +-----------------------------------------------------------------------+ … … 1075 1078 // | selected users | 1076 1079 // +-----------------------------------------------------------------------+ 1077 if (isset($_POST['Mail_Without_Key']))1078 {1079 $collection = array();1080 1081 switch ($_POST['target'])1082 {1083 case 'all' :1084 {1085 foreach($page['filtered_users'] as $local_user)1086 {1087 array_push($collection, $local_user['id']);1088 }1089 1090 }1091 case 'selection' :1092 {1093 1094 {1095 $collection = $_POST['selection'];1096 }1097 1098 }1099 }1100 1101 if (count($collection) == 0)1102 {1103 array_push($page['errors'], l10n('Select at least one user'));1104 1105 }1080 if (isset($_POST['Mail_Without_Key'])) 1081 { 1082 $collection = array(); 1083 1084 switch ($_POST['target']) 1085 { 1086 case 'all' : 1087 { 1088 foreach($page['filtered_users'] as $local_user) 1089 { 1090 array_push($collection, $local_user['id']); 1091 } 1092 break; 1093 } 1094 case 'selection' : 1095 { 1096 if (isset($_POST['selection'])) 1097 { 1098 $collection = $_POST['selection']; 1099 } 1100 break; 1101 } 1102 } 1103 1104 if (count($collection) == 0) 1105 { 1106 array_push($page['errors'], l10n('Select at least one user')); 1107 } 1108 } 1106 1109 // +-----------------------------------------------------------------------+ 1107 1110 // | Send reminder without new key to users | 1108 1111 // +-----------------------------------------------------------------------+ 1109 if (isset($_POST['Mail_Without_Key']) and count($collection) > 0)1110 {1111 if (in_array($conf['guest_id'], $collection))1112 {1113 array_push($page['errors'], l10n('UAM_No_validation_for_Guest'));1114 }1115 if (($conf['guest_id'] != $conf['default_user_id']) and1116 in_array($conf['default_user_id'], $collection))1117 {1118 array_push($page['errors'], l10n('UAM_No_validation_for_default_user'));1119 }1120 if (in_array($conf['webmaster_id'], $collection))1121 {1122 array_push($page['errors'], l10n('UAM_No_validation_for_Webmaster'));1123 }1124 if (in_array($user['id'], $collection))1125 {1126 array_push($page['errors'], l10n('UAM_No_validation_for_your_account'));1127 }1128 1129 if (count($page['errors']) == 0)1130 {1131 foreach ($collection as $user_id)1132 {1133 $typemail = 2;1134 $query = "1112 if (isset($_POST['Mail_Without_Key']) and count($collection) > 0) 1113 { 1114 if (in_array($conf['guest_id'], $collection)) 1115 { 1116 array_push($page['errors'], l10n('UAM_No_validation_for_Guest')); 1117 } 1118 if (($conf['guest_id'] != $conf['default_user_id']) and 1119 in_array($conf['default_user_id'], $collection)) 1120 { 1121 array_push($page['errors'], l10n('UAM_No_validation_for_default_user')); 1122 } 1123 if (in_array($conf['webmaster_id'], $collection)) 1124 { 1125 array_push($page['errors'], l10n('UAM_No_validation_for_Webmaster')); 1126 } 1127 if (in_array($user['id'], $collection)) 1128 { 1129 array_push($page['errors'], l10n('UAM_No_validation_for_your_account')); 1130 } 1131 1132 if (count($page['errors']) == 0) 1133 { 1134 foreach ($collection as $user_id) 1135 { 1136 $typemail = 2; 1137 $query = ' 1135 1138 SELECT id, username, mail_address 1136 FROM ".USERS_TABLE."1137 WHERE id = ' ".$user_id."'1138 ; ";1139 FROM '.USERS_TABLE.' 1140 WHERE id = '.$user_id.' 1141 ;'; 1139 1142 1140 $data = pwg_db_fetch_assoc(pwg_query($query));1143 $data = pwg_db_fetch_assoc(pwg_query($query)); 1141 1144 1142 ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],false);1143 }1144 array_push(1145 $page['infos'],1146 1147 1148 count($collection)1149 )1150 );1145 ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],false); 1146 } 1147 array_push( 1148 $page['infos'], 1149 l10n_dec( 1150 'UAM_%d_Reminder_Sent', 'UAM_%d_Reminders_Sent', 1151 count($collection) 1152 ) 1153 ); 1151 1154 1152 $page['filtered_users'] = get_unvalid_user_list(); 1153 } 1154 } 1155 1155 $page['filtered_users'] = get_unvalid_user_list(); 1156 } 1157 } 1158 1159 // +-----------------------------------------------------------------------+ 1160 // | Manual validation by admins | 1161 // +-----------------------------------------------------------------------+ 1162 // +-----------------------------------------------------------------------+ 1163 // | selected users | 1164 // +-----------------------------------------------------------------------+ 1165 if (isset($_POST['Manual_Validation'])) 1166 { 1167 $collection = array(); 1168 1169 switch ($_POST['target']) 1170 { 1171 case 'all' : 1172 { 1173 foreach($page['filtered_users'] as $local_user) 1174 { 1175 array_push($collection, $local_user['id']); 1176 } 1177 break; 1178 } 1179 case 'selection' : 1180 { 1181 if (isset($_POST['selection'])) 1182 { 1183 $collection = $_POST['selection']; 1184 } 1185 break; 1186 } 1187 } 1188 1189 if (count($collection) == 0) 1190 { 1191 array_push($page['errors'], l10n('Select at least one user')); 1192 } 1193 } 1156 1194 // +-----------------------------------------------------------------------+ 1157 1195 // | Force validation | 1158 1196 // +-----------------------------------------------------------------------+ 1159 // +-----------------------------------------------------------------------+ 1160 // | selected users | 1161 // +-----------------------------------------------------------------------+ 1162 if (isset($_POST['Force_Validation'])) 1163 { 1164 $collection = array(); 1165 1166 switch ($_POST['target']) 1167 { 1168 case 'all' : 1169 { 1170 foreach($page['filtered_users'] as $local_user) 1171 { 1172 array_push($collection, $local_user['id']); 1173 } 1174 break; 1175 } 1176 case 'selection' : 1177 { 1178 if (isset($_POST['selection'])) 1179 { 1180 $collection = $_POST['selection']; 1181 } 1182 break; 1183 } 1184 } 1185 1186 if (count($collection) == 0) 1187 { 1188 array_push($page['errors'], l10n('Select at least one user')); 1189 } 1190 } 1191 // +-----------------------------------------------------------------------+ 1192 // | Force validation | 1193 // +-----------------------------------------------------------------------+ 1194 if (isset($_POST['Force_Validation']) and count($collection) > 0) 1195 { 1196 if (in_array($conf['guest_id'], $collection)) 1197 { 1198 array_push($page['errors'], l10n('UAM_No_validation_for_Guest')); 1199 } 1200 if (($conf['guest_id'] != $conf['default_user_id']) and 1201 in_array($conf['default_user_id'], $collection)) 1202 { 1203 array_push($page['errors'], l10n('UAM_No_validation_for_default_user')); 1204 } 1205 if (in_array($conf['webmaster_id'], $collection)) 1206 { 1207 array_push($page['errors'], l10n('UAM_No_validation_for_Webmaster')); 1208 } 1209 if (in_array($user['id'], $collection)) 1210 { 1211 array_push($page['errors'], l10n('UAM_No_validation_for_your_account')); 1212 } 1213 1214 if (count($page['errors']) == 0) 1215 { 1216 foreach ($collection as $user_id) 1217 { 1218 ForceValidation($user_id); 1197 if (isset($_POST['Manual_Validation']) and count($collection) > 0) 1198 { 1199 if (in_array($conf['guest_id'], $collection)) 1200 { 1201 array_push($page['errors'], l10n('UAM_No_validation_for_Guest')); 1202 } 1203 if (($conf['guest_id'] != $conf['default_user_id']) and 1204 in_array($conf['default_user_id'], $collection)) 1205 { 1206 array_push($page['errors'], l10n('UAM_No_validation_for_default_user')); 1207 } 1208 if (in_array($conf['webmaster_id'], $collection)) 1209 { 1210 array_push($page['errors'], l10n('UAM_No_validation_for_Webmaster')); 1211 } 1212 if (in_array($user['id'], $collection)) 1213 { 1214 array_push($page['errors'], l10n('UAM_No_validation_for_your_account')); 1215 } 1216 1217 if (count($page['errors']) == 0) 1218 { 1219 foreach ($collection as $user_id) 1220 { 1221 ManualValidation($user_id); 1219 1222 validation_mail($user_id); 1220 }1221 array_push(1222 $page['infos'],1223 1223 } 1224 array_push( 1225 $page['infos'], 1226 l10n_dec( 1224 1227 'UAM_%d_Validated_User', 'UAM_%d_Validated_Users', 1225 count($collection)1226 )1227 );1228 1229 $page['filtered_users'] = get_unvalid_user_list();1230 }1231 }1228 count($collection) 1229 ) 1230 ); 1231 1232 $page['filtered_users'] = get_unvalid_user_list(); 1233 } 1234 } 1232 1235 1233 1236 … … 1236 1239 // +-----------------------------------------------------------------------+ 1237 1240 1238 $groups[-1] = '------------';1241 $groups[-1] = '------------'; 1239 1242 1240 1243 $query = ' … … 1244 1247 ;'; 1245 1248 1246 $result = pwg_query($query);1249 $result = pwg_query($query); 1247 1250 1248 1251 while ($row = pwg_db_fetch_assoc($result)) 1249 1252 { 1250 1253 $groups[$row['id']] = $row['name']; 1251 1254 } 1252 1255 … … 1255 1258 // +-----------------------------------------------------------------------+ 1256 1259 1257 $profile_url = get_root_url().'admin.php?page=profile&user_id=';1258 $perm_url = get_root_url().'admin.php?page=user_perm&user_id=';1260 $profile_url = get_root_url().'admin.php?page=profile&user_id='; 1261 $perm_url = get_root_url().'admin.php?page=user_perm&user_id='; 1259 1262 1260 1263 $visible_user_list = array(); 1261 1264 foreach ($page['filtered_users'] as $num => $local_user) 1262 1265 { 1263 1264 }1265 1266 foreach ($visible_user_list as $local_user)1266 $visible_user_list[] = $local_user; 1267 } 1268 1269 foreach ($visible_user_list as $local_user) 1267 1270 { 1268 1269 '/(\d+)/e',1271 $groups_string = preg_replace( 1272 '/(\d+)/e', 1270 1273 "\$groups['$1']", 1271 1274 implode( … … 1273 1276 $local_user['groups'] 1274 1277 ) 1275 );1278 ); 1276 1279 1277 1280 $query = ' … … 1294 1297 1295 1298 1296 if (isset($_POST['pref_submit'])1297 and isset($_POST['selection'])1298 1299 {1300 $checked = 'checked="checked"';1301 }1302 else1303 {1304 $checked = '';1305 1306 1307 $properties = array();1308 if ( $local_user['level'] != 0 )1309 {1310 $properties[] = l10n( sprintf('Level %d', $local_user['level']) );1311 }1312 $properties[] =1313 (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true'))1314 ? l10n('is_high_enabled') : l10n('is_high_disabled');1315 1316 $expiration = expiration($local_user['id']);1299 if (isset($_POST['pref_submit']) 1300 and isset($_POST['selection']) 1301 and in_array($local_user['id'], $_POST['selection'])) 1302 { 1303 $checked = 'checked="checked"'; 1304 } 1305 else 1306 { 1307 $checked = ''; 1308 } 1309 1310 $properties = array(); 1311 if ( $local_user['level'] != 0 ) 1312 { 1313 $properties[] = l10n( sprintf('Level %d', $local_user['level']) ); 1314 } 1315 $properties[] = 1316 (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true')) 1317 ? l10n('is_high_enabled') : l10n('is_high_disabled'); 1318 1319 $expiration = expiration($local_user['id']); 1317 1320 1318 1321 // Template initialization 1319 1322 // ----------------------- 1320 $template->append(1321 'users',1322 array(1323 1324 'CHECKED' => $checked,1325 'U_PROFILE' => $profile_url.$local_user['id'],1326 'U_PERM' => $perm_url.$local_user['id'],1327 'USERNAME' => stripslashes($local_user['username'])1323 $template->append( 1324 'users', 1325 array( 1326 'ID' => $local_user['id'], 1327 'CHECKED' => $checked, 1328 'U_PROFILE' => $profile_url.$local_user['id'], 1329 'U_PERM' => $perm_url.$local_user['id'], 1330 'USERNAME' => stripslashes($local_user['username']) 1328 1331 .($local_user['id'] == $conf['guest_id'] 1329 1332 ? '<BR>['.l10n('is_the_guest').']' : '') … … 1332 1335 'STATUS' => l10n('user_status_' 1333 1336 .$local_user['status']), 1334 'EMAIL' => get_email_address_as_display_text($local_user['email']),1335 'GROUPS' => $groups_string,1336 'REGISTRATION' => $local_user['registration_date'],1337 'REMINDER' => $reminder,1338 'EXPIRATION' => $expiration,1339 )1340 );1341 }1337 'EMAIL' => get_email_address_as_display_text($local_user['email']), 1338 'GROUPS' => $groups_string, 1339 'REGISTRATION' => $local_user['registration_date'], 1340 'REMINDER' => $reminder, 1341 'EXPIRATION' => $expiration, 1342 ) 1343 ); 1344 } 1342 1345 1343 1346 // Check if validation of register is made by admin or visitor … … 1358 1361 // ----------------------- 1359 1362 $template->assign( 1360 1363 array( 1361 1364 'CONFIRM_LOCAL'=> $Confirm_Local, 1362 1365 'UAM_VERSION' => $version, … … 1368 1371 // | errors display | 1369 1372 // +-----------------------------------------------------------------------+ 1370 if ( isset ($errors) and count($errors) != 0)1371 {1372 $template->assign('errors',array());1373 foreach ($errors as $error)1374 {1375 array_push($page['errors'], $error);1376 }1377 }1373 if ( isset ($errors) and count($errors) != 0) 1374 { 1375 $template->assign('errors',array()); 1376 foreach ($errors as $error) 1377 { 1378 array_push($page['errors'], $error); 1379 } 1380 } 1378 1381 1379 1382 // +-----------------------------------------------------------------------+ 1380 1383 // | templates display | 1381 1384 // +-----------------------------------------------------------------------+ 1382 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/usermanager.tpl');1383 1384 }1385 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/usermanager.tpl'); 1386 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 1387 } 1385 1388 else 1386 1389 { 1387 array_push($page['errors'], l10n('UAM_Err_UserManager_Settings'));1390 array_push($page['errors'], l10n('UAM_Err_UserManager_Settings')); 1388 1391 } 1389 1392 break; … … 1395 1398 // +-----------------------------------------------------------------------+ 1396 1399 // ************************************************************************* 1397 1400 case 'ghosttracker': 1398 1401 1399 1402 $conf_UAM = unserialize($conf['UserAdvManager']); … … 1405 1408 // +-----------------------------------------------------------------------+ 1406 1409 1407 if (!defined('PHPWG_ROOT_PATH'))1408 1409 1410 1410 if (!defined('PHPWG_ROOT_PATH')) 1411 { 1412 die('Hacking attempt!'); 1413 } 1411 1414 1412 1415 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 1413 1416 1414 1417 // +-----------------------------------------------------------------------+ 1415 1418 // | Check Access and exit when user status is not ok | 1416 1419 // +-----------------------------------------------------------------------+ 1417 check_status(ACCESS_ADMINISTRATOR);1420 check_status(ACCESS_ADMINISTRATOR); 1418 1421 1419 1422 // +-----------------------------------------------------------------------+ … … 1421 1424 // +-----------------------------------------------------------------------+ 1422 1425 1423 $page['filtered_users'] = get_ghost_user_list();1426 $page['filtered_users'] = get_ghost_user_list(); 1424 1427 1425 1428 // +-----------------------------------------------------------------------+ 1426 1429 // | selected users | 1427 1430 // +-----------------------------------------------------------------------+ 1428 if (isset($_POST['Del_Selected']))1429 {1430 $collection = array();1431 1432 switch ($_POST['target'])1433 {1434 case 'all' :1435 {1436 foreach($page['filtered_users'] as $local_user)1437 1438 array_push($collection, $local_user['id']);1439 1440 break;1441 }1442 case 'selection' :1443 {1444 if (isset($_POST['selection']))1445 {1446 $collection = $_POST['selection'];1447 }1448 1449 }1450 }1451 1452 if (count($collection) == 0)1453 {1454 array_push($page['errors'], l10n('Select at least one user'));1455 }1456 }1431 if (isset($_POST['Del_Selected'])) 1432 { 1433 $collection = array(); 1434 1435 switch ($_POST['target']) 1436 { 1437 case 'all' : 1438 { 1439 foreach($page['filtered_users'] as $local_user) 1440 { 1441 array_push($collection, $local_user['id']); 1442 } 1443 break; 1444 } 1445 case 'selection' : 1446 { 1447 if (isset($_POST['selection'])) 1448 { 1449 $collection = $_POST['selection']; 1450 } 1451 break; 1452 } 1453 } 1454 1455 if (count($collection) == 0) 1456 { 1457 array_push($page['errors'], l10n('Select at least one user')); 1458 } 1459 } 1457 1460 1458 1461 // +-----------------------------------------------------------------------+ 1459 1462 // | delete users | 1460 1463 // +-----------------------------------------------------------------------+ 1461 if (isset($_POST['Del_Selected']) and count($collection) > 0)1462 {1463 if (in_array($conf['guest_id'], $collection))1464 {1465 array_push($page['errors'], l10n('Guest cannot be deleted'));1466 }1467 if (($conf['guest_id'] != $conf['default_user_id']) and1468 in_array($conf['default_user_id'], $collection))1469 {1470 array_push($page['errors'], l10n('Default user cannot be deleted'));1471 }1472 if (in_array($conf['webmaster_id'], $collection))1473 {1474 array_push($page['errors'], l10n('Webmaster cannot be deleted'));1475 }1476 if (in_array($user['id'], $collection))1477 {1478 array_push($page['errors'], l10n('You cannot delete your account'));1479 }1480 1481 if (count($page['errors']) == 0)1482 {1483 foreach ($collection as $user_id)1484 {1485 delete_user($user_id);1486 }1487 array_push(1488 $page['infos'],1489 l10n_dec(1490 '%d user deleted', '%d users deleted',1491 count($collection)1492 )1493 );1494 1495 foreach ($page['filtered_users'] as $filter_key => $filter_user)1496 {1497 if (in_array($filter_user['id'], $collection))1498 {1499 unset($page['filtered_users'][$filter_key]);1500 }1501 }1502 }1503 }1464 if (isset($_POST['Del_Selected']) and count($collection) > 0) 1465 { 1466 if (in_array($conf['guest_id'], $collection)) 1467 { 1468 array_push($page['errors'], l10n('Guest cannot be deleted')); 1469 } 1470 if (($conf['guest_id'] != $conf['default_user_id']) and 1471 in_array($conf['default_user_id'], $collection)) 1472 { 1473 array_push($page['errors'], l10n('Default user cannot be deleted')); 1474 } 1475 if (in_array($conf['webmaster_id'], $collection)) 1476 { 1477 array_push($page['errors'], l10n('Webmaster cannot be deleted')); 1478 } 1479 if (in_array($user['id'], $collection)) 1480 { 1481 array_push($page['errors'], l10n('You cannot delete your account')); 1482 } 1483 1484 if (count($page['errors']) == 0) 1485 { 1486 foreach ($collection as $user_id) 1487 { 1488 delete_user($user_id); 1489 } 1490 array_push( 1491 $page['infos'], 1492 l10n_dec( 1493 '%d user deleted', '%d users deleted', 1494 count($collection) 1495 ) 1496 ); 1497 1498 foreach ($page['filtered_users'] as $filter_key => $filter_user) 1499 { 1500 if (in_array($filter_user['id'], $collection)) 1501 { 1502 unset($page['filtered_users'][$filter_key]); 1503 } 1504 } 1505 } 1506 } 1504 1507 1505 1508 // +-----------------------------------------------------------------------+ … … 1509 1512 // | selected users | 1510 1513 // +-----------------------------------------------------------------------+ 1511 if (isset($_POST['Reminder_Email']))1512 {1513 $collection = array();1514 1515 switch ($_POST['target'])1516 {1517 case 'all' :1518 {1519 foreach($page['filtered_users'] as $local_user)1520 {1521 array_push($collection, $local_user['id']);1522 }1523 1524 }1525 case 'selection' :1526 {1527 if (isset($_POST['selection']))1528 {1529 $collection = $_POST['selection'];1530 }1531 1532 }1533 }1534 1535 if (count($collection) == 0)1536 {1537 array_push($page['errors'], l10n('Select at least one user'));1538 }1539 }1514 if (isset($_POST['Reminder_Email'])) 1515 { 1516 $collection = array(); 1517 1518 switch ($_POST['target']) 1519 { 1520 case 'all' : 1521 { 1522 foreach($page['filtered_users'] as $local_user) 1523 { 1524 array_push($collection, $local_user['id']); 1525 } 1526 break; 1527 } 1528 case 'selection' : 1529 { 1530 if (isset($_POST['selection'])) 1531 { 1532 $collection = $_POST['selection']; 1533 } 1534 break; 1535 } 1536 } 1537 1538 if (count($collection) == 0) 1539 { 1540 array_push($page['errors'], l10n('Select at least one user')); 1541 } 1542 } 1540 1543 // +-----------------------------------------------------------------------+ 1541 1544 // | Send ghost reminder | 1542 1545 // +-----------------------------------------------------------------------+ 1543 if (isset($_POST['Reminder_Email']) and count($collection) > 0)1544 {1545 if (in_array($conf['guest_id'], $collection))1546 {1547 array_push($page['errors'], l10n('UAM_No_reminder_for_Guest'));1548 1549 if (($conf['guest_id'] != $conf['default_user_id']) and1550 in_array($conf['default_user_id'], $collection))1551 {1552 array_push($page['errors'], l10n('UAM_No_reminder_for_default_user'));1553 }1554 if (in_array($conf['webmaster_id'], $collection))1555 {1556 array_push($page['errors'], l10n('UAM_No_reminder_for_Webmaster'));1557 }1558 if (in_array($user['id'], $collection))1559 {1560 array_push($page['errors'], l10n('UAM_No_reminder_for_your_account'));1561 1562 1563 if (count($page['errors']) == 0)1564 {1565 foreach ($collection as $user_id)1566 {1567 $query = "1546 if (isset($_POST['Reminder_Email']) and count($collection) > 0) 1547 { 1548 if (in_array($conf['guest_id'], $collection)) 1549 { 1550 array_push($page['errors'], l10n('UAM_No_reminder_for_Guest')); 1551 } 1552 if (($conf['guest_id'] != $conf['default_user_id']) and 1553 in_array($conf['default_user_id'], $collection)) 1554 { 1555 array_push($page['errors'], l10n('UAM_No_reminder_for_default_user')); 1556 } 1557 if (in_array($conf['webmaster_id'], $collection)) 1558 { 1559 array_push($page['errors'], l10n('UAM_No_reminder_for_Webmaster')); 1560 } 1561 if (in_array($user['id'], $collection)) 1562 { 1563 array_push($page['errors'], l10n('UAM_No_reminder_for_your_account')); 1564 } 1565 1566 if (count($page['errors']) == 0) 1567 { 1568 foreach ($collection as $user_id) 1569 { 1570 $query = ' 1568 1571 SELECT id, username, mail_address 1569 FROM ".USERS_TABLE."1570 WHERE id = ' ".$user_id."'1571 ; ";1572 FROM '.USERS_TABLE.' 1573 WHERE id = '.$user_id.' 1574 ;'; 1572 1575 1573 $data = pwg_db_fetch_assoc(pwg_query($query));1576 $data = pwg_db_fetch_assoc(pwg_query($query)); 1574 1577 1575 ghostreminder($user_id,stripslashes($data['username']),$data['mail_address']);1576 }1577 array_push(1578 $page['infos'],1579 l10n_dec(1580 1581 count($collection)1582 )1583 );1584 1585 $page['filtered_users'] = get_ghost_user_list();1586 }1587 }1578 ghostreminder($user_id,stripslashes($data['username']),$data['mail_address']); 1579 } 1580 array_push( 1581 $page['infos'], 1582 l10n_dec( 1583 'UAM_%d_Reminder_Sent', 'UAM_%d_Reminders_Sent', 1584 count($collection) 1585 ) 1586 ); 1587 1588 $page['filtered_users'] = get_ghost_user_list(); 1589 } 1590 } 1588 1591 1589 1592 if (isset($_POST['GhostTracker_Init']) and is_admin()) //Reset is only allowed for admins ! 1590 1593 { 1591 1594 $query1 = ' 1592 1595 SELECT * 1593 1596 FROM '.USER_LASTVISIT_TABLE.';'; … … 1597 1600 if ($count <> 0) 1598 1601 { 1599 1602 $query = ' 1600 1603 SELECT DISTINCT u.id, 1601 1604 ui.status AS status … … 1616 1619 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 1617 1620 1618 $query = " 1619 INSERT INTO ".USER_LASTVISIT_TABLE." (user_id, lastvisit, reminder) 1620 VALUES ('".$row['id']."','".$dbnow."','false') 1621 ;"; 1621 $query = ' 1622 INSERT INTO '.USER_LASTVISIT_TABLE.' 1623 (user_id, lastvisit, reminder) 1624 VALUES ('.$row['id'].',"'.$dbnow.'","false") 1625 ;'; 1622 1626 pwg_query($query); 1623 1627 } … … 1643 1647 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 1644 1648 1645 $query = " 1646 INSERT INTO ".USER_LASTVISIT_TABLE." (user_id, lastvisit, reminder) 1647 VALUES ('".$row['id']."','".$dbnow."','false') 1648 ;"; 1649 $query = ' 1650 INSERT INTO '.USER_LASTVISIT_TABLE.' 1651 (user_id, lastvisit, reminder) 1652 VALUES ('.$row['id'].',"'.$dbnow.'","false") 1653 ;'; 1649 1654 pwg_query($query); 1650 1655 } … … 1662 1667 { 1663 1668 $visible_user_list[] = $local_user; 1664 }1669 } 1665 1670 1666 foreach ($visible_user_list as $local_user)1667 1668 1671 foreach ($visible_user_list as $local_user) 1672 { 1673 $reminder = ''; 1669 1674 1670 1675 if (isset($local_user['reminder']) and $local_user['reminder'] == 'true') … … 1678 1683 1679 1684 if (isset($_POST['pref_submit']) and isset($_POST['selection']) and in_array($local_user['id'], $_POST['selection'])) 1680 {1681 $checked = 'checked="checked"';1682 }1683 else1684 {1685 $checked = '';1686 1685 { 1686 $checked = 'checked="checked"'; 1687 } 1688 else 1689 { 1690 $checked = ''; 1691 } 1687 1692 1688 1693 // Template initialization … … 1691 1696 'users', 1692 1697 array( 1693 'ID' => $local_user['id'],1698 'ID' => $local_user['id'], 1694 1699 'CHECKED' => $checked, 1695 1700 'USERNAME' => stripslashes($local_user['username']), 1696 'EMAIL' => get_email_address_as_display_text($local_user['email']),1701 'EMAIL' => get_email_address_as_display_text($local_user['email']), 1697 1702 'LASTVISIT' => $local_user['lastvisit'], 1698 1703 'REMINDER' => $reminder, 1699 )1700 );1701 }1704 ) 1705 ); 1706 } 1702 1707 1703 1708 // Plugin version inserted … … 1713 1718 // | errors display | 1714 1719 // +-----------------------------------------------------------------------+ 1715 if ( isset ($errors) and count($errors) != 0)1716 {1717 $template->assign('errors',array());1718 foreach ($errors as $error)1719 {1720 array_push($page['errors'], $error);1721 }1722 }1720 if ( isset ($errors) and count($errors) != 0) 1721 { 1722 $template->assign('errors',array()); 1723 foreach ($errors as $error) 1724 { 1725 array_push($page['errors'], $error); 1726 } 1727 } 1723 1728 1724 1729 // +-----------------------------------------------------------------------+ 1725 1730 // | templates display | 1726 1731 // +-----------------------------------------------------------------------+ 1727 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/ghosttracker.tpl');1732 $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/template/ghosttracker.tpl'); 1728 1733 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 1729 }1734 } 1730 1735 else 1731 1736 { 1732 array_push($page['errors'], l10n('UAM_Err_GhostTracker_Settings'));1737 array_push($page['errors'], l10n('UAM_Err_GhostTracker_Settings')); 1733 1738 } 1734 1739 -
extensions/UserAdvManager/branches/2.40/admin/template/global.tpl
r14730 r18160 231 231 <fieldset> 232 232 <ul> 233 <p class="new_in_version">{'UAM_NewFeature'|@translate}</p>234 233 <li> 235 <div class="uam_new">236 234 <label class="cluetip" title="{'UAM_AdminValidationMail_Subject'|translate}|{'UAM_AdminValidationMail_Subject_d'|translate}"> 237 235 {'UAM_AdminValidationMail_Subject'|@translate} … … 240 238 <textarea class="uam_textfields" name="UAM_AdminValidationMail_Subject" id="UAM_AdminValidationMail_Subject" rows="5" {$TAG_INPUT_ENABLED}>{$UAM_ADMINVALIDATIONMAIL_SUBJECT}</textarea> 241 239 <br><br> 242 </div>243 240 </li> 244 241 … … 256 253 257 254 <ul> 258 <p class="new_in_version">{'UAM_NewFeature'|@translate}</p>259 255 <li> 260 <div class="uam_new">261 256 <label class="cluetip" title="{'UAM_ConfirmMail_Subject'|translate}|{'UAM_ConfirmMail_Subject_d'|translate}"> 262 257 {'UAM_ConfirmMail_Subject'|@translate} … … 265 260 <textarea class="uam_textfields" name="UAM_ConfirmMail_Subject" id="UAM_ConfirmMail_Subject" rows="5" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_SUBJECT}</textarea> 266 261 <br><br> 267 </div>268 262 </li> 269 263 … … 485 479 486 480 <ul> 487 <p class="new_in_version">{'UAM_NewFeature'|@translate}</p>488 481 <li> 489 <div class="uam_new">490 482 <label class="cluetip" title="{'UAM_ConfirmMail_ReMail_Subject'|translate}|{'UAM_ConfirmMail_ReMail_Subject_d'|translate}"> 491 483 {'UAM_ConfirmMail_ReMail_Subject'|@translate} … … 494 486 <textarea class="uam_textfields" name="UAM_ConfirmMail_Remail_Subject" id="UAM_ConfirmMail_Remail_Subject" rows="5" {$TAG_INPUT_ENABLED}>{$UAM_CONFIRMMAIL_REMAIL_SUBJECT}</textarea> 495 487 <br><br> 496 </div>497 488 </li> 498 489 … … 632 623 <fieldset> 633 624 <ul> 634 <p class="new_in_version">{'UAM_NewFeature'|@translate}</p>635 625 <li> 636 <div class="uam_new">637 626 <label class="cluetip" title="{'UAM_GTReminder_Subject'|translate}|{'UAM_GTReminder_Subject_d'|translate}"> 638 627 {'UAM_GTReminder_Subject'|@translate} … … 641 630 <textarea class="uam_textfields" name="UAM_GTReminder_Subject" id="UAM_GTReminder_Subject" rows="5" {$TAG_INPUT_ENABLED}>{$UAM_GTREMINDER_SUBJECT}</textarea> 642 631 <br><br> 643 </div>644 632 </li> 645 633 … … 746 734 {'UAM_Enable'|@translate} 747 735 <br><br> 748 <p class="new_in_version">{'UAM_NewFeature'|@translate}</p>749 736 <li> 750 <div class="uam_new">751 737 <label class="cluetip" title="{'UAM_GTAutomail_Subject'|translate}|{'UAM_GTAutomail_Subject_d'|translate}"> 752 738 {'UAM_GTAutomail_Subject'|@translate} … … 755 741 <textarea class="uam_textfields" name="UAM_GTAutoMail_Subject" id="UAM_GTAutoMail_Subject" rows="5" {$TAG_INPUT_ENABLED}>{$UAM_GTAUTOMAIL_SUBJECT}</textarea> 756 742 <br><br> 757 </div>758 743 </li> 759 744 … … 823 808 </li> 824 809 825 <p class="new_in_version">{'UAM_NewFeature'|@translate}</p>826 810 <li> 827 <div class="uam_new">828 811 <label class="cluetip" title="{'UAM_MailInfo_Subject'|translate}|{'UAM_MailInfo_Subject_d'|translate}"> 829 812 {'UAM_MailInfo_Subject'|@translate} … … 832 815 <textarea class="uam_textfields" name="UAM_InfoMail_Subject" id="UAM_InfoMail_Subject" rows="5" {$TAG_INPUT_ENABLED}>{$UAM_INFOMAIL_SUBJECT}</textarea> 833 816 <br><br> 834 </div>835 817 </li> 836 818 -
extensions/UserAdvManager/branches/2.40/admin/template/usermanager.tpl
r13107 r18160 96 96 {if $CONFIRM_LOCAL == "local"} 97 97 <input class="submit" type="submit" value="{'UAM_Delete_selected'|@translate}" name="Del_Selected"> 98 <input class="submit" type="submit" value="{'UAM_ Force_Validation'|@translate}" name="Force_Validation">98 <input class="submit" type="submit" value="{'UAM_Manual_Validation'|@translate}" name="Manual_Validation"> 99 99 {else} 100 100 <input class="submit" type="submit" value="{'UAM_Delete_selected'|@translate}" name="Del_Selected"> 101 101 <input class="submit" type="submit" value="{'UAM_Mail_without_key'|@translate}" name="Mail_Without_Key"> 102 102 <input class="submit" type="submit" value="{'UAM_Mail_with_key'|@translate}" name="Mail_With_Key"> 103 <input class="submit" type="submit" value="{'UAM_ Force_Validation'|@translate}" name="Force_Validation">103 <input class="submit" type="submit" value="{'UAM_Manual_Validation'|@translate}" name="Manual_Validation"> 104 104 {/if} 105 105 </p> -
extensions/UserAdvManager/branches/2.40/changelog.txt.php
r17809 r18160 300 300 Bug 2740 fixed - Loggin rejection on unvalidated user connection does not work 301 301 302 -- 2.30.9 : Bug 2744 fixed - User connexion rejection does not work if no group/status/privacy is set 303 302 304 ************************************************************** 303 305 ***** Plugin history (branch 2.40 - Piwigo 2.4 compliant)***** … … 337 339 Update es_ES, thanks to : jpr928 338 340 Update it_IT, thanks to : Ericnet and virgigiole 341 342 -- 2.40.6 : Bug 2744 fixed - User connexion rejection does not work if no group/status/privacy is set 343 Bug 2749 fixed - regex meta-characters are usable in character exclusion in usernames 344 New unvalidated user controls more efficient 345 Get admins emails instead of webmaster's for sending validation email 346 TODO - New simplifed administration panel 339 347 */ 340 348 ?> -
extensions/UserAdvManager/branches/2.40/include/functions.inc.php
r17805 r18160 19 19 array_push($menu, 20 20 array( 21 22 21 'NAME' => $name, 22 'URL' => get_root_url().'admin.php?page=plugin-'.basename(UAM_PATH) 23 23 ) 24 24 ); … … 36 36 { 37 37 global $conf, $page; 38 39 $conf_UAM = unserialize($conf['UserAdvManager']); 38 40 39 41 // Check mandatory email address for email exclusion 40 $conf_UAM = unserialize($conf['UserAdvManager']);41 42 if (!$conf['obligatory_user_mail_address'] and $conf_UAM[10] = 'true') 42 43 { … … 51 52 * Initiating GhostTracker - Perform user logout after registration if not validated 52 53 */ 53 function UAM_ GhostTracker()54 function UAM_Init() 54 55 { 55 56 global $conf, $user; … … 66 67 { 67 68 68 69 $userid = get_userid($user['username']); 69 70 70 71 // Looking for existing entry in last visit table … … 101 102 } 102 103 } 103 } 104 105 // Perform user logout after registration if not validated 106 if ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and !UAM_UsrReg_Verif($user['id'])) 107 { 108 invalidate_user_cache(); 109 logout_user(); 110 redirect(UAM_PATH.'rejected.php'); 104 105 // Perform user logout after registration if not validated 106 if ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and !is_webmaster() ) 107 { 108 invalidate_user_cache(); 109 logout_user(); 110 if ( $conf['guest_access'] ) 111 { 112 redirect( make_index_url().'?UAM_msg=rejected', 0); 113 } 114 else 115 { 116 redirect( get_root_url().'identification.php?UAM_msg=rejected' , 0); 117 } 118 } 111 119 } 112 120 } … … 135 143 // ---------------------------------------------------------------------------------------------- 136 144 SetPermission($register_user['id']);// Set to "waiting" group or status until admin validation 145 146 // This is to set UAM_validated field to false in #_users table - Usefull if no "waiting" group or status is set 147 // ------------------------------------------------------------------------------------------------------------- 148 SetUnvalidated($register_user['id']); 149 150 // This is to send the validation key by email to admins for their manual validation without having to connect the gallery 151 // ----------------------------------------------------------------------------------------------------------------------- 152 SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true); 137 153 } 138 154 // Sending registration confirmation by email … … 261 277 $user_idsOK[] = $user['id']; 262 278 263 $query = "264 UPDATE ".CONFIG_TABLE."265 SET value = \"".implode(',', $user_idsOK)."\"266 WHERE param = 'UserAdvManager_Redir';";279 $query = ' 280 UPDATE '.CONFIG_TABLE.' 281 SET value = "'.implode(',', $user_idsOK).'" 282 WHERE param = "UserAdvManager_Redir";'; 267 283 268 284 pwg_query($query); … … 317 333 if (!empty($_POST['use_new_pwd'])) 318 334 { 319 $typemail = 2; // Confirmation email on user profile update - With information email if checked335 $typemail = 2; // Confirmation email on user profile update - With information email 320 336 321 337 // Password enforcement control … … 356 372 { 357 373 SetPermission($user['id']);// Set to "waiting" group or status until user validation 374 SetUnvalidated($user['id']); // Set UAM_validated field to false in #_users table 358 375 $confirm_mail_need = true; 359 376 } … … 364 381 { 365 382 SetPermission($user['id']);// Set to "waiting" group or status until admin validation 383 SetUnvalidated($user['id']); // Set UAM_validated field to false in #_users table 366 384 $confirm_mail_need = false; 367 385 } … … 455 473 } 456 474 } 457 elseif ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and !UAM_UsrReg_Verif($user['id']) )475 elseif ((isset($conf_UAM[39]) and $conf_UAM[39] == 'true') and !UAM_UsrReg_Verif($user['id']) and !is_admin() and !is_webmaster()) 458 476 { 459 477 // Logged-in user cleanup, session destruction and redirected to custom page … … 461 479 invalidate_user_cache(); 462 480 logout_user(); 463 redirect(UAM_PATH.'rejected.php'); 481 if ( $conf['guest_access'] ) 482 { 483 redirect( make_index_url().'?UAM_msg=rejected', 0); 484 } 485 else 486 { 487 redirect( get_root_url().'identification.php?UAM_msg=rejected' , 0); 488 } 464 489 } 465 490 } … … 512 537 } 513 538 514 // GhostTracker auto group, status or privacy level downgrade with or without information email sendingand autodeletion if user already reminded515 // --------------------------------------------------------------------------------------- -------------------------------------------------------539 // Auto group, status or privacy level downgrade and autodeletion if user already reminded 540 // --------------------------------------------------------------------------------------- 516 541 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) or (isset($conf_UAM[37]) and $conf_UAM[37] <> -1))) 517 542 { 518 543 if (count($collection) > 0) 519 {544 { 520 545 // Process if a non-admin nor webmaster user is logged 521 546 // --------------------------------------------------- 522 547 if (in_array($user['id'], $collection)) 523 548 { 524 549 // Check lastvisit reminder state 525 550 // ------------------------------ … … 554 579 redirect(UAM_PATH.'GT_del_account.php'); 555 580 } 556 }581 } 557 582 else // Process if an admin or webmaster user is logged 558 583 { … … 585 610 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 586 611 587 $query = "588 UPDATE ".USER_LASTVISIT_TABLE."589 SET lastvisit= '".$dbnow."'590 WHERE user_id = ' ".$user_id."'591 ; ";612 $query = ' 613 UPDATE '.USER_LASTVISIT_TABLE.' 614 SET lastvisit="'.$dbnow.'" 615 WHERE user_id = '.$user_id.' 616 ;'; 592 617 pwg_query($query); 593 618 … … 596 621 // Delete user from all groups 597 622 // --------------------------- 598 $query = " 599 DELETE FROM ".USER_GROUP_TABLE." 600 WHERE user_id = '".$user_id."' 623 if ($conf_UAM[2] <> -1 and $conf_UAM[3] <> -1) 624 { 625 $query = ' 626 DELETE FROM '.USER_GROUP_TABLE.' 627 WHERE user_id = '.$user_id.' 601 628 AND ( 602 group_id = ' ".$conf_UAM[2]."'629 group_id = '.$conf_UAM[2].' 603 630 OR 604 group_id = ' ".$conf_UAM[3]."'631 group_id = '.$conf_UAM[3].' 605 632 ) 606 ;"; 607 pwg_query($query); 633 ;'; 634 pwg_query($query); 635 } 608 636 609 637 // Change user status … … 611 639 if ($conf_UAM[26] <> -1) 612 640 { 613 $query = "614 UPDATE ".USER_INFOS_TABLE."615 SET status = '".$conf_UAM[26]."'616 WHERE user_id = ' ".$user_id."'617 ; ";641 $query = ' 642 UPDATE '.USER_INFOS_TABLE.' 643 SET status = "'.$conf_UAM[26].'" 644 WHERE user_id = '.$user_id.' 645 ;'; 618 646 pwg_query($query); 619 647 } … … 623 651 if ($conf_UAM[25] <> -1) 624 652 { 625 $query = "626 INSERT INTO ".USER_GROUP_TABLE."653 $query = ' 654 INSERT INTO '.USER_GROUP_TABLE.' 627 655 (user_id, group_id) 628 656 VALUES 629 (' ".$user_id."', '".$conf_UAM[25]."')630 ; ";657 ('.$user_id.', "'.$conf_UAM[25].'") 658 ;'; 631 659 pwg_query($query); 632 660 } … … 636 664 if ($conf_UAM[37] <> -1) 637 665 { 638 $query = "639 UPDATE ".USER_INFOS_TABLE."640 SET level = '".$conf_UAM[37]."'641 WHERE user_id = ' ".$user_id."'642 ; ";666 $query = ' 667 UPDATE '.USER_INFOS_TABLE.' 668 SET level = "'.$conf_UAM[37].'" 669 WHERE user_id = '.$user_id.' 670 ;'; 643 671 pwg_query($query); 644 672 } … … 650 678 // Set reminder true 651 679 // ----------------- 652 $query = "653 UPDATE ".USER_LASTVISIT_TABLE."654 SET reminder = 'true'655 WHERE user_id = ' ".$user_id."'656 ; ";680 $query = ' 681 UPDATE '.USER_LASTVISIT_TABLE.' 682 SET reminder = "true" 683 WHERE user_id = '.$user_id.' 684 ;'; 657 685 pwg_query($query); 658 686 659 687 // Reset confirmed user status to unvalidated 660 688 // ------------------------------------------ 661 $query = '689 $query = ' 662 690 UPDATE '.USER_CONFIRM_MAIL_TABLE.' 663 691 SET date_check = NULL 664 WHERE user_id = "'.$user_id.'"665 ;'; 666 pwg_query($query);692 WHERE user_id = '.$user_id.' 693 ;'; 694 pwg_query($query); 667 695 668 696 // Get users information for email notification 669 697 // -------------------------------------------- 670 $query = '698 $query = ' 671 699 SELECT id, username, mail_address 672 700 FROM '.USERS_TABLE.' 673 701 WHERE id = '.$user_id.' 674 702 ;'; 675 $data = pwg_db_fetch_assoc(pwg_query($query));703 $data = pwg_db_fetch_assoc(pwg_query($query)); 676 704 677 705 demotion_mail($user_id, $data['username'], $data['mail_address']); … … 725 753 { 726 754 if (count($collection) > 0) 727 {755 { 728 756 // Process if a non-admin nor webmaster user is logged 729 757 // --------------------------------------------------- 730 758 if (in_array($user['id'], $collection)) 731 {759 { 732 760 // Check ConfirmMail reminder state 733 761 // -------------------------------- … … 752 780 if (!$reminder and isset($conf_UAM[32]) and $conf_UAM[32] == 'true') 753 781 { 754 $typemail = 1;782 $typemail = 1; 755 783 756 784 // Get current user informations 757 785 // ----------------------------- 758 $query = "786 $query = ' 759 787 SELECT id, username, mail_address 760 FROM ".USERS_TABLE."761 WHERE id = ' ".$user['id']."'762 ; ";788 FROM '.USERS_TABLE.' 789 WHERE id = '.$user['id'].' 790 ;'; 763 791 $data = pwg_db_fetch_assoc(pwg_query($query)); 764 792 … … 779 807 redirect(UAM_PATH.'USR_del_account.php'); 780 808 } 781 }809 } 782 810 else // Process if an admin or webmaster user is logged 783 811 { … … 810 838 // Get current user informations 811 839 // ----------------------------- 812 $query = "840 $query = ' 813 841 SELECT id, username, mail_address 814 FROM ".USERS_TABLE."815 WHERE id = ' ".$user_id."'816 ; ";842 FROM '.USERS_TABLE.' 843 WHERE id = '.$user_id.' 844 ;'; 817 845 $data = pwg_db_fetch_assoc(pwg_query($query)); 818 846 … … 861 889 } 862 890 891 /** 892 * Triggered on init 893 * 894 * Display a message according to $_GET['UAM_msg'] 895 */ 896 function UAM_DisplayMsg() 897 { 898 if( isset($_GET['UAM_msg'])) 899 { 900 global $user, $lang, $conf, $page; 901 $conf_UAM = unserialize($conf['UserAdvManager']); 902 903 if (isset($conf_UAM[40]) and $conf_UAM[40] <> '' and $_GET['UAM_msg']="rejected") 904 { 905 // Management of Extension flags ([mygallery], [myurl]) 906 // --------------------------------------------------- 907 $patterns[] = '#\[mygallery\]#i'; 908 $replacements[] = $conf['gallery_title']; 909 $patterns[] = '#\[myurl\]#i'; 910 $replacements[] = get_gallery_home_url(); 911 912 if (function_exists('get_user_language_desc')) 913 { 914 $custom_text = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[40])); 915 } 916 else $custom_text = l10n(preg_replace($patterns, $replacements, $conf_UAM[40])); 917 $page["errors"][]=$custom_text; 918 } 919 } 920 } 863 921 864 922 /** … … 906 964 907 965 $conf_UAM = unserialize($conf['UserAdvManager']); 908 909 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');910 911 $infos1_perso = "";966 967 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 968 969 $infos1_perso = ""; 912 970 $infos2_perso = ""; 913 971 $subject = ""; … … 961 1019 break; 962 1020 963 case 2: // Confirmation email on user profile update - With information email if checked1021 case 2: // Confirmation email on user profile update - With information email if modification done in user profile 964 1022 if (isset($conf_UAM[41]) and $conf_UAM[41] <> '') 965 1023 { … … 1086 1144 } 1087 1145 1088 if ( isset($conf_UAM[1]) and $conf_UAM[1] == 'true'and $confirm) // Add confirmation link ?1146 if (isset($conf_UAM[1]) and ($conf_UAM[1] == 'true' or $conf_UAM[1] == 'local') and $confirm) // Add confirmation link ? 1089 1147 { 1090 1148 $infos2 = array … … 1121 1179 // Sending the email with subject and contents 1122 1180 // ------------------------------------------- 1123 pwg_mail($email, array( 1124 'subject' => $subject, 1125 'content' => (isset($infos1) ? $infos1_perso.l10n_args($infos1)."\n\n" : "").(isset($infos2) ? $infos2_perso.l10n_args($infos2)."\n\n" : "").get_absolute_root_url(), 1126 )); 1127 1181 if (isset($conf_UAM[1]) and $conf_UAM[1] == 'local') 1182 { 1183 switch_lang_to(get_default_language()); 1184 1185 load_language('plugin.lang', UAM_PATH); 1186 $subject = get_l10n_args('UAM_Subject admin validation for %s',$username); 1187 1188 $content = array( 1189 get_l10n_args('UAM_Manual_validation_needed_for %s', stripslashes($username)), 1190 get_l10n_args('', ''), 1191 get_l10n_args('UAM_Link: %s', AddConfirmMail($id, $email)), 1192 ); 1193 1194 UAM_mail_notification_admins($subject, $content); 1195 } 1196 else 1197 { 1198 pwg_mail($email, array( 1199 'subject' => $subject, 1200 'content' => (isset($infos1) ? $infos1_perso.l10n_args($infos1)."\n\n" : "").(isset($infos2) ? $infos2_perso.l10n_args($infos2)."\n\n" : "").get_absolute_root_url(), 1201 )); 1202 } 1128 1203 // Switching back to default language 1129 1204 // ---------------------------------- … … 1133 1208 1134 1209 /** 1210 * Function called from SendMail2User in functions.inc.php to notify admins on user registration validation with validation key 1211 * 1212 * @param: 1213 * - keyargs_subject: mail subject on l10n_args format 1214 * - keyargs_content: mail content on l10n_args format 1215 * 1216 * @return boolean (Ok or not) 1217 */ 1218 function UAM_mail_notification_admins($keyargs_subject, $keyargs_content) 1219 { 1220 global $conf, $user; 1221 1222 // Check arguments 1223 if (empty($keyargs_subject) or empty($keyargs_content)) 1224 { 1225 return false; 1226 } 1227 1228 $return = true; 1229 1230 $admins = array(); 1231 1232 $query = ' 1233 SELECT 1234 u.'.$conf['user_fields']['username'].' AS username, 1235 u.'.$conf['user_fields']['email'].' AS mail_address 1236 FROM '.USERS_TABLE.' AS u 1237 JOIN '.USER_INFOS_TABLE.' AS i ON i.user_id = u.'.$conf['user_fields']['id'].' 1238 WHERE i.status in (\'webmaster\', \'admin\') 1239 AND '.$conf['user_fields']['email'].' IS NOT NULL 1240 AND i.user_id <> '.$user['id'].' 1241 ORDER BY username 1242 ;'; 1243 1244 $datas = pwg_query($query); 1245 if (!empty($datas)) 1246 { 1247 while ($admin = pwg_db_fetch_assoc($datas)) 1248 { 1249 if (!empty($admin['mail_address'])) 1250 { 1251 array_push($admins, format_email($admin['username'], $admin['mail_address'])); 1252 } 1253 } 1254 } 1255 1256 if (count($admins) > 0) 1257 { 1258 $content = l10n_args($keyargs_content)."\n"; 1259 1260 $return = pwg_mail( 1261 implode(', ', $admins), 1262 array( 1263 'subject' => '['.$conf['gallery_title'].'] '.l10n_args($keyargs_subject), 1264 'content' => $content, 1265 'content_format' => 'text/plain', 1266 'email_format' => 'text/plain', 1267 ) 1268 ); 1269 } 1270 1271 return $return; 1272 } 1273 1274 1275 /** 1135 1276 * Function called from UAM_admin.php to resend validation email with or without new validation key 1136 1277 * … … 1148 1289 $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); 1149 1290 1150 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');1291 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 1151 1292 1152 1293 // We have to get the user's language in database … … 1187 1328 if (isset($conf_UAM_ConfirmMail[2]) and $conf_UAM_ConfirmMail[2] <> '' and isset($conf_UAM_ConfirmMail[3]) and $conf_UAM_ConfirmMail[3] == 'true' and $confirm) 1188 1329 { 1189 1330 // Management of Extension flags ([username], [mygallery], [myurl], [Kdays]) 1190 1331 // ------------------------------------------------------------------------- 1191 1332 $patterns[] = '#\[username\]#i'; … … 1213 1354 get_l10n_args('', ''), 1214 1355 ); 1215 }1356 } 1216 1357 1217 1358 // Set reminder true 1218 1359 // ----------------- 1219 $query = "1220 UPDATE ".USER_CONFIRM_MAIL_TABLE."1221 SET reminder = 'true'1222 WHERE user_id = ' ".$user_id."'1223 ; ";1360 $query = ' 1361 UPDATE '.USER_CONFIRM_MAIL_TABLE.' 1362 SET reminder = "true" 1363 WHERE user_id = '.$user_id.' 1364 ;'; 1224 1365 pwg_query($query); 1225 1366 1226 break;1367 break; 1227 1368 1228 1369 case 2: //Generating email content for remind without a new key … … 1269 1410 // Set reminder true 1270 1411 // ----------------- 1271 $query = "1272 UPDATE ".USER_CONFIRM_MAIL_TABLE."1273 SET reminder = 'true'1274 WHERE user_id = ' ".$user_id."'1275 ; ";1412 $query = ' 1413 UPDATE '.USER_CONFIRM_MAIL_TABLE.' 1414 SET reminder = "true" 1415 WHERE user_id = '.$user_id.' 1416 ;'; 1276 1417 pwg_query($query); 1277 1418 … … 1284 1425 )); 1285 1426 1286 // Switching back to default language1287 // ----------------------------------1288 switch_lang_back();1427 // Switching back to default language 1428 // ---------------------------------- 1429 switch_lang_back(); 1289 1430 } 1290 1431 … … 1303 1444 $subject = ""; 1304 1445 1305 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');1446 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 1306 1447 1307 1448 // We have to get the user's language in database … … 1367 1508 )); 1368 1509 1369 // Switching back to default language1370 // ----------------------------------1371 switch_lang_back();1510 // Switching back to default language 1511 // ---------------------------------- 1512 switch_lang_back(); 1372 1513 } 1373 1514 … … 1385 1526 $conf_UAM = unserialize($conf['UserAdvManager']); 1386 1527 1387 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');1388 1389 $custom_txt = "";1390 1528 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 1529 1530 $custom_txt = ""; 1531 $subject = ""; 1391 1532 1392 1533 // We have to get the user's language in database 1393 1534 // ---------------------------------------------- 1394 $query = '1535 $query = ' 1395 1536 SELECT user_id, language 1396 1537 FROM '.USER_INFOS_TABLE.' … … 1472 1613 )); 1473 1614 1474 // Switching back to default language1475 // ----------------------------------1476 switch_lang_back();1615 // Switching back to default language 1616 // ---------------------------------- 1617 switch_lang_back(); 1477 1618 } 1478 1619 … … 1490 1631 $conf_UAM = unserialize($conf['UserAdvManager']); 1491 1632 1492 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php');1493 1494 $custom_txt = "";1633 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 1634 1635 $custom_txt = ""; 1495 1636 $subject = ""; 1496 1637 … … 1544 1685 $subject = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[46]))."\n\n"; 1545 1686 } 1546 else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[46]))."\n\n"; 1687 else $subject = l10n(preg_replace($patterns, $replacements, $conf_UAM[46]))."\n\n"; 1547 1688 } 1548 1689 … … 1557 1698 $patterns[] = '#\[myurl\]#i'; 1558 1699 $replacements[] = get_gallery_home_url(); 1559 1560 1700 if (function_exists('get_user_language_desc')) 1561 1701 { 1562 1702 $custom_txt = get_user_language_desc(preg_replace($patterns, $replacements, $conf_UAM[27]))."\n\n"; 1563 1703 } 1564 else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[27]))."\n\n"; 1704 else $custom_txt = l10n(preg_replace($patterns, $replacements, $conf_UAM[27]))."\n\n"; 1565 1705 } 1566 1706 … … 1578 1718 )); 1579 1719 1580 // Switching back to default language1581 // ----------------------------------1582 switch_lang_back();1720 // Switching back to default language 1721 // ---------------------------------- 1722 switch_lang_back(); 1583 1723 } 1584 1724 … … 1595 1735 { 1596 1736 $id = generate_key(16); 1597 $query = "1737 $query = ' 1598 1738 SELECT COUNT(*) 1599 FROM ".USER_CONFIRM_MAIL_TABLE."1600 WHERE id = '".$id."'1601 ; ";1739 FROM '.USER_CONFIRM_MAIL_TABLE.' 1740 WHERE id = "'.$id.'" 1741 ;'; 1602 1742 list($count) = pwg_db_fetch_row(pwg_query($query)); 1603 1743 … … 1627 1767 if (isset($Confirm_Mail_ID)) 1628 1768 { 1629 $query = "1769 $query = ' 1630 1770 SELECT status 1631 FROM ".USER_INFOS_TABLE."1632 WHERE user_id = ' ".$user_id."'1633 ; ";1771 FROM '.USER_INFOS_TABLE.' 1772 WHERE user_id = '.$user_id.' 1773 ;'; 1634 1774 list($status) = pwg_db_fetch_row(pwg_query($query)); 1635 1775 1636 $query = "1637 INSERT INTO ".USER_CONFIRM_MAIL_TABLE."1776 $query = ' 1777 INSERT INTO '.USER_CONFIRM_MAIL_TABLE.' 1638 1778 (id, user_id, mail_address, status, date_check) 1639 1779 VALUES 1640 ( '".$Confirm_Mail_ID."', '".$user_id."', '".$email."', '".$status."', null)1641 ; ";1780 ("'.$Confirm_Mail_ID.'", '.$user_id.', "'.$email.'", "'.$status.'", null) 1781 ;'; 1642 1782 pwg_query($query); 1643 1783 1644 1784 // Delete user from all groups 1645 1785 // --------------------------- 1646 $query = "1647 DELETE FROM ".USER_GROUP_TABLE."1648 WHERE user_id = ' ".$user_id."'1786 $query = ' 1787 DELETE FROM '.USER_GROUP_TABLE.' 1788 WHERE user_id = '.$user_id.' 1649 1789 AND ( 1650 group_id = ' ".$conf_UAM[2]."'1790 group_id = '.$conf_UAM[2].' 1651 1791 OR 1652 group_id = ' ".$conf_UAM[3]."'1792 group_id = '.$conf_UAM[3].' 1653 1793 ) 1654 ; ";1794 ;'; 1655 1795 pwg_query($query); 1656 1796 … … 1659 1799 if (!is_admin() and $conf_UAM[7] <> -1) 1660 1800 { 1661 $query = "1662 UPDATE ".USER_INFOS_TABLE."1663 SET status = '".$conf_UAM[7]."'1664 WHERE user_id = ' ".$user_id."'1665 ; ";1801 $query = ' 1802 UPDATE '.USER_INFOS_TABLE.' 1803 SET status = "'.$conf_UAM[7].'" 1804 WHERE user_id = '.$user_id.' 1805 ;'; 1666 1806 pwg_query($query); 1667 1807 } … … 1671 1811 if (!is_admin() and $conf_UAM[2] <> -1) 1672 1812 { 1673 $query = "1674 INSERT INTO ".USER_GROUP_TABLE."1813 $query = ' 1814 INSERT INTO '.USER_GROUP_TABLE.' 1675 1815 (user_id, group_id) 1676 1816 VALUES 1677 (' ".$user_id."', '".$conf_UAM[2]."')1678 ; ";1817 ('.$user_id.', '.$conf_UAM[2].') 1818 ;'; 1679 1819 pwg_query($query); 1680 1820 } … … 1684 1824 if (!is_admin() and $conf_UAM[35] <> -1) 1685 1825 { 1686 $query = "1687 UPDATE ".USER_INFOS_TABLE."1688 SET level = '".$conf_UAM[35]."'1689 WHERE user_id = ' ".$user_id."'1690 ; ";1826 $query = ' 1827 UPDATE '.USER_INFOS_TABLE.' 1828 SET level = "'.$conf_UAM[35].'" 1829 WHERE user_id = '.$user_id.' 1830 ;'; 1691 1831 pwg_query($query); 1692 1832 } 1833 1834 // Set UAM_validated field to false in #_users table 1835 // ------------------------------------------------- 1836 SetUnvalidated($user_id); 1693 1837 1694 1838 return get_absolute_root_url().UAM_PATH.'ConfirmMail.php?key='.$Confirm_Mail_ID.'&userid='.$user_id; … … 1712 1856 // Groups cleanup 1713 1857 // -------------- 1714 $query = "1715 DELETE FROM ".USER_GROUP_TABLE."1716 WHERE user_id = ' ".$user_id."'1858 $query = ' 1859 DELETE FROM '.USER_GROUP_TABLE.' 1860 WHERE user_id = '.$user_id.' 1717 1861 AND ( 1718 group_id = ' ".$conf_UAM[2]."'1862 group_id = '.$conf_UAM[2].' 1719 1863 OR 1720 group_id = ' ".$conf_UAM[3]."'1864 group_id = '.$conf_UAM[3].' 1721 1865 ) 1722 ; ";1866 ;'; 1723 1867 pwg_query($query); 1724 1868 1725 1869 if (!is_admin() and $conf_UAM[7] <> -1) // Set status 1726 1870 { 1727 $query = "1728 UPDATE ".USER_INFOS_TABLE."1729 SET status = '".$conf_UAM[7]."'1730 WHERE user_id = ' ".$user_id."'1731 ; ";1871 $query = ' 1872 UPDATE '.USER_INFOS_TABLE.' 1873 SET status = "'.$conf_UAM[7].'" 1874 WHERE user_id = '.$user_id.' 1875 ;'; 1732 1876 pwg_query($query); 1733 1877 } … … 1735 1879 if (!is_admin() and $conf_UAM[2] <> -1) // Set group 1736 1880 { 1737 $query = "1738 INSERT INTO ".USER_GROUP_TABLE."1881 $query = ' 1882 INSERT INTO '.USER_GROUP_TABLE.' 1739 1883 (user_id, group_id) 1740 1884 VALUES 1741 (' ".$user_id."', '".$conf_UAM[2]."')1742 ; ";1885 ('.$user_id.', '.$conf_UAM[2].') 1886 ;'; 1743 1887 pwg_query($query); 1744 1888 } … … 1746 1890 if (!is_admin() and $conf_UAM[35] <> -1) // Set privacy level 1747 1891 { 1748 $query = "1749 INSERT INTO ".USER_INFOS_TABLE."1892 $query = ' 1893 INSERT INTO '.USER_INFOS_TABLE.' 1750 1894 (user_id, level) 1751 1895 VALUES 1752 (' ".$user_id."', '".$conf_UAM[35]."')1753 ; ";1896 ('.$user_id.', "'.$conf_UAM[35].'") 1897 ;'; 1754 1898 pwg_query($query); 1755 1899 } … … 1775 1919 if (isset($Confirm_Mail_ID)) 1776 1920 { 1777 $query = "1778 UPDATE ".USER_CONFIRM_MAIL_TABLE."1779 SET id = '".$Confirm_Mail_ID."'1780 WHERE user_id = ' ".$user_id."'1781 ; ";1921 $query = ' 1922 UPDATE '.USER_CONFIRM_MAIL_TABLE.' 1923 SET id = "'.$Confirm_Mail_ID.'" 1924 WHERE user_id = '.$user_id.' 1925 ;'; 1782 1926 pwg_query($query); 1783 1927 1784 $query = "1785 UPDATE ".USER_INFOS_TABLE."1786 SET registration_date = '".$dbnow."'1787 WHERE user_id = ' ".$user_id."'1788 ; ";1789 pwg_query($query);1928 $query = ' 1929 UPDATE '.USER_INFOS_TABLE.' 1930 SET registration_date = "'.$dbnow.'" 1931 WHERE user_id = '.$user_id.' 1932 ;'; 1933 pwg_query($query); 1790 1934 1791 1935 return get_absolute_root_url().UAM_PATH.'ConfirmMail.php?key='.$Confirm_Mail_ID.'&userid='.$user_id; … … 1806 1950 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 1807 1951 1808 $query = "1809 UPDATE ".USER_LASTVISIT_TABLE."1810 SET lastvisit = '".$dbnow."', reminder = 'true'1811 WHERE user_id = ' ".$user_id."'1812 ; ";1952 $query = ' 1953 UPDATE '.USER_LASTVISIT_TABLE.' 1954 SET lastvisit = "'.$dbnow.'", reminder = "true" 1955 WHERE user_id = '.$user_id.' 1956 ;'; 1813 1957 pwg_query($query); 1814 1958 } … … 1821 1965 function DeleteConfirmMail($user_id) 1822 1966 { 1823 $query = "1824 DELETE FROM ".USER_CONFIRM_MAIL_TABLE."1825 WHERE user_id = ' ".$user_id."'1826 ; ";1967 $query = ' 1968 DELETE FROM '.USER_CONFIRM_MAIL_TABLE.' 1969 WHERE user_id = '.$user_id.' 1970 ;'; 1827 1971 pwg_query($query); 1828 1972 } … … 1834 1978 function DeleteLastVisit($user_id) 1835 1979 { 1836 $query = "1837 DELETE FROM ".USER_LASTVISIT_TABLE."1838 WHERE user_id = ' ".$user_id."'1839 ; ";1980 $query = ' 1981 DELETE FROM '.USER_LASTVISIT_TABLE.' 1982 WHERE user_id = '.$user_id.' 1983 ;'; 1840 1984 pwg_query($query); 1841 1985 } … … 1864 2008 unset($values[array_search($user_id, $values)]); 1865 2009 1866 $query = "1867 UPDATE ".CONFIG_TABLE."1868 SET value = \"".implode(',', $values)."\"1869 WHERE param = 'UserAdvManager_Redir';";2010 $query = ' 2011 UPDATE '.CONFIG_TABLE.' 2012 SET value = "'.implode(',', $values).'" 2013 WHERE param = "UserAdvManager_Redir";'; 1870 2014 1871 2015 pwg_query($query); … … 1892 2036 $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); 1893 2037 1894 $query = "2038 $query = ' 1895 2039 SELECT COUNT(*) 1896 FROM ".USER_CONFIRM_MAIL_TABLE."1897 WHERE id = '".$id."'1898 ; ";2040 FROM '.USER_CONFIRM_MAIL_TABLE.' 2041 WHERE id = "'.$id.'" 2042 ;'; 1899 2043 list($count) = pwg_db_fetch_row(pwg_query($query)); 1900 2044 1901 2045 if ($count == 1) 1902 2046 { 1903 $query = "2047 $query = ' 1904 2048 SELECT user_id, status, date_check 1905 FROM ".USER_CONFIRM_MAIL_TABLE."1906 WHERE id = '".$id."'1907 ; ";2049 FROM '.USER_CONFIRM_MAIL_TABLE.' 2050 WHERE id = "'.$id.'" 2051 ;'; 1908 2052 $data = pwg_db_fetch_assoc(pwg_query($query)); 1909 2053 1910 2054 if (!empty($data) and isset($data['user_id']) and is_null($data['date_check'])) 1911 2055 { 1912 $query = "2056 $query = ' 1913 2057 SELECT registration_date 1914 FROM ".USER_INFOS_TABLE."1915 WHERE user_id = ' ".$data['user_id']."'1916 ; ";2058 FROM '.USER_INFOS_TABLE.' 2059 WHERE user_id = '.$data['user_id'].' 2060 ;'; 1917 2061 list($registration_date) = pwg_db_fetch_row(pwg_query($query)); 1918 2062 … … 1921 2065 if (!empty($registration_date)) 1922 2066 { 1923 // Verify Confirmmail with time limit ON1924 1925 if (isset ($conf_UAM_ConfirmMail[1]))1926 {1927 // Dates formating and compare1928 1929 $today = date("d-m-Y"); // Get today's date1930 list($day, $month, $year) = explode('-', $today); // explode date of today1931 $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp1932 1933 list($regdate, $regtime) = explode(' ', $registration_date); // Explode date and time from registration date1934 list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date1935 $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp1936 1937 $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps1938 $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days1939 1940 // Condition with the value set for time limit1941 1942 if ($deltadays <= $conf_UAM_ConfirmMail[1]) // If Nb of days is less than the limit set1943 {1944 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();'));1945 1946 1947 1948 $query = '2067 // Verify Confirmmail with time limit ON 2068 // ------------------------------------- 2069 if (isset ($conf_UAM_ConfirmMail[1])) 2070 { 2071 // Dates formating and compare 2072 // --------------------------- 2073 $today = date("d-m-Y"); // Get today's date 2074 list($day, $month, $year) = explode('-', $today); // explode date of today 2075 $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp 2076 2077 list($regdate, $regtime) = explode(' ', $registration_date); // Explode date and time from registration date 2078 list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date 2079 $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp 2080 2081 $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps 2082 $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days 2083 2084 // Condition with the value set for time limit 2085 // ------------------------------------------- 2086 if ($deltadays <= $conf_UAM_ConfirmMail[1]) // If Nb of days is less than the limit set 2087 { 2088 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 2089 2090 // Update ConfirmMail table 2091 // ------------------------ 2092 $query = ' 1949 2093 UPDATE '.USER_CONFIRM_MAIL_TABLE.' 1950 2094 SET date_check="'.$dbnow.'", reminder="false" 1951 2095 WHERE id = "'.$id.'" 1952 2096 ;'; 1953 pwg_query($query);1954 1955 1956 1957 1958 $query = '2097 pwg_query($query); 2098 2099 // Update LastVisit table - Force reminder field to false 2100 // Usefull when a user has been automatically downgraded and revalidate its registration 2101 // ------------------------------------------------------------------------------------- 2102 $query = ' 1959 2103 UPDATE '.USER_LASTVISIT_TABLE.' 1960 2104 SET reminder="false" 1961 2105 WHERE user_id = "'.$data['user_id'].'" 1962 2106 ;'; 1963 pwg_query($query);2107 pwg_query($query); 1964 2108 1965 if ($conf_UAM[2] <> -1) // Delete user from unvalidated users group1966 {1967 $query = "1968 DELETE FROM ".USER_GROUP_TABLE."1969 WHERE user_id = ' ".$data['user_id']."'1970 AND group_id = ' ".$conf_UAM[2]."'1971 ; ";1972 pwg_query($query);1973 }1974 1975 if ($conf_UAM[3] <> -1) // Add user to validated users group1976 {1977 $query = "1978 INSERT INTO ".USER_GROUP_TABLE."2109 if ($conf_UAM[2] <> -1) // Delete user from unvalidated users group 2110 { 2111 $query = ' 2112 DELETE FROM '.USER_GROUP_TABLE.' 2113 WHERE user_id = '.$data['user_id'].' 2114 AND group_id = '.$conf_UAM[2].' 2115 ;'; 2116 pwg_query($query); 2117 } 2118 2119 if ($conf_UAM[3] <> -1) // Add user to validated users group 2120 { 2121 $query = ' 2122 INSERT INTO '.USER_GROUP_TABLE.' 1979 2123 (user_id, group_id) 1980 2124 VALUES 1981 ('".$data['user_id']."', '".$conf_UAM[3]."') 1982 ;"; 1983 pwg_query($query); 1984 } 1985 1986 if (($conf_UAM[4] <> -1 or isset($data['status']))) // Change user's status 1987 { 1988 $query = " 1989 UPDATE ".USER_INFOS_TABLE." 1990 SET status = '".(isset($data['status']) ? $data['status'] : $conf_UAM[4])."' 1991 WHERE user_id = '".$data['user_id']."' 1992 ;"; 1993 pwg_query($query); 1994 } 1995 1996 if (($conf_UAM[36] <> -1 or isset($data['level']))) // Change user's privacy level 1997 { 1998 $query = " 1999 UPDATE ".USER_INFOS_TABLE." 2000 SET level = '".(isset($data['level']) ? $data['level'] : $conf_UAM[36])."' 2001 WHERE user_id = '".$data['user_id']."' 2002 ;"; 2003 pwg_query($query); 2004 } 2005 2006 // Refresh user's category cache 2007 // ----------------------------- 2008 invalidate_user_cache(); 2009 2010 return true; 2011 } 2012 elseif ($deltadays > $conf_UAM_ConfirmMail[1]) // If timelimit exeeds 2013 { 2014 return false; 2015 } 2016 } 2017 // Verify Confirmmail with time limit OFF 2018 // -------------------------------------- 2019 else 2020 { 2021 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 2022 2023 // Update ConfirmMail table 2024 // ------------------------ 2025 $query = ' 2125 ('.$data['user_id'].', '.$conf_UAM[3].') 2126 ;'; 2127 pwg_query($query); 2128 } 2129 2130 if ($conf_UAM[4] <> -1) // Change user's status 2131 { 2132 $query = ' 2133 UPDATE '.USER_INFOS_TABLE.' 2134 SET status = "'.$conf_UAM[4].'" 2135 WHERE user_id = '.$data['user_id'].' 2136 ;'; 2137 pwg_query($query); 2138 } 2139 2140 if ($conf_UAM[36] <> -1) // Change user's privacy level 2141 { 2142 $query = ' 2143 UPDATE '.USER_INFOS_TABLE.' 2144 SET level = "'.$conf_UAM[36].'" 2145 WHERE user_id = '.$data['user_id'].' 2146 ;'; 2147 pwg_query($query); 2148 } 2149 2150 // Set UAM_validated field to True in #_users table 2151 $query = ' 2152 UPDATE '.USERS_TABLE.' 2153 SET UAM_validated = "true" 2154 WHERE id = '.$data['user_id'].' 2155 ;'; 2156 pwg_query($query); 2157 2158 // Refresh user's category cache 2159 // ----------------------------- 2160 invalidate_user_cache(); 2161 2162 return true; 2163 } 2164 elseif ($deltadays > $conf_UAM_ConfirmMail[1]) // If timelimit exeeds 2165 { 2166 return false; 2167 } 2168 } 2169 // Verify Confirmmail with time limit OFF 2170 // -------------------------------------- 2171 else 2172 { 2173 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 2174 2175 // Update ConfirmMail table 2176 // ------------------------ 2177 $query = ' 2026 2178 UPDATE '.USER_CONFIRM_MAIL_TABLE.' 2027 2179 SET date_check="'.$dbnow.'" 2028 2180 WHERE id = "'.$id.'" 2029 2181 ;'; 2030 pwg_query($query);2031 2032 2033 2034 2035 $query = '2182 pwg_query($query); 2183 2184 // Update LastVisit table - Force reminder field to false 2185 // Usefull when a user has been automatically downgraded and revalidate its registration 2186 // ------------------------------------------------------------------------------------- 2187 $query = ' 2036 2188 UPDATE '.USER_LASTVISIT_TABLE.' 2037 2189 SET reminder="false" 2038 2190 WHERE user_id = "'.$data['user_id'].'" 2039 2191 ;'; 2040 2041 2042 if ($conf_UAM[2] <> -1) // Delete user from unvalidated users group2043 {2044 $query = "2045 DELETE FROM ".USER_GROUP_TABLE."2046 WHERE user_id = ' ".$data['user_id']."'2047 AND group_id = ' ".$conf_UAM[2]."'2048 ; ";2049 pwg_query($query);2050 }2051 2052 if ($conf_UAM[3] <> -1)2053 {2054 $query = "2055 DELETE FROM ".USER_GROUP_TABLE."2056 WHERE user_id = ' ".$data['user_id']."'2057 AND group_id = ' ".$conf_UAM[3]."'2058 ; ";2059 pwg_query($query);2060 2061 $query = "2062 INSERT INTO ".USER_GROUP_TABLE."2192 pwg_query($query); 2193 2194 if ($conf_UAM[2] <> -1) // Delete user from unvalidated users group 2195 { 2196 $query = ' 2197 DELETE FROM '.USER_GROUP_TABLE.' 2198 WHERE user_id = '.$data['user_id'].' 2199 AND group_id = '.$conf_UAM[2].' 2200 ;'; 2201 pwg_query($query); 2202 } 2203 2204 if ($conf_UAM[3] <> -1) 2205 { 2206 $query = ' 2207 DELETE FROM '.USER_GROUP_TABLE.' 2208 WHERE user_id = '.$data['user_id'].' 2209 AND group_id = '.$conf_UAM[3].' 2210 ;'; 2211 pwg_query($query); 2212 2213 $query = ' 2214 INSERT INTO '.USER_GROUP_TABLE.' 2063 2215 (user_id, group_id) 2064 2216 VALUES 2065 ('".$data['user_id']."', '".$conf_UAM[3]."') 2066 ;"; 2067 pwg_query($query); 2068 } 2069 2070 if (($conf_UAM[4] <> -1 or isset($data['status']))) // Change user's status 2071 { 2072 $query = " 2073 UPDATE ".USER_INFOS_TABLE." 2074 SET status = '".(isset($data['status']) ? $data['status'] : $conf_UAM[4])."' 2075 WHERE user_id = '".$data['user_id']."' 2076 ;"; 2077 pwg_query($query); 2078 } 2079 2080 if (($conf_UAM[36] <> -1 or isset($data['level']))) // Change user's privacy level 2081 { 2082 $query = " 2083 UPDATE ".USER_INFOS_TABLE." 2084 SET level = '".(isset($data['level']) ? $data['level'] : $conf_UAM[36])."' 2085 WHERE user_id = '".$data['user_id']."' 2086 ;"; 2087 pwg_query($query); 2088 } 2089 2090 // Refresh user's category cache 2091 // ----------------------------- 2092 invalidate_user_cache(); 2093 2094 return true; 2217 ('.$data['user_id'].', '.$conf_UAM[3].') 2218 ;'; 2219 pwg_query($query); 2220 } 2221 2222 if ($conf_UAM[4] <> -1) // Change user's status 2223 { 2224 $query = ' 2225 UPDATE '.USER_INFOS_TABLE.' 2226 SET status = "'.$conf_UAM[4].'" 2227 WHERE user_id = '.$data['user_id'].' 2228 ;'; 2229 pwg_query($query); 2230 } 2231 2232 if ($conf_UAM[36] <> -1) // Change user's privacy level 2233 { 2234 $query = ' 2235 UPDATE '.USER_INFOS_TABLE.' 2236 SET level = "'.$conf_UAM[36].'" 2237 WHERE user_id = '.$data['user_id'].' 2238 ;'; 2239 pwg_query($query); 2240 } 2241 2242 // Set UAM_validated field to True in #_users table 2243 $query = ' 2244 UPDATE '.USERS_TABLE.' 2245 SET UAM_validated = "true" 2246 WHERE id = '.$data['user_id'].' 2247 ;'; 2248 pwg_query($query); 2249 2250 // Refresh user's category cache 2251 // ----------------------------- 2252 invalidate_user_cache(); 2253 2254 return true; 2255 } 2256 } 2095 2257 } 2096 } 2258 else if (!empty($data) and !is_null($data['date_check'])) 2259 { 2260 return false; 2261 } 2097 2262 } 2098 else if (!empty($data) and !is_null($data['date_check']))2099 {2100 return false;2101 }2102 }2103 2263 else 2104 2264 return false; … … 2107 2267 2108 2268 /** 2109 * Function called from UAM_admin.php to force usersvalidation by admin2269 * Function called from UAM_admin.php for manual validation by admin 2110 2270 * 2111 2271 * @param : User id 2112 2272 * 2113 2273 */ 2114 function ForceValidation($id) 2115 { 2116 global $conf; 2117 2118 $conf_UAM = unserialize($conf['UserAdvManager']); 2119 2120 if (isset($conf_UAM[1]) and $conf_UAM[1] == 'true') 2121 { 2122 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 2123 2124 $query = " 2125 UPDATE ".USER_CONFIRM_MAIL_TABLE." 2126 SET date_check='".$dbnow."' 2127 WHERE user_id = '".$id."' 2128 ;"; 2129 pwg_query($query); 2130 2131 if ($conf_UAM[2] <> -1) 2274 function ManualValidation($id) 2275 { 2276 global $conf; 2277 2278 $conf_UAM = unserialize($conf['UserAdvManager']); 2279 2280 if (isset($conf_UAM[1]) and $conf_UAM[1] == 'true') // Set date of validation 2132 2281 { 2133 $query = " 2134 DELETE FROM ".USER_GROUP_TABLE." 2135 WHERE user_id = '".$id."' 2136 AND group_id = '".$conf_UAM[2]."' 2137 ;"; 2138 pwg_query($query); 2282 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 2283 2284 $query = ' 2285 UPDATE '.USER_CONFIRM_MAIL_TABLE.' 2286 SET date_check="'.$dbnow.'" 2287 WHERE user_id = '.$id.' 2288 ;'; 2289 pwg_query($query); 2139 2290 } 2140 2141 if ($conf_UAM[ 3] <> -1) // Change user'sgroup2291 2292 if ($conf_UAM[2] <> -1) // Delete user from waiting group 2142 2293 { 2143 $query = " 2144 DELETE FROM ".USER_GROUP_TABLE." 2145 WHERE user_id = '".$id."' 2146 AND group_id = '".$conf_UAM[3]."' 2147 ;"; 2148 pwg_query($query); 2294 $query = ' 2295 DELETE FROM '.USER_GROUP_TABLE.' 2296 WHERE user_id = '.$id.' 2297 AND group_id = '.$conf_UAM[2].' 2298 ;'; 2299 pwg_query($query); 2300 } 2301 2302 if ($conf_UAM[3] <> -1) // Set user's valid group 2303 { 2304 $query = ' 2305 DELETE FROM '.USER_GROUP_TABLE.' 2306 WHERE user_id = '.$id.' 2307 AND group_id = '.$conf_UAM[3].' 2308 ;'; 2309 pwg_query($query); 2149 2310 2150 $query = "2151 INSERT INTO ".USER_GROUP_TABLE."2152 2311 $query = ' 2312 INSERT INTO '.USER_GROUP_TABLE.' 2313 (user_id, group_id) 2153 2314 VALUES 2154 ('".$id."', '".$conf_UAM[3]."')2155 ; ";2156 pwg_query($query);2157 2158 2159 if ($conf_UAM[4] <> -1) // Change user'sstatus2315 ('.$id.', '.$conf_UAM[3].') 2316 ;'; 2317 pwg_query($query); 2318 } 2319 2320 if ($conf_UAM[4] <> -1) // Set user's valid status 2160 2321 { 2161 $query = "2162 UPDATE ".USER_INFOS_TABLE."2163 SET status = '".$conf_UAM[4]."'2164 WHERE user_id = ' ".$id."'2165 ; ";2166 pwg_query($query);2322 $query = ' 2323 UPDATE '.USER_INFOS_TABLE.' 2324 SET status = "'.$conf_UAM[4].'" 2325 WHERE user_id = '.$id.' 2326 ;'; 2327 pwg_query($query); 2167 2328 } 2168 2329 2169 if ($conf_UAM[36] <> -1) // Change user'sprivacy level2330 if ($conf_UAM[36] <> -1) // Set user's valid privacy level 2170 2331 { 2171 $query = "2172 UPDATE ".USER_INFOS_TABLE."2173 SET level = '".$conf_UAM[36]."'2174 WHERE user_id = ' ".$id."'2175 ; ";2176 pwg_query($query);2332 $query = ' 2333 UPDATE '.USER_INFOS_TABLE.' 2334 SET level = "'.$conf_UAM[36].'" 2335 WHERE user_id = '.$id.' 2336 ;'; 2337 pwg_query($query); 2177 2338 } 2178 } 2179 elseif (isset($conf_UAM[1]) and $conf_UAM[1] == 'local') 2180 { 2181 list($dbnow) = pwg_db_fetch_row(pwg_query('SELECT NOW();')); 2182 2183 if ($conf_UAM[2] <> -1) // Delete user's from waiting group 2184 { 2185 $query = " 2186 DELETE FROM ".USER_GROUP_TABLE." 2187 WHERE user_id = '".$id."' 2188 AND group_id = '".$conf_UAM[2]."' 2189 ;"; 2190 pwg_query($query); 2191 } 2192 2193 if ($conf_UAM[3] <> -1) // Change user's group 2194 { 2195 $query = " 2196 DELETE FROM ".USER_GROUP_TABLE." 2197 WHERE user_id = '".$id."' 2198 AND group_id = '".$conf_UAM[3]."' 2199 ;"; 2200 pwg_query($query); 2201 2202 $query = " 2203 INSERT INTO ".USER_GROUP_TABLE." 2204 (user_id, group_id) 2205 VALUES 2206 ('".$id."', '".$conf_UAM[3]."') 2207 ;"; 2208 pwg_query($query); 2209 } 2210 2211 if ($conf_UAM[4] <> -1) // Change user's status 2212 { 2213 $query = " 2214 UPDATE ".USER_INFOS_TABLE." 2215 SET status = '".$conf_UAM[4]."' 2216 WHERE user_id = '".$id."' 2217 ;"; 2218 pwg_query($query); 2219 } 2220 2221 if ($conf_UAM[36] <> -1) // Change user's privacy level 2222 { 2223 $query = " 2224 UPDATE ".USER_INFOS_TABLE." 2225 SET level = '".$conf_UAM[36]."' 2226 WHERE user_id = '".$id."' 2227 ;"; 2228 pwg_query($query); 2229 } 2230 } 2231 } 2232 2233 2234 /** 2235 * Function called from functions.inc.php - Check if username matches forbidden caracters 2339 2340 // Set UAM_validated field to True in #_users table 2341 $query = ' 2342 UPDATE '.USERS_TABLE.' 2343 SET UAM_validated = "true" 2344 WHERE id = '.$id.' 2345 ;'; 2346 pwg_query($query); 2347 } 2348 2349 2350 /** 2351 * Function called from functions.inc.php - Check if username matches forbidden characters 2236 2352 * 2237 2353 * @param : User login … … 2251 2367 for ($i = 0 ; $i < count($conf_CharExclusion) ; $i++) 2252 2368 { 2253 $pattern = '/'.$conf_CharExclusion[$i].'/i'; 2369 //Detect meta-characters (# ! ^ $ ( ) [ ] { } ? + * . \ -) for special pattern 2370 if ($conf_CharExclusion[$i] == "#" 2371 or $conf_CharExclusion[$i] == "$" 2372 or $conf_CharExclusion[$i] == "!" 2373 or $conf_CharExclusion[$i] == "^" 2374 or $conf_CharExclusion[$i] == "*" 2375 or $conf_CharExclusion[$i] == "?" 2376 or $conf_CharExclusion[$i] == "+" 2377 or $conf_CharExclusion[$i] == "." 2378 or $conf_CharExclusion[$i] == "\\" 2379 or $conf_CharExclusion[$i] == "|" 2380 or $conf_CharExclusion[$i] == "[" 2381 or $conf_CharExclusion[$i] == "]" 2382 or $conf_CharExclusion[$i] == "(" 2383 or $conf_CharExclusion[$i] == ")" 2384 or $conf_CharExclusion[$i] == "{" 2385 or $conf_CharExclusion[$i] == "}" 2386 or $conf_CharExclusion[$i] == "-") 2387 { 2388 $pattern = '/[][^$.\*+?(){}#|-]/i'; 2389 } 2390 else 2391 { 2392 $pattern = '/'.$conf_CharExclusion[$i].'/i'; 2393 } 2394 2254 2395 if (preg_match($pattern, $login)) 2255 2396 { … … 2280 2421 $conf_UAM = unserialize($conf['UserAdvManager']); 2281 2422 2282 if (isset($email) and isset($conf_UAM[11]) and $conf_UAM[11] <> '') 2283 { 2284 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]); 2285 for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++) 2423 if (isset($email) and isset($conf_UAM[11]) and $conf_UAM[11] <> '') 2286 2424 { 2287 $pattern = '/'.$conf_MailExclusion[$i].'/i'; 2288 if (preg_match($pattern, $email)) 2289 { 2290 return true; 2291 } 2425 $conf_MailExclusion = preg_split("/[\s,]+/",$conf_UAM[11]); 2426 for ($i = 0 ; $i < count($conf_MailExclusion) ; $i++) 2427 { 2428 $pattern = '/'.$conf_MailExclusion[$i].'/i'; 2429 if (preg_match($pattern, $email)) 2430 { 2431 return true; 2432 } 2433 } 2292 2434 } 2293 }2294 2435 else 2295 2436 { … … 2307 2448 function get_unvalid_user_list() 2308 2449 { 2309 global $conf, $page;2450 global $conf, $page; 2310 2451 2311 // Get ConfirmMail configuration2452 // Get ConfirmMail configuration 2312 2453 // ----------------------------- 2313 2454 $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); … … 2318 2459 $users = array(); 2319 2460 2320 // Search users depending expiration date2461 // Search users depending expiration date 2321 2462 // -------------------------------------- 2322 2463 $query = ' … … 2335 2476 WHERE u.'.$conf['user_fields']['id'].' >= 3 2336 2477 AND (TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_UAM_ConfirmMail[1].'" 2337 OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_UAM_ConfirmMail[1].'")'; 2338 2339 if ($conf_UAM[2] <> '-1' and $conf_UAM[7] == '-1') 2340 { 2341 $query.= ' 2342 AND ug.group_id = '.$conf_UAM[2]; 2343 } 2344 if ($conf_UAM[2] == '-1' and $conf_UAM[7] <> '-1') 2345 { 2346 $query.= ' 2347 AND ui.status = \''.$conf_UAM[7]."'"; 2348 } 2349 if ($conf_UAM[2] <> '-1' and $conf_UAM[7] <> '-1') 2350 { 2351 $query.= ' 2352 AND ug.group_id = \''.$conf_UAM[2]."'"; 2353 } 2354 $query.= ' 2478 OR TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) < "'.$conf_UAM_ConfirmMail[1].'") 2479 AND u.UAM_validated = "false" 2355 2480 ORDER BY ui.registration_date ASC 2356 2481 ;'; 2357 2482 2358 $result = pwg_query($query);2483 $result = pwg_query($query); 2359 2484 2360 2485 while ($row = pwg_db_fetch_assoc($result)) 2361 2486 { 2362 $user = $row;2487 $user = $row; 2363 2488 $user['groups'] = array(); 2364 2489 2365 2490 array_push($users, $user); 2366 }2367 2368 // Add groups list2491 } 2492 2493 // Add groups list 2369 2494 // --------------- 2370 2495 $user_ids = array(); 2371 2496 foreach ($users as $i => $user) 2372 2497 { 2373 $user_ids[$i] = $user['id'];2374 }2375 2376 $user_nums = array_flip($user_ids);2498 $user_ids[$i] = $user['id']; 2499 } 2500 2501 $user_nums = array_flip($user_ids); 2377 2502 2378 2503 if (count($user_ids) > 0) 2379 2504 { 2380 $query = '2505 $query = ' 2381 2506 SELECT user_id, group_id 2382 2507 FROM '.USER_GROUP_TABLE.' … … 2384 2509 ;'; 2385 2510 2386 $result = pwg_query($query);2511 $result = pwg_query($query); 2387 2512 2388 2513 while ($row = pwg_db_fetch_assoc($result)) 2389 2514 { 2390 array_push(2391 $users[$user_nums[$row['user_id']]]['groups'],2515 array_push( 2516 $users[$user_nums[$row['user_id']]]['groups'], 2392 2517 $row['group_id'] 2393 ); 2518 ); 2519 } 2394 2520 } 2395 } 2396 2397 return $users; 2521 2522 return $users; 2398 2523 } 2399 2524 … … 2408 2533 function get_unvalid_user_autotasks() 2409 2534 { 2410 global $conf, $page;2535 global $conf, $page; 2411 2536 2412 // Get ConfirmMail configuration2537 // Get ConfirmMail configuration 2413 2538 // ----------------------------- 2414 2539 $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); … … 2416 2541 $users = array(); 2417 2542 2418 // search users depending expiration date2543 // search users depending expiration date 2419 2544 // -------------------------------------- 2420 2545 $query = ' … … 2428 2553 ORDER BY ui.registration_date ASC;'; 2429 2554 2430 $result = pwg_query($query);2431 2555 $result = pwg_query($query); 2556 2432 2557 while ($row = pwg_db_fetch_assoc($result)) 2433 2558 { 2434 2559 array_push($users, $row); 2435 }2436 2437 return $users;2560 } 2561 2562 return $users; 2438 2563 } 2439 2564 … … 2447 2572 function get_ghost_user_list() 2448 2573 { 2449 global $conf, $page;2574 global $conf, $page; 2450 2575 2451 2576 $conf_UAM = unserialize($conf['UserAdvManager']); 2452 2577 2453 2578 $users = array(); 2454 2579 2455 // Search users depending expiration date2580 // Search users depending expiration date 2456 2581 // -------------------------------------- 2457 2582 $query = ' … … 2467 2592 ORDER BY lv.lastvisit ASC;'; 2468 2593 2469 $result = pwg_query($query);2594 $result = pwg_query($query); 2470 2595 2471 2596 while ($row = pwg_db_fetch_assoc($result)) 2472 2597 { 2473 $user = $row;2598 $user = $row; 2474 2599 $user['groups'] = array(); 2475 2600 2476 2601 array_push($users, $user); 2477 }2478 2479 // Add groups list2602 } 2603 2604 // Add groups list 2480 2605 // --------------- 2481 2606 $user_ids = array(); … … 2483 2608 { 2484 2609 $user_ids[$i] = $user['id']; 2485 }2486 2487 return $users;2610 } 2611 2612 return $users; 2488 2613 } 2489 2614 … … 2497 2622 function get_ghosts_autotasks() 2498 2623 { 2499 global $conf, $page;2624 global $conf, $page; 2500 2625 2501 2626 $conf_UAM = unserialize($conf['UserAdvManager']); … … 2503 2628 $users = array(); 2504 2629 2505 // Search users depending expiration date and reminder sent2630 // Search users depending expiration date and reminder sent 2506 2631 // -------------------------------------------------------- 2507 2632 $query = ' … … 2514 2639 ORDER BY lv.lastvisit ASC;'; 2515 2640 2516 $result = pwg_query($query);2641 $result = pwg_query($query); 2517 2642 2518 2643 while ($row = pwg_db_fetch_assoc($result)) 2519 2644 { 2520 2645 array_push($users, $row); 2521 }2522 2523 return $users;2646 } 2647 2648 return $users; 2524 2649 } 2525 2650 … … 2533 2658 function get_user_list() 2534 2659 { 2535 global $conf, $page;2660 global $conf, $page; 2536 2661 2537 2662 $users = array(); 2538 2663 2539 // Search users depending expiration date with exclusion of Adult_Content generic users2664 // Search users depending expiration date with exclusion of Adult_Content generic users 2540 2665 // ------------------------------------------------------------------------------------ 2541 2666 $query = ' … … 2553 2678 ;'; 2554 2679 2555 $result = pwg_query($query);2680 $result = pwg_query($query); 2556 2681 2557 2682 while ($row = pwg_db_fetch_assoc($result)) 2558 2683 { 2559 $user = $row;2684 $user = $row; 2560 2685 $user['groups'] = array(); 2561 2686 2562 2687 array_push($users, $user); 2563 }2564 2565 // Add groups list2688 } 2689 2690 // Add groups list 2566 2691 // --------------- 2567 2692 $user_ids = array(); 2568 2693 foreach ($users as $i => $user) 2569 2694 { 2570 2571 }2572 2573 return $users;2695 $user_ids[$i] = $user['id']; 2696 } 2697 2698 return $users; 2574 2699 } 2575 2700 … … 2587 2712 global $conf, $page; 2588 2713 2589 // Get ConfirmMail configuration2714 // Get ConfirmMail configuration 2590 2715 // ----------------------------- 2591 2716 $conf_UAM_ConfirmMail = unserialize($conf['UserAdvManager_ConfirmMail']); 2592 2717 2593 // Get UAM configuration2718 // Get UAM configuration 2594 2719 // --------------------- 2595 2720 $conf_UAM = unserialize($conf['UserAdvManager']); 2596 2721 2597 $query = "2722 $query = ' 2598 2723 SELECT registration_date 2599 FROM ".USER_INFOS_TABLE."2600 WHERE user_id = ' ".$id."'2601 ; ";2602 list($registration_date) = pwg_db_fetch_row(pwg_query($query));2724 FROM '.USER_INFOS_TABLE.' 2725 WHERE user_id = '.$id.' 2726 ;'; 2727 list($registration_date) = pwg_db_fetch_row(pwg_query($query)); 2603 2728 2604 2729 // Time limit process 2605 2730 // ******************************************** 2606 if (!empty($registration_date))2607 { 2608 // Dates formating and compare2609 2610 $today = date("d-m-Y"); // Get today's date2611 list($day, $month, $year) = explode('-', $today); // explode date of today2612 $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp2731 if (!empty($registration_date)) 2732 { 2733 // Dates formating and compare 2734 // --------------------------- 2735 $today = date("d-m-Y"); // Get today's date 2736 list($day, $month, $year) = explode('-', $today); // explode date of today 2737 $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp 2613 2738 2614 list($regdate, $regtime) = explode(' ', $registration_date); // Explode date and time from registration date2615 list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date2616 $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp2739 list($regdate, $regtime) = explode(' ', $registration_date); // Explode date and time from registration date 2740 list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date 2741 $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp 2617 2742 2618 $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps2619 $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days2620 2621 // Condition with the value set for time limit2743 $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps 2744 $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days 2745 2746 // Condition with the value set for time limit 2622 2747 // ------------------------------------------- 2623 if ($deltadays <= $conf_UAM_ConfirmMail[1]) // If Nb of days is less than the limit set 2624 { 2625 return false; 2748 if ($deltadays <= $conf_UAM_ConfirmMail[1]) // If Nb of days is less than the limit set 2749 { 2750 return false; 2751 } 2752 else 2753 { 2754 return true; 2755 } 2626 2756 } 2627 else2628 {2629 return true;2630 }2631 }2632 2757 } 2633 2758 … … 2642 2767 * Thanx to MathieuGut from http://m-gut.developpez.com 2643 2768 */ 2644 function testpassword($password) // Le mot de passe passé en paramètre -$password given by user2645 { 2646 2647 // Initialisation des variables -Variables initiation2648 // -------------------- -------------------------------2769 function testpassword($password) // $password given by user 2770 { 2771 2772 // Variables initiation 2773 // -------------------- 2649 2774 $points = 0; 2650 2775 $point_lowercase = 0; … … 2653 2778 $point_characters = 0; 2654 2779 2655 // On récupère la longueur du mot de passe -Getting password lengh2656 // ---------------------- ------------------------------------------2780 // Getting password lengh 2781 // ---------------------- 2657 2782 $length = strlen($password); 2658 2659 // On fait une boucle pour lire chaque lettre -Loop to read password characters2783 2784 // Loop to read password characters 2660 2785 for($i = 0; $i < $length; $i++) 2661 2786 { 2662 // On sélectionne une à une chaque lettre -Select each letters2663 // $i étant à 0 lors du premier passage de la boucle - $iis 0 at first turn2664 // --------------------- ----------------------------------------------------2787 // Select each letters 2788 // $i is 0 at first turn 2789 // --------------------- 2665 2790 $letters = $password[$i]; 2666 2791 2667 2792 if ($letters>='a' && $letters<='z') 2668 2793 { 2669 // On ajoute 1 point pour une minuscule -Adding 1 point to score for a lowercase2670 // --------------------------------------- ---------------------------------------2671 $points = $points + 1;2672 2673 // On rajoute le bonus pour une minuscule -Adding bonus points for lowercase2674 // --------------------------------- -----------------------------------------2794 // Adding 1 point to score for a lowercase 2795 // --------------------------------------- 2796 $points = $points + 1; 2797 2798 // Adding bonus points for lowercase 2799 // --------------------------------- 2675 2800 $point_lowercase = 1; 2676 2801 } 2677 2802 else if ($letters>='A' && $letters <='Z') 2678 2803 { 2679 // On ajoute 2 points pour une majuscule -Adding 2 points to score for uppercase2680 // -------------------------------------- ----------------------------------------2804 // Adding 2 points to score for uppercase 2805 // -------------------------------------- 2681 2806 $points = $points + 2; 2682 2807 2683 // On rajoute le bonus pour une majuscule -Adding bonus points for uppercase2684 // --------------------------------- -----------------------------------------2808 // Adding bonus points for uppercase 2809 // --------------------------------- 2685 2810 $point_uppercase = 2; 2686 2811 } 2687 2812 else if ($letters>='0' && $letters<='9') 2688 2813 { 2689 // On ajoute 3 points pour un chiffre -Adding 3 points to score for numbers2690 // ------------------------------------ -------------------------------------2814 // Adding 3 points to score for numbers 2815 // ------------------------------------ 2691 2816 $points = $points + 3; 2692 2817 2693 // On rajoute le bonus pour un chiffre -Adding bonus points for numbers2694 // ------------------------------- --------------------------------------2818 // Adding bonus points for numbers 2819 // ------------------------------- 2695 2820 $point_numbers = 3; 2696 2821 } 2697 2822 else 2698 2823 { 2699 // On ajoute 5 points pour un caractère autre -Adding 5 points to score for special characters2700 // ----------------------------------------------- ---------------------------------------------2824 // Adding 5 points to score for special characters 2825 // ----------------------------------------------- 2701 2826 $points = $points + 5; 2702 2827 2703 // On rajoute le bonus pour un caractère autre -Adding bonus points for special characters2704 // ------------------------------------------ ----------------------------------------------2828 // Adding bonus points for special characters 2829 // ------------------------------------------ 2705 2830 $point_characters = 5; 2706 2831 } 2707 2832 } 2708 2833 2709 // Calcul du coefficient points/longueur - calculating the coefficient points/length2710 // ----------------------------------------- ----------------------------------------2834 // Calculating the coefficient points/length 2835 // ----------------------------------------- 2711 2836 $step1 = $points / $length; 2712 2837 2713 // Calcul du coefficient de la diversité des types de caractères... - Calculation of the diversity of character types...2714 // -------------------------------------------------- -------------------------------------------------------------------2838 // Calculation of the diversity of character types... 2839 // -------------------------------------------------- 2715 2840 $step2 = $point_lowercase + $point_uppercase + $point_numbers + $point_characters; 2716 2841 2717 // Multipl ication du coefficient de diversité avec celui de la longueur - Multiplying the coefficient of diversity with that of the length2718 // ---------------------------------------------------------------- ----------------------------------------------------------------------------2842 // Multiplying the coefficient of diversity with that of the length 2843 // ---------------------------------------------------------------- 2719 2844 $score = $step1 * $step2; 2720 2845 2721 // Multipl ication du resultat par la longueur de la chaine - Multiplying the result by the length of the string2722 // -------------------------------------------------- ----------------------------------------------------------2846 // Multiplying the result by the length of the string 2847 // -------------------------------------------------- 2723 2848 $finalscore = $score * $length; 2724 2849 … … 2799 2924 global $conf; 2800 2925 2801 // Get UAM configuration2802 // ---------------------2803 $conf_UAM = unserialize($conf['UserAdvManager']);2804 2805 2926 $query = ' 2806 SELECT group_id 2807 FROM '.USER_GROUP_TABLE.' 2808 WHERE user_id = '.$user_id.' 2809 AND group_id = '.$conf_UAM[2].' 2810 ;'; 2811 2812 $count = pwg_db_num_rows(pwg_query($query)); 2813 2814 if ($count == 0) 2815 { 2816 return true; // User is not in a "Waiting" group 2817 } 2818 else 2819 { 2820 return false; // User is still in a "Waiting" group 2821 } 2927 SELECT UAM_validated 2928 FROM '.USERS_TABLE.' 2929 WHERE id='.$user_id.' 2930 ;'; 2931 2932 $result = pwg_db_fetch_assoc(pwg_query($query)); 2933 2934 if($result['UAM_validated'] == 'true') 2935 { 2936 return true; 2937 } 2938 else return false; 2939 } 2940 2941 2942 /** 2943 * SetUnvalidated 2944 * Set UAM_validated field to false in #_users table 2945 * 2946 **/ 2947 function SetUnvalidated($user_id) 2948 { 2949 $query =' 2950 UPDATE '.USERS_TABLE.' 2951 SET UAM_validated = "false" 2952 WHERE id = '.$user_id.' 2953 LIMIT 1 2954 ;'; 2955 2956 pwg_query($query); 2822 2957 } 2823 2958 … … 2921 3056 $ListTables = array(USER_CONFIRM_MAIL_TABLE, USER_LASTVISIT_TABLE); 2922 3057 $j=0; 2923 3058 2924 3059 while($j < count($ListTables)) 2925 3060 { … … 3230 3365 fclose($fo) ; 3231 3366 } 3367 3232 3368 ?> -
extensions/UserAdvManager/branches/2.40/include/upgradedb.inc.php
r14730 r18160 137 137 // Create missing table 138 138 // -------------------- 139 $query = "140 ALTER TABLE ".USER_CONFIRM_MAIL_TABLE."141 ADD reminder ENUM( 'true', 'false') NULL DEFAULT NULL142 ; ";139 $query = ' 140 ALTER TABLE '.USER_CONFIRM_MAIL_TABLE.' 141 ADD reminder ENUM("true", "false") NULL DEFAULT NULL 142 ;'; 143 143 144 144 pwg_query($query); … … 623 623 conf_update_param('UserAdvManager', pwg_db_real_escape_string($update_conf)); 624 624 } 625 626 627 /* upgrade from 2.40.x to 2.40.6 */ 628 /* ***************************** */ 629 function upgrade_2400_2406() 630 { 631 global $conf; 632 $conf_UAM = unserialize($conf['UserAdvManager']); 633 634 // Piwigo's native tables modifications for validation status - Add UAM_validated column 635 // ------------------------------------------------------------------------------------- 636 $query = ' 637 SHOW COLUMNS FROM '.USERS_TABLE.' 638 LIKE "UAM_validated" 639 ;'; 640 641 $result = pwg_query($query); 642 643 if(!pwg_db_fetch_row($result)) 644 { 645 $q = ' 646 ALTER TABLE '.USERS_TABLE.' 647 ADD UAM_validated enum("true","false") 648 ;'; 649 pwg_query($q); 650 } 651 652 // Fill UAM_validated column with correct information for registered and validated users 653 // -------------------------------------------------------------------------------------- 654 655 // It goes for everybody registered in the gallery except for Guest and AC users (16 and 18) 656 $query = ' 657 SELECT DISTINCT u.id AS id, u.username AS username 658 FROM '.USERS_TABLE.' AS u 659 INNER JOIN '.USER_INFOS_TABLE.' AS ui 660 ON u.id = ui.user_id 661 LEFT JOIN '.USER_GROUP_TABLE.' AS ug 662 ON u.id = ug.user_id 663 WHERE u.id != 2 664 AND u.username != \'16\' 665 AND u.username != \'18\''; 666 667 if ($conf_UAM[3] <> '-1' and $conf_UAM[4] == '-1') 668 { 669 $query.= ' 670 AND ug.group_id = '.$conf_UAM[3]; 671 } 672 if ($conf_UAM[3] == '-1' and $conf_UAM[4] <> '-1') 673 { 674 $query.= ' 675 AND ui.status = \''.$conf_UAM[4]."'"; 676 } 677 if ($conf_UAM[3] <> '-1' and $conf_UAM[4] <> '-1') 678 { 679 $query.= ' 680 AND ug.group_id = '.$conf_UAM[3]; 681 } 682 $query.= ';'; 683 684 $result = pwg_query($query); 685 686 while($row = mysql_fetch_array($result)) 687 { 688 $query = ' 689 UPDATE '.USERS_TABLE.' 690 SET UAM_validated=true 691 WHERE id = '.$row['id'].' 692 ;'; 693 pwg_query($query); 694 } 695 696 // It goes to Webmaster too 697 $query = ' 698 UPDATE '.USERS_TABLE.' 699 SET UAM_validated=true 700 WHERE id = 1 701 ;'; 702 pwg_query($query); 703 } 625 704 ?> -
extensions/UserAdvManager/branches/2.40/language/de_DE/plugin.lang.php
r17805 r18160 182 182 183 183 // --------- Starting below: New or revised $lang ---- from version 2.15.4 184 $lang['UAM_ Force_Validation'] = 'Handbuch Validierung';184 $lang['UAM_Manual_Validation'] = 'Handbuch Validierung'; 185 185 $lang['UAM_Confirm_Mail_true'] = ' Aktivieren - Validation von Benutzer'; 186 $lang['UAM_Confirm_Mail_local'] = ' Aktivieren - Validation von admin (keine Validierung Key gesendet)';186 $lang['UAM_Confirm_Mail_local'] = ' Aktivieren - Validation von admin'; 187 187 // --------- End: New or revised $lang ---- from version 2.15.4 188 188 -
extensions/UserAdvManager/branches/2.40/language/el_GR/plugin.lang.php
r17805 r18160 25 25 $lang['UAM_Confirm_Status'] = 'Κατάσταση<br>(αφήστε ------- να διατηρηθεί το προεπιλεγμένο του Piwigo)'; 26 26 $lang['UAM_Confirm_Mail_true'] = 'Ενεργοποίηση. Επιβεβαίωση από τον χρήστη'; 27 $lang['UAM_Confirm_Mail_local'] = 'Ενεργοποίηση. Επιβεβαίωση από admin (δεν στέλνετε κλειδί επιβεβαίωσης)';27 $lang['UAM_Confirm_Mail_local'] = 'Ενεργοποίηση. Επιβεβαίωση από admin'; 28 28 $lang['UAM_Confirm_Mail'] = 'Επιβεβαίωση της εγγραφής:'; 29 29 $lang['UAM_Confirm_Level'] = 'Επίπεδο προστασίας<br>(αφήστε------- να διατηρηθεί το προεπιλεγμένο του Piwigo)'; … … 116 116 $lang['UAM_GTAutoDel'] = 'Αυτόματη διαγραφή των λογαριασμών'; 117 117 $lang['UAM_GTAuto'] = 'Αυτόματη διαχείριση των ghosts users'; 118 $lang['UAM_ Force_Validation'] = 'Χειροκίνητη επιβεβαίωση';118 $lang['UAM_Manual_Validation'] = 'Χειροκίνητη επιβεβαίωση'; 119 119 $lang['UAM_Expired_Status'] = '<b>Η Κατάσταση</b> για την εγγραφή του χρήστη έχει λήξει<br>'; 120 120 $lang['UAM_Expired_Level'] = '<b>Το επίπεδο προστασίας</b> για την εγγραφή του χρήστη έχει λήξει<br>'; … … 336 336 Παρακαλούμε, Επανενεργοποιήσατε την επιλογή του Piwigo "Η διεύθυνση email είναι υποχρεωτική για όλους τους χρήστες" για να είσαστε σε θέση στη συνέχεια να απενεργοποιήσετε την επιλογή του UAM "Αποκλεισμός τομέων email" αν είναι αυτό που θέλετε. <br><br> 337 337 Σημείωση: Αυτό το μήνυμα θα εξαφανιστεί αφού έχετε κάνει την απαραίτητη διόρθωση και την επαναφόρτωση της σελίδας του διαχειριστή.<br><br>'; 338 $lang['UAM_Subject admin validation for %s'] = 'Η καταχώρηση των %s αναμένει επικύρωση'; 339 $lang['UAM_Manual_validation_needed_for %s'] = 'Ο χρήστης % καταχωρήθηκε και περιμένει χειροκίνητη επικύρωση από τον διαχειριστή'; 338 340 ?> -
extensions/UserAdvManager/branches/2.40/language/en_UK/help.lang.php
r14730 r18160 219 219 <br><br> 220 220 <b>Table Sorting Function</b>: You can sort the data displayed by clicking on the column headers. Hold the SHIFT key to sort up to 4 simultaneous columns.'; 221 $lang['UAM_confirmmailTitle_d'] = 'This option allows a user to either confirm registration by clicking on a link received in an email sent upon registration or the administrator to manually activate the registration.<br><br> 222 In first case, the e-mail is composed of a customizable part to introduce a little welcome note and a fixed part containing the activation link that is generated from a random key that can possibly regenerate through the "Tracking confirmations" tab.<br><br> 223 In second case, <b><u>there is no confirmation key send by email!</u></b>. Visitors have to wait until an administrator confirm them himself in "confirmation tracking" tab. It\s recommanded to activate the Piwigo\'s option "Email admins when a new user registers" (see in Piwigo\'s configuration options) and to use the "Information email to user" to warn new registers to wait on their account activation. 221 $lang['UAM_confirmmailTitle_d'] = 'This option allows a user to either confirm registration by clicking on a link received in an email sent upon registration or administrators to manually activate the registration. 222 <br><br> 223 In first case, the e-mail is composed of a customizable part to introduce a little welcome note and a fixed part containing the activation link that is generated from a random key that can possibly regenerate through the "Tracking confirmations" tab. 224 <br><br> 225 In second case, the validation link is send to the gallery administrators. Visitors have to wait until an administrator confirm them himself by using the validation link or in "confirmation tracking" tab. 224 226 <br> 225 227 <b style="color: red;">NB: Options "Deadline for confirmation of registration limited" and "Remind unconfirmed users " have to be set to off when admin\'s manual confirmation is enabled.</b> -
extensions/UserAdvManager/branches/2.40/language/en_UK/plugin.lang.php
r17512 r18160 14 14 $lang['UAM_User: %s'] = 'User : %s'; 15 15 $lang['UAM_Password: %s'] = 'Password: %s'; 16 $lang['UAM_Link: %s'] = 'Please, click on this link to confirm yourregistration : %s';16 $lang['UAM_Link: %s'] = 'Please, click on this link to confirm the registration : %s'; 17 17 18 18 … … 155 155 156 156 // --------- Starting below: New or revised $lang ---- from version 2.15.4 157 $lang['UAM_ Force_Validation'] = 'Manual confirmation';157 $lang['UAM_Manual_Validation'] = 'Manual confirmation'; 158 158 $lang['UAM_Confirm_Mail_true'] = ' Enable - Confirmation by user'; 159 $lang['UAM_Confirm_Mail_local'] = ' Enable - Confirmation by admin (no confirmation key sent)';159 $lang['UAM_Confirm_Mail_local'] = ' Enable - Confirmation by admin'; 160 160 // --------- End: New or revised $lang ---- from version 2.15.4 161 161 … … 427 427 Note: This message will disappear after you have made the necessary correction and reloaded the admin page.<br><br>'; 428 428 // --------- End: New or revised $lang ---- from version 2.40.4 and 2.30.7 429 430 431 // --------- Starting below: New or revised $lang ---- from version 2.41.0 432 $lang['UAM_Subject admin validation for %s'] = 'Registration of %s waits for validation'; 433 $lang['UAM_Manual_validation_needed_for %s'] = 'The user %s has registered and awaits for manual validation by an admin.'; 434 // --------- End: New or revised $lang ---- from version 2.41.0 429 435 ?> -
extensions/UserAdvManager/branches/2.40/language/es_ES/plugin.lang.php
r17805 r18160 215 215 216 216 // --------- Starting below: New or revised $lang ---- from version 2.15.4 217 $lang['UAM_ Force_Validation'] = 'Validación manual';217 $lang['UAM_Manual_Validation'] = 'Validación manual'; 218 218 $lang['UAM_Confirm_Mail_true'] = ' Activar - La validación por el usuario'; 219 $lang['UAM_Confirm_Mail_local'] = ' Activar - La validación por el administrador (sin clave de validación enviado)';219 $lang['UAM_Confirm_Mail_local'] = ' Activar - La validación por el administrador'; 220 220 // --------- End: New or revised $lang ---- from version 2.15.4 221 221 -
extensions/UserAdvManager/branches/2.40/language/fr_FR/help.lang.php
r14730 r18160 249 249 Dans le premier cas, le message envoyé comprend une partie fixe, avec le lien d\'activation généré à partir d\'une clef aléatoire (cette clé peut éventuellement être régénérée via l\'onglet "Suivi des confirmations"), et une partie personnalisable par un texte d\'accueil. 250 250 <br><br> 251 Dans le second cas, <b><u>il n\'y a pas d\'envoi de clé de confirmation par email</u></b>. Les visiteurs doivent patienter que l\'administrateur valide lui même leur inscription via l\'onglet "Suivi des confirmations". Il est conseillé d\'activer la notification des administrateurs lors des inscriptions (voir la configuration des options de Piwigo) et d\'utiliser la fonction "Email d\'information à l\'utilisateur" pour avertir les nouveaux inscrits de la nécessité de patienter avant activation de leur compte.251 Dans le second cas, l\'email avec lien de validation est envoyé aux administrateurs de la galerie. Les visiteurs doivent patienter qu\'un administrateur valide lui même leur inscription soit par ce lien, soit par l\'onglet "Suivi des confirmations". 252 252 <br> 253 253 <b style="color: red;">NB: Les options "Limitation du délai de confirmation d\'inscription" et "Mail de rappel aux inscrits non confirmés" doivent être désactivées lorsque la confirmation manuelle est active.</b> -
extensions/UserAdvManager/branches/2.40/language/fr_FR/plugin.lang.php
r17512 r18160 14 14 $lang['UAM_User: %s'] = 'Utilisateur : %s'; 15 15 $lang['UAM_Password: %s'] = 'Mot de passe: %s'; 16 $lang['UAM_Link: %s'] = 'Cliquez sur le lien suivant pour confirmer votreinscription : %s';16 $lang['UAM_Link: %s'] = 'Cliquez sur le lien suivant pour confirmer l\'inscription : %s'; 17 17 18 18 … … 167 167 168 168 // --------- Starting below: New or revised $lang ---- from version 2.15.4 169 $lang['UAM_ Force_Validation'] = 'Confirmation manuelle';169 $lang['UAM_Manual_Validation'] = 'Confirmation manuelle'; 170 170 $lang['UAM_Confirm_Mail_true'] = ' Activer - Confirmation par le visiteur'; 171 $lang['UAM_Confirm_Mail_local'] = ' Activer - Confirmation par l\'administrateur (pas d\'envoi de clé de confirmation)';171 $lang['UAM_Confirm_Mail_local'] = ' Activer - Confirmation par l\'administrateur'; 172 172 // --------- End: New or revised $lang ---- from version 2.15.4 173 173 … … 432 432 Note : Ce message disparaitra après que vous ayez effectué la correction nécessaire et rechargé la page d\'administration.<br><br>'; 433 433 // --------- End: New or revised $lang ---- from version 2.40.4 and 2.30.7 434 435 // --------- Starting below: New or revised $lang ---- from version 2.41.0 436 $lang['UAM_Subject admin validation for %s'] = 'Inscription de %s à valider'; 437 $lang['UAM_Manual_validation_needed_for %s'] = 'L\'utilisateur %s s\'est inscrit et demande une validation manuelle par un administrateur.'; 438 // --------- End: New or revised $lang ---- from version 2.41.0 434 439 ?> -
extensions/UserAdvManager/branches/2.40/language/hu_HU/plugin.lang.php
r17449 r18160 176 176 177 177 // --------- Starting below: New or revised $lang ---- from version 2.15.4 178 $lang['UAM_ Force_Validation'] = 'Kézi érvényesítés';178 $lang['UAM_Manual_Validation'] = 'Kézi érvényesítés'; 179 179 $lang['UAM_Confirm_Mail_true'] = ' Bekapcsolva - Érvényesítés a felhasználó által'; 180 $lang['UAM_Confirm_Mail_local'] = ' Bekapcsolva - Érvényesítés az adminisztrátor által (nincs érvényesítő kulcs küldés)';180 $lang['UAM_Confirm_Mail_local'] = ' Bekapcsolva - Érvényesítés az adminisztrátor által'; 181 181 // --------- End: New or revised $lang ---- from version 2.15.4 182 182 -
extensions/UserAdvManager/branches/2.40/language/it_IT/plugin.lang.php
r17805 r18160 175 175 176 176 // --------- Starting below: New or revised $lang ---- from version 2.15.4 177 $lang['UAM_ Force_Validation'] = 'Conferma manuale';177 $lang['UAM_Manual_Validation'] = 'Conferma manuale'; 178 178 $lang['UAM_Confirm_Mail_true'] = ' Attivare - Validazione da parte dell\'utente'; 179 $lang['UAM_Confirm_Mail_local'] = ' Attivare - Validazione da parte di un amministratore (nessuna chiave di validazione inviata)';179 $lang['UAM_Confirm_Mail_local'] = ' Attivare - Validazione da parte di un amministratore'; 180 180 // --------- End: New or revised $lang ---- from version 2.15.4 181 181 -
extensions/UserAdvManager/branches/2.40/language/lv_LV/plugin.lang.php
r17805 r18160 213 213 214 214 // --------- Starting below: New or revised $lang ---- from version 2.15.4 215 $lang['UAM_ Force_Validation'] = 'Manuālā apstiprināšana';215 $lang['UAM_Manual_Validation'] = 'Manuālā apstiprināšana'; 216 216 $lang['UAM_Confirm_Mail_true'] = ' Iespējot – Apstiprinājis lietotājs'; 217 $lang['UAM_Confirm_Mail_local'] = ' Iespējot – Apstiprinājis administrators (netika nosūtīta apstiprināšanas atslēga)';217 $lang['UAM_Confirm_Mail_local'] = ' Iespējot – Apstiprinājis administrators'; 218 218 // --------- End: New or revised $lang ---- from version 2.15.4 219 219 -
extensions/UserAdvManager/branches/2.40/main.inc.php
r17512 r18160 33 33 add_event_handler('get_admin_plugin_menu_links', 'UAM_admin_menu'); 34 34 35 // Lastvisit table feed for Ghost Tracker36 // -------------------------------------- 37 add_event_handler('loc_begin_index', 'UAM_ GhostTracker');35 // Features and controls on user connexion 36 // --------------------------------------- 37 add_event_handler('loc_begin_index', 'UAM_Init'); 38 38 39 39 // User creation … … 65 65 // ---------------------------------------------------------------------------------------------------- 66 66 add_event_handler('init', 'UAM_InitPage'); 67 68 // Display messages about Login rejected, etc 69 // --------------------------- 70 add_event_handler('init','UAM_DisplayMsg'); 71 add_event_handler('identification','UAM_DisplayMsg'); 67 72 68 73 // PWG_Stuffs module -
extensions/UserAdvManager/branches/2.40/maintain.inc.php
r14730 r18160 214 214 } 215 215 216 // Piwigo's native tables modifications for validation status 217 // ---------------------------------------------------------- 218 $query = ' 219 SHOW COLUMNS FROM '.USERS_TABLE.' 220 LIKE "UAM_validated" 221 ;'; 222 223 $result = pwg_query($query); 224 225 if(!pwg_db_fetch_row($result)) 226 { 227 $q = ' 228 ALTER TABLE '.USERS_TABLE.' 229 ADD UAM_validated enum("true","false") 230 ;'; 231 pwg_query($q); 232 } 233 216 234 /* *************************************************************************** */ 217 235 /* **************** END - Database actions and initialization **************** */ … … 379 397 upgrade_2300_2400(); 380 398 } 399 400 if (version_compare($conf['UserAdvManager_Version'], '2.40.6') < 0) 401 { 402 /* upgrade from version 2.40.x to 2.40.6 */ 403 /* ************************************* */ 404 upgrade_2400_2406(); 405 } 381 406 } 382 407 … … 448 473 ;'; 449 474 pwg_query($q); 475 476 $q = ' 477 ALTER TABLE '.USERS_TABLE.' 478 DROP UAM_validated 479 ;'; 480 pwg_query($q); 450 481 } 451 482 ?>
Note: See TracChangeset
for help on using the changeset viewer.