Ignore:
Timestamp:
May 25, 2010, 6:11:02 PM (14 years ago)
Author:
Eric
Message:

[NBC_UserAdvManager]

  • Bug 1687 fixed: Case sensitivity function removed because intégrated Piwigo's core
File:
1 edited

Legend:

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

    r6255 r6354  
    8080  if (!is_admin() and !is_a_guest())
    8181  {
    82     if ((isset($conf_UAM[17]) and $conf_UAM[17] == 'true') or (isset($conf_UAM[20]) and $conf_UAM[20] == 'true'))
     82    if ((isset($conf_UAM[16]) and $conf_UAM[16] == 'true') or (isset($conf_UAM[19]) and $conf_UAM[19] == 'true'))
    8383    {
    8484
     
    129129 
    130130  /* Sending registration confirmation by email */
    131   if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[2]) and $conf_UAM[2] == 'true'))
    132   {
    133     if (is_admin() and isset($conf_UAM[21]) and $conf_UAM[21] == 'true')
     131  if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
     132  {
     133    if (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'true')
    134134    {
    135135    $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
    136136    SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
    137137    }
    138     elseif (is_admin() and isset($conf_UAM[21]) and $conf_UAM[21] == 'false')
     138    elseif (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'false')
    139139    {
    140140    $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
     
    253253
    254254  /* Password enforcement control */
    255   if (isset($conf_UAM[14]) and $conf_UAM[14] == 'true' and !empty($conf_UAM[15]))
     255  if (isset($conf_UAM[13]) and $conf_UAM[13] == 'true' and !empty($conf_UAM[14]))
    256256  {
    257257    if (!empty($user['password']) and !is_admin())
     
    259259      $PasswordCheck = testpassword($user['password']);
    260260 
    261       if ($PasswordCheck < $conf_UAM[15])
     261      if ($PasswordCheck < $conf_UAM[14])
    262262      {
    263263        $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
    264         return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[15]);
    265       }
    266     }
    267     else if (!empty($user['password']) and is_admin() and isset($conf_UAM[16]) and $conf_UAM[16] == 'true')
     264        return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]);
     265      }
     266    }
     267    else if (!empty($user['password']) and is_admin() and isset($conf_UAM[15]) and $conf_UAM[15] == 'true')
    268268    {
    269269      $PasswordCheck = testpassword($user['password']);
    270270 
    271       if ($PasswordCheck < $conf_UAM[15])
     271      if ($PasswordCheck < $conf_UAM[14])
    272272      {
    273273        $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
    274         return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[15]);
    275       }
    276     }
    277   }
    278 
    279   /* Username non case sensitive */
    280   if (isset($conf_UAM[1]) and $conf_UAM[1] == 'true' and NotSensibleSearchUsername($_POST['login']))
    281   {
    282     return($lang['reg_err_login5'] = l10n('reg_err_login5'));
     274        return($lang['reg_err_pass'] = l10n_args($message).$conf_UAM[14]);
     275      }
     276    }
    283277  }
    284278
    285279  /* Username without forbidden keys */
    286   if (isset($conf_UAM[7]) and $conf_UAM[7] == 'true' and !empty($_POST['login']) and ValidateUsername($_POST['login']) and !is_admin())
     280  if (isset($conf_UAM[6]) and $conf_UAM[6] == 'true' and !empty($_POST['login']) and ValidateUsername($_POST['login']) and !is_admin())
    287281  {
    288282    $_POST['login'] = '';
    289     return($lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_UAM[8]."'");
     283    return($lang['reg_err_login1'] = l10n('reg_err_login6')."'".$conf_UAM[7]."'");
    290284  }
    291285
    292286  /* Email without forbidden domains */
    293   if (isset($conf_UAM[12]) and $conf_UAM[12] == 'true' and !empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']) and !is_admin())
     287  if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['mail_address']) and ValidateEmailProvider($_POST['mail_address']) and !is_admin())
    294288  {
    295289    $_POST['mail_address'] = '';
    296     return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_UAM[13]."'");
     290    return($lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_UAM[12]."'");
    297291  }
    298292}
     
    312306    {
    313307      /* Email without forbidden domains */
    314       if (isset($conf_UAM[12]) and $conf_UAM[12] == 'true' and !empty($_POST['mail_address']))
     308      if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['mail_address']))
    315309      {
    316310        if (ValidateEmailProvider($_POST['mail_address']))
    317311        {
    318           $template->append('errors', l10n('reg_err_login7')."'".$conf_UAM[13]."'");
     312          $template->append('errors', l10n('reg_err_login7')."'".$conf_UAM[12]."'");
    319313          unset($_POST['validate']);
    320314        }
     
    328322       
    329323        /* Password enforcement control */
    330         if (isset($conf_UAM[14]) and $conf_UAM[14] == 'true' and !empty($conf_UAM[15]))
     324        if (isset($conf_UAM[13]) and $conf_UAM[13] == 'true' and !empty($conf_UAM[14]))
    331325        {
    332326          $PasswordCheck = testpassword($_POST['use_new_pwd']);
    333327         
    334           if ($PasswordCheck < $conf_UAM[15])
     328          if ($PasswordCheck < $conf_UAM[14])
    335329          {
    336330            $message = get_l10n_args('reg_err_login4_%s', $PasswordCheck);
    337             $template->append('errors', l10n_args($message).$conf_UAM[15]);
     331            $template->append('errors', l10n_args($message).$conf_UAM[14]);
    338332            unset($_POST['use_new_pwd']);
    339333            unset($_POST['validate']);
     
    343337     
    344338      /* Sending registration confirmation by email */
    345       if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[2]) and $conf_UAM[2] == 'true'))
     339      if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
    346340      {
    347341        $confirm_mail_need = false;
     
    357351          list($current_email) = pwg_db_fetch_row(pwg_query($query));
    358352     
    359           if ($_POST['mail_address'] != $current_email and ( isset($conf_UAM[2]) and $conf_UAM[2] == 'true'))
     353          if ($_POST['mail_address'] != $current_email and ( isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
    360354       
    361355            $confirm_mail_need = true;
     
    395389    {
    396390      /* Email without forbidden domains */
    397       if (isset($conf_UAM[12]) and $conf_UAM[12] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email']))
    398       {
    399         $template->append('errors', l10n('reg_err_login7')."'".$conf_UAM[13]."'");
     391      if (isset($conf_UAM[11]) and $conf_UAM[11] == 'true' and !empty($_POST['email']) and ValidateEmailProvider($_POST['email']))
     392      {
     393        $template->append('errors', l10n('reg_err_login7')."'".$conf_UAM[12]."'");
    400394        unset($_POST['submit_add']);
    401395      }
     
    415409
    416410/* User creation OR update */
    417   if (isset($conf_UAM[6]) and $conf_UAM[6] == 'true' and $conf['comments_forall'] == 'true' and $comm['author'] == 'guest')
     411  if (isset($conf_UAM[5]) and $conf_UAM[5] == 'true' and $conf['comments_forall'] == 'true' and $comm['author'] == 'guest')
    418412  {
    419413    $comment_action = 'reject';
Note: See TracChangeset for help on using the changeset viewer.