Ignore:
Timestamp:
Jun 1, 2009, 10:40:57 PM (15 years ago)
Author:
Eric
Message:

V2.10.9 :
Bug fixed - Missing english translation
Bug fixed - Notice on forbidden characters function use
Bug fixed - Audit on forbidden characters in username didn't work
Adding of email provider exclusion (like *@hotmail.com) - Warning ! -> Known bug : This feature doesn't work on user profile page. So, already registered users can change their email address to a forbidden one. If someone has a solution...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/main.inc.php

    r3352 r3385  
    22/*
    33Plugin Name: NBC UserAdvManager
    4 Version: 2.10.8
     4Version: 2.10.9
    55Description: Permet de renforcer les possibilités de gestion des utilisateurs - Enforce users management
    66Plugin URI: http://fr.piwigo.org/ext/extension_view.php?eid=216
     
    2929-- 2.10.8 : ConfirmMail page looks better (Sylvia theme only)
    3030                        Improved code for checking author on guest comments
     31
     32-- 2.10.9 : Bug fixed - Missing english translation
     33                        Bug fixed - Notice on forbidden characters function use
     34                        Bug fixed - Audit on forbidden characters in username didn't work
     35                        Adding of email provider exclusion (like *@hotmail.com) - Warning ! -> Known bug : This feature doesn't work on user profile page. So, already registered users can change their email address to a forbiden one.
    3136
    3237*/
     
    5358        ++ (...)
    5459
    55 -- Password control ans enforcement
     60-- Password control and enforcement
    5661  -- Empty password (done in Piwigo 2.x)
    5762  ++ Can not be the same as username
     
    127132function UserAdvManager_InitPage()
    128133{
     134  load_language('plugin.lang', NBC_UserAdvManager_PATH);
    129135  global $conf, $template, $page, $lang;
    130136
     
    172178        $_POST['login'] = '';
    173179      }
     180
     181      /* Email without forbidden domains */
     182      /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
     183      //if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']) and !ValidateEmailProvider($_POST['email']))
     184      //{
     185      //  $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
     186          //  $_POST['login'] = '';
     187          //}
     188      /* This work with a code copy of ValidateEmailProvider() function */
     189          if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']))
     190                {
     191                  $conf_nbc_MailExclusion = split (",",$conf_nbc_UserAdvManager[13]);
     192                  for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
     193                    {
     194                          if (ereg($conf_nbc_MailExclusion[$i], $_POST['email']))
     195                            {
     196                          $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
     197                          $_POST['login'] = '';
     198                                }
     199                        }
     200                }
    174201    }
    175202  }
     
    194221        $_POST['login'] = '';
    195222      }
     223
     224
     225      /* Email without forbidden domains */
     226      /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
     227      //if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']) and !ValidateEmailProvider($_POST['mail_address']))
     228      //{
     229      //  $lang['reg_err_mail_address'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
     230      //  $_POST['mail_address'] = '';
     231      //}
     232      /* This work with a code copy of ValidateEmailProvider() function */
     233                if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
     234                  {
     235                    $conf_nbc_MailExclusion = split (",",$conf_nbc_UserAdvManager[13]);
     236                        for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
     237                          {
     238                            if (ereg($conf_nbc_MailExclusion[$i], $_POST['mail_address']))
     239                                  {
     240                                    $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
     241                                        $_POST['login'] = '';
     242                                  }
     243                          }
     244                  }
    196245    }
    197246  }
     
    247296            $errors[] = $mail_error;
    248297          }
    249         }
     298        /* This don't work on user's profile page - Why ?? */
     299                if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
     300                  {
     301                    $conf_nbc_MailExclusion = split (",",$conf_nbc_UserAdvManager[13]);
     302                        for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
     303                          {
     304                            if (ereg($conf_nbc_MailExclusion[$i], $_POST['mail_address']))
     305                                  {
     306                                    $mail_error = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
     307                                  }
     308                          }
     309                  }
     310              if (!empty($mail_error))
     311          {
     312            $errors[] = $mail_error;
     313          }
     314        }
     315                /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
     316        //if (isset($_POST['mail_address']))
     317        //{
     318        //  $mail_error = ValidateEmailProvider($_POST['mail_address']);
     319        //  if (!empty($mail_error))
     320        //  {
     321        //    $errors[] = $mail_error;
     322        //  }
     323        //}
    250324
    251325        $typemail = 3;
Note: See TracChangeset for help on using the changeset viewer.