Changeset 4317 for extensions/NBC_UserAdvManager
- Timestamp:
- Nov 19, 2009, 10:54:46 PM (15 years ago)
- Location:
- extensions/NBC_UserAdvManager/branches/2.12
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/NBC_UserAdvManager/branches/2.12/admin/UserAdvManager_admin.php
r4168 r4317 45 45 $error = array(); 46 46 $UserAdvManager_Password_Test_Score = 0; 47 $pattern = '/;/'; 48 $replacement = '.'; 49 50 $UserAdvManager_MailInfo_Error_Txt = false; 51 $UserAdvManager_ConfirmMail_Error_Txt = false; 52 $UserAdvManager_Reminder_Error_Txt = false; 53 $UserAdvManager_ConfirmMail_Error_Txt1 = false; 54 $UserAdvManager_ConfirmMail_Error_Txt2 = false; 47 55 48 56 // +-----------------------------------------------------------------------+ … … 60 68 61 69 if (isset($_POST['submit']) and !is_adviser() and isset($_POST['UserAdvManager_Mail_Info']) and isset($_POST['UserAdvManager_No_Casse']) and isset($_POST['UserAdvManager_Username_Char']) and isset($_POST['UserAdvManager_Confirm_Mail']) and isset($_POST['UserAdvManager_No_Comment_Anonymous']) and isset($_POST['UserAdvManager_Password_Enforced']) and isset($_POST['UserAdvManager_AdminPassword_Enforced']) and isset($_POST['UserAdvManager_GhostUser_Tracker'])) 62 { 70 { 63 71 $_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text'])); 72 64 73 $_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text'])); 65 74 66 $_POST['UserAdvManager_GhostTracker_ReminderText'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_GhostTracker_ReminderText'])); 75 $_POST['UserAdvManager_GhostTracker_ReminderText'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_GhostTracker_ReminderText'])); 76 77 78 /* Control of semicolons - Replaced by dots - Warning message is displayed */ 79 if ((preg_match($pattern, $_POST['UserAdvManager_MailInfo_Text'])) or (preg_match($pattern, $_POST['UserAdvManager_GhostTracker_ReminderText'])) or (preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_Text']))) 80 { 81 if (preg_match($pattern, $_POST['UserAdvManager_MailInfo_Text'])) 82 { 83 $_POST['UserAdvManager_MailInfo_Text'] = preg_replace($pattern, $replacement, $_POST['UserAdvManager_MailInfo_Text']); 84 $UserAdvManager_MailInfo_Error_Txt = true; 85 } 86 87 if (preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_Text'])) 88 { 89 $_POST['UserAdvManager_ConfirmMail_Text'] = preg_replace($pattern, $replacement, $_POST['UserAdvManager_ConfirmMail_Text']); 90 $UserAdvManager_ConfirmMail_Error_Txt = true; 91 } 92 93 if (preg_match($pattern, $_POST['UserAdvManager_GhostTracker_ReminderText'])) 94 { 95 $_POST['UserAdvManager_GhostTracker_ReminderText'] = preg_replace($pattern, $replacement, $_POST['UserAdvManager_GhostTracker_ReminderText']); 96 $UserAdvManager_Reminder_Error_Txt = true; 97 } 98 99 array_push($page['errors'], l10n('mail_text_error')); 100 } 67 101 68 102 $newconf_nbc_UserAdvManager = $_POST['UserAdvManager_Mail_Info'].';'.$_POST['UserAdvManager_No_Casse'].';'.$_POST['UserAdvManager_Confirm_Mail'].';'.(isset($_POST['UserAdvManager_No_Confirm_Group'])?$_POST['UserAdvManager_No_Confirm_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Group'])?$_POST['UserAdvManager_Validated_Group']:'').';'.(isset($_POST['UserAdvManager_Validated_Status'])?$_POST['UserAdvManager_Validated_Status']:'').';'.$_POST['UserAdvManager_No_Comment_Anonymous'].';'.$_POST['UserAdvManager_Username_Char'].';'.$_POST['UserAdvManager_Username_List'].';'.(isset($_POST['UserAdvManager_No_Confirm_Status'])?$_POST['UserAdvManager_No_Confirm_Status']:'').';'.$_POST['UserAdvManager_MailInfo_Text'].';'.$_POST['UserAdvManager_ConfirmMail_Text'].';'.$_POST['UserAdvManager_MailExclusion'].';'.$_POST['UserAdvManager_MailExclusion_List'].';'.$_POST['UserAdvManager_Password_Enforced'].';'.$_POST['UserAdvManager_Password_Score'].';'.$_POST['UserAdvManager_AdminPassword_Enforced'].';'.$_POST['UserAdvManager_GhostUser_Tracker'].';'.$_POST['UserAdvManager_GhostTracker_DayLimit'].';'.$_POST['UserAdvManager_GhostTracker_ReminderText']; … … 107 141 $result = pwg_query($query); 108 142 109 while ($row = mysql_fetch_a rray($result))143 while ($row = mysql_fetch_assoc($result)) 110 144 { 111 145 $groups[$row['id']] = $row['name']; … … 214 248 'UserAdvManager_GHOSTRACKER_REMINDERTEXT' => $conf_nbc_UserAdvManager[19], 215 249 'UserAdvManager_PASSWORD_TEST_SCORE' => $UserAdvManager_Password_Test_Score, 250 'UserAdvManager_ERROR_REPORTS1' => $UserAdvManager_MailInfo_Error_Txt, 251 'UserAdvManager_ERROR_REPORTS2' => $UserAdvManager_ConfirmMail_Error_Txt, 252 'UserAdvManager_ERROR_REPORTS3' => $UserAdvManager_Reminder_Error_Txt, 216 253 ) 217 254 ); … … 238 275 $result = pwg_query($query); 239 276 240 while($row = mysql_fetch_a rray($result))277 while($row = mysql_fetch_assoc($result)) 241 278 { 242 $msg_error1 .= (($msg_error1 <> '') ? '<br/>' : '') . l10n('Err_audit_no_casse'). $row['username'];279 $msg_error1 .= (($msg_error1 <> '') ? '<br/>' : '') . l10n('Err_audit_no_casse').stripslashes($row['username']); 243 280 } 244 281 } … … 256 293 $result = pwg_query($query); 257 294 258 while($row = mysql_fetch_a rray($result))295 while($row = mysql_fetch_assoc($result)) 259 296 { 260 if (!ValidateUsername( $row['username']))261 $msg_error2 .= (($msg_error2 <> '') ? '<br/>' : '') . l10n('Err_audit_username_char'). $row['username'];297 if (!ValidateUsername(stripslashes($row['username']))) 298 $msg_error2 .= (($msg_error2 <> '') ? '<br/>' : '') . l10n('Err_audit_username_char').stripslashes($row['username']); 262 299 } 263 300 } … … 275 312 $result = pwg_query($query); 276 313 277 while($row = mysql_fetch_a rray($result))314 while($row = mysql_fetch_assoc($result)) 278 315 { 279 316 $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); … … 284 321 if (preg_match($pattern, $row['mail_address'])) 285 322 { 286 $msg_error3 .= (($msg_error3 <> '') ? '<br/>' : '') . l10n('Err_audit_email_forbidden'). $row['username'].' ('.$row['mail_address'].')';323 $msg_error3 .= (($msg_error3 <> '') ? '<br/>' : '') . l10n('Err_audit_email_forbidden').stripslashes($row['username']).' ('.$row['mail_address'].')'; 287 324 } 288 325 } … … 340 377 { 341 378 $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'])); 379 342 380 $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'])); 381 382 /* Control of semicolons - Replaced by dots - Warning message displayed */ 383 if ((preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'])) or (preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2']))) 384 { 385 if ((preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1']))) 386 { 387 $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'] = preg_replace($pattern, $replacement, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1']); 388 $UserAdvManager_ConfirmMail_Error_Txt1 = true; 389 } 390 391 if ((preg_match($pattern, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2']))) 392 { 393 $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2'] = preg_replace($pattern, $replacement, $_POST['UserAdvManager_ConfirmMail_ReMail_Txt2']); 394 395 $UserAdvManager_ConfirmMail_Error_Txt2 = true; 396 } 397 398 array_push($page['errors'], l10n('mail_text_error')); 399 } 343 400 344 401 $newconf_nbc_UserAdvManager_ConfirmMail = $_POST['UserAdvManager_ConfirmMail_TimeOut'].';'.$_POST['UserAdvManager_ConfirmMail_Delay'].';'.$_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'].';'.$_POST['UserAdvManager_ConfirmMail_Remail'].';'.$_POST['UserAdvManager_ConfirmMail_ReMail_Txt2']; … … 371 428 'UserAdvManager_CONFIRMMAIL_REMAIL_TXT1' => $conf_nbc_UserAdvManager_ConfirmMail[2], 372 429 'UserAdvManager_CONFIRMMAIL_REMAIL_TXT2' => $conf_nbc_UserAdvManager_ConfirmMail[4], 430 'UserAdvManager_ERROR_REPORTS1' => $UserAdvManager_ConfirmMail_Error_Txt1, 431 'UserAdvManager_ERROR_REPORTS2' => $UserAdvManager_ConfirmMail_Error_Txt2, 373 432 ) 374 433 ); … … 588 647 WHERE id = '".$user_id."' 589 648 ;"; 590 $data = mysql_fetch_a rray(pwg_query($query));649 $data = mysql_fetch_assoc(pwg_query($query)); 591 650 592 ResendMail2User($typemail,$user_id, $data['username'],$data['mail_address'],true);651 ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],true); 593 652 } 594 653 array_push( … … 673 732 ;"; 674 733 675 $data = mysql_fetch_a rray(pwg_query($query));734 $data = mysql_fetch_assoc(pwg_query($query)); 676 735 677 ResendMail2User($typemail,$user_id, $data['username'],$data['mail_address'],false);736 ResendMail2User($typemail,$user_id,stripslashes($data['username']),$data['mail_address'],false); 678 737 } 679 738 array_push( … … 757 816 ;"; 758 817 759 $data = mysql_fetch_a rray(pwg_query($query));818 $data = mysql_fetch_assoc(pwg_query($query)); 760 819 761 820 ForceValidation($data['id']); … … 788 847 $result = pwg_query($query); 789 848 790 while ($row = mysql_fetch_a rray($result))849 while ($row = mysql_fetch_assoc($result)) 791 850 { 792 851 $groups[$row['id']] = $row['name']; … … 884 943 'U_PROFILE' => $profile_url.$local_user['id'], 885 944 'U_PERM' => $perm_url.$local_user['id'], 886 'USERNAME' => $local_user['username']945 'USERNAME' => stripslashes($local_user['username']) 887 946 .($local_user['id'] == $conf['guest_id'] 888 947 ? '<BR />['.l10n('is_the_guest').']' : '') … … 1112 1171 ;"; 1113 1172 1114 $data = mysql_fetch_a rray(pwg_query($query));1173 $data = mysql_fetch_assoc(pwg_query($query)); 1115 1174 1116 ghostreminder($user_id, $data['username'],$data['mail_address']);1175 ghostreminder($user_id,stripslashes($data['username']),$data['mail_address']); 1117 1176 } 1118 1177 array_push( … … 1156 1215 $result = pwg_query($query); 1157 1216 1158 while ($row = mysql_fetch_a rray($result))1217 while ($row = mysql_fetch_assoc($result)) 1159 1218 { 1160 1219 list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); … … 1183 1242 $result = pwg_query($query); 1184 1243 1185 while($row = mysql_fetch_a rray($result))1244 while($row = mysql_fetch_assoc($result)) 1186 1245 { 1187 1246 list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();')); … … 1276 1335 'ID' => $local_user['id'], 1277 1336 'CHECKED' => $checked, 1278 'USERNAME' => $local_user['username']1337 'USERNAME' => stripslashes($local_user['username']) 1279 1338 .($local_user['id'] == $conf['guest_id'] 1280 1339 ? '<BR />['.l10n('is_the_guest').']' : '') -
extensions/NBC_UserAdvManager/branches/2.12/admin/confirmmail.tpl
r4160 r4317 21 21 22 22 {if $UserAdvManager_CONFIRMMAIL_REMAIL_TRUE} 23 {if $UserAdvManager_ERROR_REPORTS1} 24 <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br> 25 <textarea name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br> 26 </li> 27 {else} 23 28 <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br> 24 29 <textarea name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br> 25 30 </li> 26 27 <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br> 28 <textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br> 29 </li> 31 {/if} 30 32 {else} 31 33 <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br> 32 34 <textarea name="UserAdvManager_ConfirmMail_ReMail_Txt1" id="UserAdvManager_ConfirmMail_ReMail_Txt1" rows="10" cols="80" readonly{$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT1}</textarea><br><br> 33 35 </li> 34 36 {/if} 37 38 {if $UserAdvManager_CONFIRMMAIL_REMAIL_TRUE} 39 {if $UserAdvManager_ERROR_REPORTS2} 40 <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br> 41 <textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br> 42 </li> 43 {else} 44 <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br> 45 <textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br> 46 </li> 47 {/if} 48 {else} 35 49 <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br> 36 50 <textarea name="UserAdvManager_ConfirmMail_ReMail_Txt2" id="UserAdvManager_ConfirmMail_ReMail_Txt2" rows="10" cols="80" readonly {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_REMAIL_TXT2}</textarea><br> -
extensions/NBC_UserAdvManager/branches/2.12/admin/global.tpl
r4160 r4317 69 69 70 70 {if $UserAdvManager_GHOSTRACKER_TRUE} 71 {if $UserAdvManager_ERROR_REPORTS3} 72 <li><label>{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br> 73 <textarea name="UserAdvManager_GhostTracker_ReminderText" id="UserAdvManager_GhostTracker_ReminderText" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_GHOSTRACKER_REMINDERTEXT}</textarea><br><br> 74 </li> 75 {else} 71 76 <li><label>{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br> 72 77 <textarea name="UserAdvManager_GhostTracker_ReminderText" id="UserAdvManager_GhostTracker_ReminderText" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_GHOSTRACKER_REMINDERTEXT}</textarea><br><br> 73 78 </li> 79 {/if} 74 80 {else} 75 81 <li><label>{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br> … … 90 96 </li> 91 97 92 {if $UserAdvManager_MAIL_INFO_TRUE} 98 {if $UserAdvManager_MAIL_INFO_TRUE} 99 {if $UserAdvManager_ERROR_REPORTS1} 100 <li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br> 101 <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea><br><br> 102 </li> 103 {else} 93 104 <li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br> 94 105 <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea><br><br> 95 106 </li> 107 {/if} 96 108 {else} 97 109 <li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br> … … 105 117 </li> 106 118 107 {if $UserAdvManager_CONFIRM_MAIL_TRUE} 119 {if $UserAdvManager_CONFIRM_MAIL_TRUE} 120 {if $UserAdvManager_ERROR_REPORTS2} 121 <li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br> 122 <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea><br><br> 123 </li> 124 {else} 108 125 <li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br> 109 126 <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea><br><br> 110 127 </li> 128 {/if} 111 129 {else} 112 130 <li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br> -
extensions/NBC_UserAdvManager/branches/2.12/include/functions_UserAdvManager.inc.php
r4188 r4317 18 18 { 19 19 case 1: 20 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Add of %s', $username));20 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Add of %s', stripslashes($username))); 21 21 $password = $password <> '' ? $password : l10n('UserAdvManager_empty_pwd'); 22 22 23 if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[10]) and $conf_nbc_UserAdvManager[10] <> '') 24 $infos1_perso = get_user_language_desc($conf_nbc_UserAdvManager[10])."\n\n"; 23 if (isset($conf_nbc_UserAdvManager[10]) and $conf_nbc_UserAdvManager[10] <> '') 24 { 25 if (function_exists('get_user_language_desc')) 26 { 27 $infos1_perso = get_user_language_desc($conf_nbc_UserAdvManager[10])."\n\n"; 28 } 29 else $infos1_perso = l10n($conf_nbc_UserAdvManager[10])."\n\n"; 30 } 25 31 26 32 break; 27 33 28 34 case 2: 29 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', $username));35 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', stripslashes($username))); 30 36 $password = $password <> '' ? $password : l10n('UserAdvManager_empty_pwd'); 31 37 … … 33 39 34 40 case 3: 35 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', $username));41 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Update of %s', stripslashes($username))); 36 42 $password = $password <> '' ? $password : l10n('UserAdvManager_no_update_pwd'); 37 43 … … 42 48 { 43 49 $infos1 = array( 44 get_l10n_args('infos_mail %s', $username),45 get_l10n_args('User: %s', $username),50 get_l10n_args('infos_mail %s', stripslashes($username)), 51 get_l10n_args('User: %s', stripslashes($username)), 46 52 get_l10n_args('Password: %s', $password), 47 53 get_l10n_args('Email: %s', $email), … … 59 65 ); 60 66 61 if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[11]) and $conf_nbc_UserAdvManager[11] <> '') 62 $infos2_perso = get_user_language_desc($conf_nbc_UserAdvManager[11])."\n\n"; 67 if (isset($conf_nbc_UserAdvManager[11]) and $conf_nbc_UserAdvManager[11] <> '') 68 { 69 if (function_exists('get_user_language_desc')) 70 { 71 $infos2_perso = get_user_language_desc($conf_nbc_UserAdvManager[11])."\n\n"; 72 } 73 else $infos2_perso = l10n($conf_nbc_UserAdvManager[11])."\n\n"; 74 } 63 75 } 64 76 … … 108 120 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_with_key_of_%s', $username)); 109 121 110 if ( function_exists('get_user_language_desc') andisset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and $confirm)122 if (isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and $confirm) 111 123 { 112 $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 113 114 $infos2 = array 115 ( 116 get_l10n_args('Link: %s', ResetConfirmMail($user_id)), 117 get_l10n_args('', ''), 118 ); 124 if (function_exists('get_user_language_desc')) 125 { 126 $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 127 } 128 else $infos1 = l10n($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 129 130 $infos2 = array 131 ( 132 get_l10n_args('Link: %s', ResetConfirmMail($user_id)), 133 get_l10n_args('', ''), 134 ); 119 135 } 136 120 137 break; 121 138 122 139 case 2: 123 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_without_key_of_%s', 124 125 if ( function_exists('get_user_language_desc') andisset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and !$confirm)140 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Reminder_without_key_of_%s',$username)); 141 142 if (isset($conf_nbc_UserAdvManager_ConfirmMail[2]) and $conf_nbc_UserAdvManager_ConfirmMail[2] <> '' and isset($conf_nbc_UserAdvManager_ConfirmMail[3]) and $conf_nbc_UserAdvManager_ConfirmMail[3] == 'true' and !$confirm) 126 143 { 127 $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 144 if (function_exists('get_user_language_desc')) 145 { 146 $infos1 = get_user_language_desc($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 147 } 148 else $infos1 = l10n($conf_nbc_UserAdvManager_ConfirmMail[2])."\n\n"; 128 149 } 150 129 151 break; 130 152 } 153 131 154 pwg_mail($email, array( 132 155 'subject' => $subject, … … 157 180 $subject = '['.$conf['gallery_title'].'] '.l10n_args(get_l10n_args('Ghost_remainder_of_%s', $username)); 158 181 159 if (function_exists('get_user_language_desc') and isset($conf_nbc_UserAdvManager[19]) and $conf_nbc_UserAdvManager[19] <> '' and isset($conf_nbc_UserAdvManager[17]) and $conf_nbc_UserAdvManager[17] == 'true') 160 { 161 $infos1 = get_user_language_desc($conf_nbc_UserAdvManager[19])."\n\n"; 182 if (isset($conf_nbc_UserAdvManager[19]) and $conf_nbc_UserAdvManager[19] <> '' and isset($conf_nbc_UserAdvManager[17]) and $conf_nbc_UserAdvManager[17] == 'true') 183 { 184 if (function_exists('get_user_language_desc')) 185 { 186 $infos1 = get_user_language_desc($conf_nbc_UserAdvManager[19])."\n\n"; 187 } 188 else $infos1 = l10n($conf_nbc_UserAdvManager[19])."\n\n"; 189 162 190 resetlastvisit($user_id); 163 191 } … … 351 379 WHERE id = '".$id."' 352 380 ;"; 353 $data = mysql_fetch_a rray(pwg_query($query));381 $data = mysql_fetch_assoc(pwg_query($query)); 354 382 355 383 if (!empty($data) and isset($data['user_id']) and !isset($data['date_check'])) … … 517 545 WHERE user_id = '".$id."' 518 546 ;"; 519 $data = mysql_fetch_a rray(pwg_query($query));547 $data = mysql_fetch_assoc(pwg_query($query)); 520 548 521 549 if (!empty($data) and isset($data['user_id']) and !isset($data['date_check'])) … … 588 616 list($username) = mysql_fetch_row(pwg_query($query)); 589 617 590 return isset($username) ? $username: '';618 return isset($username) ? stripslashes($username) : ''; 591 619 } 592 620 } … … 616 644 617 645 /* Function called from main.inc.php - Check if user's email is in excluded email providers list */ 646 /* Doesn't work on call - Must be copied in main.inc.php to work */ 618 647 function ValidateEmailProvider($email) 619 648 { … … 629 658 $pattern = '/'.$conf_nbc_MailExclusion[$i].'/'; 630 659 if (preg_match($pattern, $ncsemail)) 660 { 631 661 return false; 632 else 662 } 663 else 664 { 633 665 return true; 666 } 634 667 } 635 668 } … … 690 723 $result = pwg_query($query); 691 724 692 while ($row = mysql_fetch_a rray($result))725 while ($row = mysql_fetch_assoc($result)) 693 726 { 694 727 $user = $row; … … 717 750 $result = pwg_query($query); 718 751 719 while ($row = mysql_fetch_a rray($result))752 while ($row = mysql_fetch_assoc($result)) 720 753 { 721 754 array_push( … … 755 788 $result = pwg_query($query); 756 789 757 while ($row = mysql_fetch_a rray($result))790 while ($row = mysql_fetch_assoc($result)) 758 791 { 759 792 $user = $row; -
extensions/NBC_UserAdvManager/branches/2.12/language/de_DE/plugin.lang.php
r4250 r4317 172 172 $lang['GhostTracker_Init_OK'] = 'Geist Tracker neu gehstellt !'; 173 173 // --------- End: New or revised $lang ---- from version 2.12.2 174 // --------- Starting below: New or revised $lang ---- from version 2.12.7 175 /* TODO */$lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.'; 176 // --------- End: New or revised $lang ---- from version 2.12.7 174 177 175 178 -
extensions/NBC_UserAdvManager/branches/2.12/language/en_UK/plugin.lang.php
r4250 r4317 173 173 $lang['GhostTracker_Init_OK'] = 'Ghost Tracker reset done !'; 174 174 // --------- End: New or revised $lang ---- from version 2.12.2 175 // --------- Starting below: New or revised $lang ---- from version 2.12.7 176 $lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.'; 177 // --------- End: New or revised $lang ---- from version 2.12.7 175 178 176 179 -
extensions/NBC_UserAdvManager/branches/2.12/language/es_ES/plugin.lang.php
r4250 r4317 173 173 $lang['GhostTracker_Init_OK'] = '¡Ghost Tracker restablecer hecho!'; 174 174 // --------- End: New or revised $lang ---- from version 2.12.2 175 // --------- Starting below: New or revised $lang ---- from version 2.12.7 176 /* TODO */$lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.'; 177 // --------- End: New or revised $lang ---- from version 2.12.7 175 178 176 179 -
extensions/NBC_UserAdvManager/branches/2.12/language/fr_FR/plugin.lang.php
r4250 r4317 172 172 $lang['GhostTracker_Init_OK'] = 'Initialisation Ghost Tracker effectuée !'; 173 173 // --------- End: New or revised $lang ---- from version 2.12.2 174 // --------- Starting below: New or revised $lang ---- from version 2.12.7 175 $lang['mail_text_error'] = '<b>Attention!</b> - Le point-virgule (;) n\'est pas autorisé dans le texte additionnel des emails. Ce caractère a été automatiquement remplacé par un point (.). Pour information, le(s) texte(s) modifié(s) est(sont) affiché(s) en rouge dans le(s) champ(s) correspondant(s). Veuillez le(s) vérifier.'; 176 // --------- End: New or revised $lang ---- from version 2.12.7 174 177 175 178 -
extensions/NBC_UserAdvManager/branches/2.12/language/it_IT/plugin.lang.php
r4250 r4317 173 173 /* TODO */$lang['GhostTracker_Init_OK'] = 'Ghost Tracker reset done !'; 174 174 // --------- End: New or revised $lang ---- from version 2.12.2 175 // --------- Starting below: New or revised $lang ---- from version 2.12.7 176 /* TODO */$lang['mail_text_error'] = '<b>Warning!</b> - Semicolons (;) are not allowed in addtionnal email text. This Character have been automatically replaced by a dot (.). For information, the amended text(s) is(are) shown in red in the corresponding field(s). Please, check it(them) out.'; 177 // --------- End: New or revised $lang ---- from version 2.12.7 175 178 176 179 -
extensions/NBC_UserAdvManager/branches/2.12/main.inc.php
r4250 r4317 2 2 /* 3 3 Plugin Name: NBC UserAdvManager 4 Version: 2.12. 64 Version: 2.12.7 5 5 Description: Renforcer les possibilités de gestion des utilisateurs - Enforce users management 6 6 Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216 … … 99 99 -- 2.12.6 : Bug 1236 fixed - Admins was unable to add a new user in the user_list page. 100 100 Beginning of IT translations 101 102 -- 2.12.7 : Bug 1238 fixed - Simple custom email text wasn't send when Extended Description plugin wasn't set 103 Bug 1245 fixed - Semicolons (;) are no longer allowed in text areas (mail info text, ConfirmMail text, reminder text,...). They'll be replaced by dots (.). 104 Bug 1248 fixed - Php notice on user registration with a forbidden email domain 105 Bug 1250 fixed - Email provider didn't work after the third exclusion in list 106 Escaping all special characters typed in login name and recover them 101 107 */ 102 108 … … 286 292 from '.USERS_TABLE.' 287 293 where upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['email'].'\');'; 288 list($count) = mysql_fetch_array(pwg_query($query)); 289 if ($count != 0) 290 { 291 return l10n('reg_err_mail_address_dbl'); 292 } 293 } 294 } 295 else 296 { 297 /* ***************************** */ 298 /* Standard Piwigo's email check */ 299 /* ***************************** */ 300 $atom = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]'; // before arobase 301 $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 302 $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 303 304 if (!preg_match($regex, $_POST['mail_address'])) 305 { 306 return l10n('reg_err_mail_address'); 307 } 308 309 if (!empty($_POST['mail_address'])) 310 { 311 $query = ' 312 select count(*) 313 from '.USERS_TABLE.' 314 where upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['mail_address'].'\');'; 315 list($count) = mysql_fetch_array(pwg_query($query)); 294 list($count) = mysql_fetch_assoc(pwg_query($query)); 316 295 if ($count != 0) 317 296 { … … 372 351 373 352 /* Email without forbidden domains */ 374 if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address'])) 375 { 376 //$_POST['mail_address'] = ''; 377 return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 378 } 353 /* This doesn't work */ 354 // if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address'])) 355 // { 356 // $_POST['mail_address'] = ''; 357 // return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 358 // } 359 /* This work with a code copy of ValidateEmailProvider() function */ 360 if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address'])) 361 { 362 $ncsemail = strtolower($_POST['mail_address']); 363 $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]); 364 for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++) 365 { 366 $pattern = '/'.$conf_nbc_MailExclusion[$i].'/'; 367 if (preg_match($pattern, $ncsemail)) 368 { 369 $_POST['mail_address'] = ''; 370 return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 371 } 372 } 373 } 379 374 } 380 375 … … 393 388 { 394 389 /* Email without forbidden domains */ 395 if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address'])) 396 { 397 if (!ValidateEmailProvider($_POST['mail_address'])) 390 /* This doesn't work */ 391 // if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address'])) 392 // { 393 // if (!ValidateEmailProvider($_POST['mail_address'])) 394 // { 395 // $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 396 // unset($_POST['validate']); 397 // } 398 // } 399 /* This work with a code copy of ValidateEmailProvider() function */ 400 if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address'])) 398 401 { 399 $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 400 unset($_POST['validate']); 402 $ncsemail = strtolower($_POST['mail_address']); 403 $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]); 404 for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++) 405 { 406 $pattern = '/'.$conf_nbc_MailExclusion[$i].'/'; 407 if (preg_match($pattern, $ncsemail)) 408 { 409 $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 410 unset($_POST['validate']); 411 } 412 } 401 413 } 402 }403 414 404 415 $typemail = 3; … … 424 435 425 436 /* Sending registration confirmation by email */ 426 if (( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or (isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))437 if ((isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or (isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true')) 427 438 { 428 439 $confirm_mail_need = false; 429 440 430 if (!empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']))441 if (!empty($_POST['mail_address'])) 431 442 { 432 443 $query = ' … … 438 449 list($current_email) = mysql_fetch_row(pwg_query($query)); 439 450 440 if ( $_POST['mail_address'] != $current_email and ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))451 if ($_POST['mail_address'] != $current_email and ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true')) 441 452 442 453 $confirm_mail_need = true; 443 454 } 444 455 445 if ((!empty($_POST['use_new_pwd']) and ( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or $confirm_mail_need))456 if ((!empty($_POST['use_new_pwd']) and (isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or $confirm_mail_need)) 446 457 { 447 458 $query = ' … … 513 524 514 525 /* Email without forbidden domains */ 515 if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email'])) 516 { 517 $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 518 unset($_POST['submit_add']); 526 /* This doesn't work */ 527 // if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email'])) 528 // { 529 // $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 530 // unset($_POST['submit_add']); 531 // } 532 /* This work with a code copy of ValidateEmailProvider() function */ 533 if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email'])) 534 { 535 $ncsemail = strtolower($_POST['email']); 536 $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]); 537 for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++) 538 { 539 $pattern = '/'.$conf_nbc_MailExclusion[$i].'/'; 540 if (preg_match($pattern, $ncsemail)) 541 { 542 $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 543 unset($_POST['submit_add']); 544 } 545 } 519 546 } 520 547 }
Note: See TracChangeset
for help on using the changeset viewer.