Changeset 4316


Ignore:
Timestamp:
11/19/09 22:51:47 (10 years ago)
Author:
Eric
Message:

[NBC_UserAdvManager]
Bug 1238 fixed - Simple custom email text wasn't send when Extended Description plugin wasn't set
Bug 1245 fixed - Semicolons (;) are no longer allowed in text areas (mail info text, ConfirmMail text, reminder text,...). They'll be replaced by dots (.).
Bug 1248 fixed - Php notice on user registration with a forbidden email domain
Bug 1250 fixed - Email provider didn't work after the third exclusion in list

Location:
extensions/NBC_UserAdvManager/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php

    r4290 r4316  
    4545$error = array(); 
    4646$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; 
    4755 
    4856// +-----------------------------------------------------------------------+ 
     
    6068         
    6169        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  {  
    6371                $_POST['UserAdvManager_MailInfo_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_MailInfo_Text'])); 
     72     
    6473                $_POST['UserAdvManager_ConfirmMail_Text'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_Text'])); 
    6574 
    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    } 
    67101                 
    68102                $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']; 
     
    214248    'UserAdvManager_GHOSTRACKER_REMINDERTEXT' => $conf_nbc_UserAdvManager[19], 
    215249                '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, 
    216253    ) 
    217254  ); 
     
    340377                { 
    341378                $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'] = str_replace("\'", "'", str_replace("\\\\", "\\", $_POST['UserAdvManager_ConfirmMail_ReMail_Txt1'])); 
     379 
    342380                $_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    } 
    343400                   
    344401                $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']; 
     
    371428    'UserAdvManager_CONFIRMMAIL_REMAIL_TXT1'            => $conf_nbc_UserAdvManager_ConfirmMail[2], 
    372429    '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, 
    373432        ) 
    374433          );             
  • extensions/NBC_UserAdvManager/trunk/admin/confirmmail.tpl

    r4159 r4316  
    2121     
    2222{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} 
    2328                <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br> 
    2429                <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> 
    2530          </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} 
    3032{else} 
    3133                <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt1'|@translate}</label><br> 
    3234                <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> 
    3335          </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} 
    3549    <li><label>{'UserAdvManager_ConfirmMail_ReMail_Txt2'|@translate}</label><br> 
    3650                <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/trunk/admin/global.tpl

    r4159 r4316  
    6969       
    7070{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} 
    7176        <li><label>{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br> 
    7277        <textarea name="UserAdvManager_GhostTracker_ReminderText" id="UserAdvManager_GhostTracker_ReminderText" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_GHOSTRACKER_REMINDERTEXT}</textarea><br><br> 
    7378        </li> 
     79  {/if} 
    7480{else} 
    7581        <li><label>{'UserAdvManager_GhostTracker_ReminderText'|@translate}</label><br><br> 
     
    9096        </li> 
    9197 
    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} 
    93104        <li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br> 
    94105        <textarea name="UserAdvManager_MailInfo_Text" id="UserAdvManager_MailInfo_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILINFO_TEXT}</textarea><br><br> 
    95106        </li> 
     107  {/if} 
    96108{else} 
    97109        <li><label>{'UserAdvManager_MailInfo_Text'|@translate}</label><br><br> 
     
    105117        </li> 
    106118 
    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} 
    108125        <li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br> 
    109126        <textarea name="UserAdvManager_ConfirmMail_Text" id="UserAdvManager_ConfirmMail_Text" rows="10" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_CONFIRMMAIL_TEXT}</textarea><br><br> 
    110127        </li> 
     128  {/if} 
    111129{else} 
    112130        <li><label>{'UserAdvManager_ConfirmMail_Text'|@translate}</label><br><br> 
  • extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php

    r4290 r4316  
    644644 
    645645/* 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 */ 
    646647function ValidateEmailProvider($email) 
    647648{ 
     
    657658                        $pattern = '/'.$conf_nbc_MailExclusion[$i].'/'; 
    658659                        if (preg_match($pattern, $ncsemail)) 
     660      { 
    659661                        return false; 
    660                 else 
     662      } 
     663      else 
     664      { 
    661665                        return true; 
     666      } 
    662667                } 
    663668        } 
  • extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php

    r4249 r4316  
    172172$lang['GhostTracker_Init_OK'] = 'Geist Tracker neu gehstellt !'; 
    173173// --------- 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 
    174177 
    175178 
  • extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php

    r4249 r4316  
    173173$lang['GhostTracker_Init_OK'] = 'Ghost Tracker reset done !'; 
    174174// --------- 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 
    175178 
    176179 
  • extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php

    r4249 r4316  
    173173$lang['GhostTracker_Init_OK'] = '¡Ghost Tracker restablecer hecho!'; 
    174174// --------- 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 
    175178 
    176179 
  • extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php

    r4249 r4316  
    172172$lang['GhostTracker_Init_OK'] = 'Initialisation Ghost Tracker effectuée !'; 
    173173// --------- 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 
    174177 
    175178 
  • extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php

    r4281 r4316  
    173173/* TODO */$lang['GhostTracker_Init_OK'] = 'Ghost Tracker reset done !'; 
    174174// --------- 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 
    175178 
    176179 
  • extensions/NBC_UserAdvManager/trunk/main.inc.php

    r4290 r4316  
    100100            Beginning of IT translations 
    101101             
    102 -- 2.12.7 : Bug 1238 fixed -  Simple custom email text wasn't send when Extended Description plugin wasn't set. 
    103             Ending of IT translations 
     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 
    104106            Escaping all special characters typed in login name and recover them 
    105107*/ 
     
    297299    } 
    298300  } 
    299   else 
    300   { 
    301     /* ***************************** */ 
    302     /* Standard Piwigo's email check */ 
    303     /* ***************************** */ 
    304     $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase 
    305     $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name 
    306     $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i'; 
    307  
    308     if (!preg_match($regex, $_POST['mail_address'])) 
    309     { 
    310       return l10n('reg_err_mail_address'); 
    311     } 
    312      
    313     if (!empty($_POST['mail_address'])) 
    314     { 
    315       $query = ' 
    316 select count(*) 
    317 from '.USERS_TABLE.' 
    318 where upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['mail_address'].'\');'; 
    319       list($count) = mysql_fetch_assoc(pwg_query($query)); 
    320       if ($count != 0) 
    321       { 
    322         return l10n('reg_err_mail_address_dbl'); 
    323       } 
    324     } 
    325   } 
    326301/* ****************************************** */ 
    327302/* End of Piwigo's standard register controls */ 
     
    376351 
    377352  /* Email without forbidden domains */ 
    378   if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address'])) 
    379   { 
    380     //$_POST['mail_address'] = ''; 
    381     return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 
    382   } 
     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        }   
    383374} 
    384375 
     
    397388    { 
    398389      /* Email without forbidden domains */ 
    399       if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address'])) 
    400       { 
    401         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'])) 
    402401        { 
    403           $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 
    404           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          } 
    405413        } 
    406       } 
    407414 
    408415      $typemail = 3; 
     
    428435       
    429436      /* Sending registration confirmation by email */ 
    430       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')) 
    431438      { 
    432439        $confirm_mail_need = false; 
    433440               
    434         if (!empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address'])) 
     441        if (!empty($_POST['mail_address'])) 
    435442        { 
    436443          $query = ' 
     
    442449          list($current_email) = mysql_fetch_row(pwg_query($query)); 
    443450       
    444           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')) 
    445452         
    446453            $confirm_mail_need = true; 
    447454        } 
    448455         
    449         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)) 
    450457        { 
    451458          $query = ' 
     
    517524 
    518525      /* Email without forbidden domains */ 
    519       if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email'])) 
    520       { 
    521         $template->append('errors', l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'"); 
    522         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        } 
    523546      } 
    524547    } 
Note: See TracChangeset for help on using the changeset viewer.