Changeset 4340


Ignore:
Timestamp:
Nov 22, 2009, 5:11:24 PM (15 years ago)
Author:
Eric
Message:

[NBC_UserAdvManager]

  • Bug 1259 fixed - PHP notice on user addition by admin in user_list page
  • Bug 1257 fixed - If email exclusion list begins with a CR-LF, an informative warning message is displayed (I was unable to delete automatically this CR-LF).
Location:
extensions/NBC_UserAdvManager/trunk
Files:
9 edited

Legend:

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

    r4316 r4340  
    5353$UserAdvManager_ConfirmMail_Error_Txt1 = false;
    5454$UserAdvManager_ConfirmMail_Error_Txt2 = false;
     55$UserAdvManager_Exclusionlist_Error = false;
    5556
    5657// +-----------------------------------------------------------------------+
     
    9899     
    99100      array_push($page['errors'], l10n('mail_text_error'));
     101    }
     102
     103    /* Check if CR-LF exist at begining and end of mail exclusion list - If yes, removes them */
     104    if (preg_match('/^[\s]+/', $_POST['UserAdvManager_MailExclusion_List']))
     105    {
     106      array_push($page['errors'], l10n('mail_exclusionlist_error'));
     107      $UserAdvManager_Exclusionlist_Error = true;
    100108    }
    101109               
     
    251259    'UserAdvManager_ERROR_REPORTS2'           => $UserAdvManager_ConfirmMail_Error_Txt,
    252260    'UserAdvManager_ERROR_REPORTS3'           => $UserAdvManager_Reminder_Error_Txt,
     261    'UserAdvManager_ERROR_REPORTS4'           => $UserAdvManager_Exclusionlist_Error,
    253262    )
    254263  );
     
    314323                  while($row = mysql_fetch_assoc($result))
    315324                  {
    316                                 $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
    317                           $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
     325                          $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
    318326                          for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
    319327                          {
  • extensions/NBC_UserAdvManager/trunk/admin/global.tpl

    r4316 r4340  
    4545        </li>
    4646
    47 {if $UserAdvManager_MAILEXCLUSION_TRUE}     
     47{if $UserAdvManager_MAILEXCLUSION_TRUE}
     48  {if $UserAdvManager_ERROR_REPORTS4}     
     49        <li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br>
     50        <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" style="color: red" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea><br><br>
     51        </li>
     52  {else}
    4853        <li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br>
    4954        <textarea name="UserAdvManager_MailExclusion_List" id="UserAdvManager_MailExclusion_List" rows="3" cols="80" {$TAG_INPUT_ENABLED}>{$UserAdvManager_MAILEXCLUSION_LIST}</textarea><br><br>
    5055        </li>
     56  {/if}
    5157{else}
    5258        <li><label>{'UserAdvManager_MailExclusion_List'|@translate}</label><br>
  • extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php

    r4316 r4340  
    609609  if (isset($username))
    610610  {
     611    $usercase = strtolower($username);
    611612    $query = "
    612613SELECT ".$conf['user_fields']['username']."
    613614  FROM ".USERS_TABLE."
    614 WHERE LOWER(".$conf['user_fields']['username'].") = '".strtolower($username)."'
    615 ;";
    616     list($username) = mysql_fetch_row(pwg_query($query));
    617 
    618     return isset($username) ? stripslashes($username) : '';
     615WHERE LOWER(".stripcslashes($conf['user_fields']['username']).") = '".$usercase."'
     616;";
     617    list($usercase) = mysql_fetch_row(pwg_query($query));
     618
     619    return isset($username) ? stripslashes($usercase) : '';
    619620  }
    620621}
     
    653654        {
    654655                $ncsemail = strtolower($email);
    655                 $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
     656                $conf_nbc_MailExclusion = preg_split("/[\s,]+/",$conf_nbc_UserAdvManager[13]);
    656657                for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
    657658                {
  • extensions/NBC_UserAdvManager/trunk/language/de_DE/plugin.lang.php

    r4316 r4340  
    175175/* 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.';
    176176// --------- End: New or revised $lang ---- from version 2.12.7
     177// --------- Starting below: New or revised $lang ---- from version 2.12.8
     178/* TODO */$lang['mail_exclusionlist_error'] = 'Warning! You have entered a new line (CR-LF) at the begining of email exclusion list (shown in red below). Although this new line is not visible, it is still present and may cause malfunction of the plugin. Please re-type in your exclusion list in a manner that does not begin with a newline.';
     179// --------- End: New or revised $lang ---- from version 2.12.8
    177180
    178181
  • extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php

    r4316 r4340  
    176176$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.';
    177177// --------- End: New or revised $lang ---- from version 2.12.7
     178// --------- Starting below: New or revised $lang ---- from version 2.12.8
     179$lang['mail_exclusionlist_error'] = 'Warning! You have entered a new line (CR-LF) at the begining of email exclusion list (shown in red below). Although this new line is not visible, it is still present and may cause malfunction of the plugin. Please re-type in your exclusion list in a manner that does not begin with a newline.';
     180// --------- End: New or revised $lang ---- from version 2.12.8
    178181
    179182
  • extensions/NBC_UserAdvManager/trunk/language/es_ES/plugin.lang.php

    r4316 r4340  
    176176/* 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.';
    177177// --------- End: New or revised $lang ---- from version 2.12.7
     178// --------- Starting below: New or revised $lang ---- from version 2.12.8
     179/* TODO */$lang['mail_exclusionlist_error'] = 'Warning! You have entered a new line (CR-LF) at the begining of email exclusion list (shown in red below). Although this new line is not visible, it is still present and may cause malfunction of the plugin. Please re-type in your exclusion list in a manner that does not begin with a newline.';
     180// --------- End: New or revised $lang ---- from version 2.12.8
    178181
    179182
  • extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php

    r4316 r4340  
    175175$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.';
    176176// --------- End: New or revised $lang ---- from version 2.12.7
     177// --------- Starting below: New or revised $lang ---- from version 2.12.8
     178$lang['mail_exclusionlist_error'] = 'Attention ! Vous avez saisi un retour à la ligne en début de liste d\'exclusion des domaines de messagerie (affichée en rouge ci-dessous). Bien que ce retour à la ligne ne soit pas visible, il est tout de même présent et est susceptible de provoquer des dysfonctionnements du plugin. Veuillez resaisir votre liste d\'exclusion en veillant à ne pas commencer par un retour à la ligne.';
     179// --------- End: New or revised $lang ---- from version 2.12.8
    177180
    178181
  • extensions/NBC_UserAdvManager/trunk/language/it_IT/plugin.lang.php

    r4316 r4340  
    176176/* 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.';
    177177// --------- End: New or revised $lang ---- from version 2.12.7
     178// --------- Starting below: New or revised $lang ---- from version 2.12.8
     179/* TODO */$lang['mail_exclusionlist_error'] = 'Warning! You have entered a new line (CR-LF) at the begining of email exclusion list (shown in red below). Although this new line is not visible, it is still present and may cause malfunction of the plugin. Please re-type in your exclusion list in a manner that does not begin with a newline.';
     180// --------- End: New or revised $lang ---- from version 2.12.8
    178181
    179182
  • extensions/NBC_UserAdvManager/trunk/main.inc.php

    r4316 r4340  
    22/*
    33Plugin Name: NBC UserAdvManager
    4 Version: 2.12.7
     4Version: 2.12.8
    55Description: Renforcer les possibilités de gestion des utilisateurs - Enforce users management
    66Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
     
    7777
    7878-- 2.12.0 : Bug 1206 fixed : All plugin functionnalities work in user's profile page
    79                 Plugin's core code and admin panel refactoring
    80                 Password control and enforcement : A complexity score is computed on user registration. If this score is less than the goal set by admin, the password choosen is rejected.
    81                 Feature 1194 "Ghost Tracker" added : New plugin tab displays users who don't comes back to the gallery since x days. Ability to send email reminders and to delete reminded but "dead" users. It's the reason why this feature is called "Ghost Tracker".
     79            Plugin's core code and admin panel refactoring
     80            Password control and enforcement : A complexity score is computed on user registration. If this score is less than the goal set by admin, the password choosen is rejected.
     81            Feature 1194 "Ghost Tracker" added : New plugin tab displays users who don't comes back to the gallery since x days. Ability to send email reminders and to delete reminded but "dead" users. It's the reason why this feature is called "Ghost Tracker".
    8282
    8383-- 2.12.1 : Rollback on admin panel improvement (it was a bad idea)
     
    105105            Bug 1250 fixed - Email provider didn't work after the third exclusion in list
    106106            Escaping all special characters typed in login name and recover them
     107
     108-- 2.12.8 : Bug 1259 fixed - PHP notice on user addition by admin in user_list page
     109            Bug 1257 fixed - If email exclusion list begins with a CR-LF, an informative warning message is displayed (I was unable to delete automatically this CR-LF).
     110            Bug 1260
    107111*/
    108112
     
    270274  {
    271275    return l10n('reg_err_login5');
    272   }
    273 
    274   if (script_basename() == 'admin' and isset($_GET['page']) and $_GET['page'] == 'user_list') /* not the same email variable if we are on users registration page or on admin's user registration page*/
    275   {
    276     /* ***************************** */
    277     /* Standard Piwigo's email check */
    278     /* ***************************** */
    279     $atom   = '[-a-z0-9!#$%&\'*+\\/=?^_`{|}~]';   // before  arobase
    280     $domain = '([a-z0-9]([-a-z0-9]*[a-z0-9]+)?)'; // domain name
    281     $regex = '/^' . $atom . '+' . '(\.' . $atom . '+)*' . '@' . '(' . $domain . '{1,63}\.)+' . $domain . '{2,63}$/i';
    282  
    283     if (!preg_match($regex, $_POST['email']))
    284     {
    285       return l10n('reg_err_mail_address');
    286     }
    287    
    288     if (!empty($_POST['email']))
    289     {
    290       $query = '
    291 select count(*)
    292 from '.USERS_TABLE.'
    293 where upper('.$conf['user_fields']['email'].') = upper(\''.$_POST['email'].'\');';
    294       list($count) = mysql_fetch_assoc(pwg_query($query));
    295       if ($count != 0)
    296       {
    297         return l10n('reg_err_mail_address_dbl');
    298       }
    299     }
    300276  }
    301277/* ****************************************** */
Note: See TracChangeset for help on using the changeset viewer.