Ignore:
Timestamp:
Sep 17, 2009, 9:41:40 PM (15 years ago)
Author:
Eric
Message:

2.11 branch finalization :

  • Code cleaning
  • Templates improvement
  • Language files updates
  • Plugin history and version set
File:
1 edited

Legend:

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

    r3826 r3858  
    5050-- 2.10.9f : Compatibility bug fixed when used with DynamicRecentPeriod plugin
    5151
    52 -- 2.11.0 : New tabsheet menu to manage ConfirMail functions (setting a timeout without validation, Cleanup expired user's accounts, Force confirmation, Force expiration, list unvalidated users,...)
    53                         Beautify plugin's main admin panel
     52-- 2.11.0 : New tabsheet menu to manage ConfirMail functions (setting a timeout without validation, Cleanup expired user's accounts, Force confirmation, Renew validation key, list unvalidated users,...)
     53                                                Beautify plugin's main admin panel
    5454
    5555*/
     
    6262
    6363++ No single email check for admins (new trigger needed in (functions_user.inc.php ?))
    64 
    65 ++ Administration page for Confirm Mail
    66   ++ Admin tabsheet for Confirm Mail to set options :
    67                 ++ Setting a delay time with timeout for email confirmation (Timeout = CurrentDate - RegistrationDate)
    68                 -- List of users who haven't validated - could be easy to set with groups options : Unvalidated users are in a "Unvalidated" group.
    69                 ++ List of users with expired validation time
    70                 -- List of validates users ? -> Same as "List of users who haven't validated" : They could belong to a "validated" group.
    71                 ++ Opportunities to take actions on database tables :
    72                 ++ Re-asking validation (case of non reception of validation email)
    73                 ++ Force expiration
    74                         ++ Force confirmation
    75                 ++ Cleanup expired user's accounts
    76         ++ (...)
    7764
    7865++ Password control and enforcement
     
    9380
    9481
    95 
    9682if (!defined('PHPWG_ROOT_PATH')) die('Hacking attempt!');
     83
    9784define('NBC_UserAdvManager_DIR' , basename(dirname(__FILE__)));
    9885define('NBC_UserAdvManager_PATH' , PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/');
     86
    9987include_once (NBC_UserAdvManager_PATH.'include/constants.php');
    10088include_once (NBC_UserAdvManager_PATH.'include/functions_UserAdvManager.inc.php');
     89
    10190load_language('plugin.lang', NBC_UserAdvManager_PATH);
    10291
     
    129118
    130119  if (( isset($conf_nbc_UserAdvManager[0]) and $conf_nbc_UserAdvManager[0] == 'true') or ( isset($conf_nbc_UserAdvManager[2]) and $conf_nbc_UserAdvManager[2] == 'true'))
    131     SendMail2User(1, $register_user['id'], $register_user['username'], $_POST['password'], $register_user['email'], true);
     120       
     121        SendMail2User(1, $register_user['id'], $register_user['username'], $_POST['password'], $register_user['email'], true);
    132122}
    133123
     
    205195          //}
    206196      /* This work with a code copy of ValidateEmailProvider() function */
    207           if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']))
    208                 {
    209                   $ncsemail = strtolower($_POST['email']);
    210                   $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
    211                   for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
     197                        if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['email']))
     198                        {
     199                        $ncsemail = strtolower($_POST['email']);
     200                        $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
     201                        for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
    212202                    {
    213203                  $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
    214                           if (preg_match($pattern, $ncsemail))
    215                             {
    216                           $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
    217                           $_POST['login'] = '';
     204                                if (preg_match($pattern, $ncsemail))
     205                        {
     206                        $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
     207                        $_POST['login'] = '';
     208                                        }
    218209                                }
    219210                        }
    220                 }
    221211    }
    222212  }
     
    251241      //}
    252242      /* This work with a code copy of ValidateEmailProvider() function */
    253                 if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
     243                        if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
    254244                  {
    255245                        $ncsemail = strtolower($_POST['mail_address']);
    256246                    $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
    257                         for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
     247                                for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
    258248                          {
    259                         $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
     249                                $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
    260250                                if (preg_match($pattern, $ncsemail))
    261251                                  {
    262                                     $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
    263                                         $_POST['login'] = '';
     252                                        $lang['reg_err_login1'] = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
     253                                                $_POST['login'] = '';
    264254                                  }
    265255                          }
     
    312302            $errors[] = $mail_error;
    313303          }
    314         /* This don't work on user's profile page - Why ?? */
    315                 if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
    316                   {
    317                         $ncsemail = strtolower($_POST['mail_address']);
    318                     $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
    319                         for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
    320                           {
    321                         $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
    322                                 if (preg_match($pattern, $ncsemail))
    323                                   {
    324                                     $mail_error = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
    325                                   }
    326                           }
    327                   }
    328               if (!empty($mail_error))
     304         
     305                                        if (isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' and !empty($_POST['mail_address']))
     306                                {
     307                                        $ncsemail = strtolower($_POST['mail_address']);
     308                                $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
     309                                                for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
     310                                        {
     311                                                $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
     312                                                if (preg_match($pattern, $ncsemail))
     313                                                {
     314                                                $mail_error = l10n('reg_err_login7')."'".$conf_nbc_UserAdvManager[13]."'";
     315                                                }
     316                                        }
     317                                }
     318                if (!empty($mail_error))
    329319          {
    330320            $errors[] = $mail_error;
    331321          }
    332322        }
    333                 /* This don't work on call of ValidateEmailProvider() function - Why ?? -> Due to the "return = false|true" in function ?*/
    334         //if (isset($_POST['mail_address']))
    335         //{
    336         //  $mail_error = ValidateEmailProvider($_POST['mail_address']);
    337         //  if (!empty($mail_error))
    338         //  {
    339         //    $errors[] = $mail_error;
    340         //  }
    341         //}
    342323
    343324        $typemail = 3;
Note: See TracChangeset for help on using the changeset viewer.