Changeset 3858 for extensions


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
Location:
extensions/NBC_UserAdvManager/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • extensions/NBC_UserAdvManager/trunk/ConfirmMail.php

    r3742 r3858  
    1212load_language('plugin.lang', NBC_UserAdvManager_PATH);
    1313
    14 if ( isset($_GET['key']) )
     14if (isset($_GET['key']))
    1515{
    1616
    17   if ( VerifyConfirmMail($_GET['key']) )
    18     $template->assign(array(
    19       'CONFIRM_MAIL_MESSAGE' => l10n('confirm_mail_ok'),
    20     ));
     17  if (VerifyConfirmMail($_GET['key']))
     18    $template->assign(
     19                        array(
     20                                'CONFIRM_MAIL_MESSAGE' => l10n('confirm_mail_ok'),
     21                        )
     22                );
    2123  else 
    22     $template->assign(array(
    23       'CONFIRM_MAIL_MESSAGE' => l10n('confirm_mail_bad'),
    24     ));
    25      
    26    
     24    $template->assign(
     25                        array(
     26                                'CONFIRM_MAIL_MESSAGE' => l10n('confirm_mail_bad'),
     27                        )
     28                );       
    2729//    redirect(make_index_url());
    2830}
     
    4951$template->set_filenames(
    5052  array(
    51     'confirm_mail'=>NBC_UserAdvManager_PATH.'ConfirmMail.tpl',
    52     )
    53   );
     53        'confirm_mail'=>NBC_UserAdvManager_PATH.'ConfirmMail.tpl',
     54        )
     55);
    5456if ( isset($lang['Theme: '.$user['theme']]) )
    5557{
    5658  $template->assign(
    57     'THEME_ABOUT',l10n('Theme: '.$user['theme'])
    58     );
     59        'THEME_ABOUT',l10n('Theme: '.$user['theme'])
     60  );
    5961}
    6062
     
    6264        {
    6365        $template->assign(
    64                 array(
    65                 'GALLERY_URL' =>
    66                          isset($page['gallery_url']) ?
    67                               $page['gallery_url'] : $conf['gallery_url'],
    68                  )
    69          );
     66                array(
     67        'GALLERY_URL' =>
     68                isset($page['gallery_url']) ?
     69                        $page['gallery_url'] : $conf['gallery_url'],
     70                )
     71        );
    7072}
    7173
  • extensions/NBC_UserAdvManager/trunk/admin/UserAdvManager_admin.php

    r3845 r3858  
    4848switch ($page['tab'])
    4949{
     50// *************************************************************************
    5051// +-----------------------------------------------------------------------+
    5152// |                           Global Config                               |
    5253// +-----------------------------------------------------------------------+
     54// *************************************************************************
    5355  case 'global':
    5456       
     
    135137            $No_Valid_Status = $status;
    136138          }
     139         
    137140/* Template initialization for unvalidated users group */
    138141      $template->assign(
     
    144147                        );
    145148  }
     149 
    146150/* Get status values */
    147151  foreach (get_enums(USER_INFOS_TABLE, 'status') as $status)
     
    152156                  $Valid_Status = $status;
    153157                }
     158               
    154159/* Template initialization for unvalidated users group */
    155160      $template->assign(
     
    189194
    190195  if ( isset($_POST['audit']) or isset($_POST['submit']) )
    191   {
     196        {
    192197                $msg_error1 = '';
    193198               
     
    217222               
    218223/* Username without forbidden keys */
    219       if ( isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' )
    220             {
    221                         $query = "
    222                         SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."
    223                                         FROM ".USERS_TABLE."
    224                                 ;";
     224    if ( isset($conf_nbc_UserAdvManager[7]) and $conf_nbc_UserAdvManager[7] == 'true' )
     225          {
     226                        $query = "
     227                        SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."
     228                                FROM ".USERS_TABLE."
     229                        ;";
    225230                         
    226                           $result = pwg_query($query);
     231                        $result = pwg_query($query);
    227232                       
    228                           while($row = mysql_fetch_array($result))
     233                        while($row = mysql_fetch_array($result))
     234                        {
     235                                if (!ValidateUsername($row['username']))
     236                                        $msg_error2 .= (($msg_error2 <> '') ? '<br/>' : '') . l10n('Err_audit_username_char').$row['username'];
     237                        }
     238                }
     239
     240                $msg_error3 = '';
     241               
     242/* Email without forbidden domain */
     243    if ( isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' )
     244          {
     245                        $query = "
     246                        SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."
     247                                FROM ".USERS_TABLE."
     248                        ;";
     249                         
     250                  $result = pwg_query($query);
     251                       
     252                  while($row = mysql_fetch_array($result))
     253                  {
     254                                $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
     255                          $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
     256                          for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
    229257                          {
    230                                         if (!ValidateUsername($row['username']))
    231                                     $msg_error2 .= (($msg_error2 <> '') ? '<br/>' : '') . l10n('Err_audit_username_char').$row['username'];
    232                                 }
    233                         }
    234 
    235                 $msg_error3 = '';
    236                
    237 /* Email without forbidden domain */
    238       if ( isset($conf_nbc_UserAdvManager[12]) and $conf_nbc_UserAdvManager[12] == 'true' )
    239             {
    240                         $query = "
    241                         SELECT ".$conf['user_fields']['username'].", ".$conf['user_fields']['email']."
    242                                         FROM ".USERS_TABLE."
    243                                 ;";
    244                          
    245                         $result = pwg_query($query);
    246                        
    247                         while($row = mysql_fetch_array($result))
    248                     {
    249                                 $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
    250                                 $conf_nbc_MailExclusion = preg_split('/,/',$conf_nbc_UserAdvManager[13]);
    251                                 for ($i = 0 ; $i < count($conf_nbc_MailExclusion) ; $i++)
    252                             {
    253                                                 $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
    254                                         if (preg_match($pattern, $row['mail_address']))
    255                                     {
    256                                                 $msg_error3 .=  (($msg_error3 <> '') ? '<br/>' : '') . l10n('Err_audit_email_forbidden').$row['username'].' ('.$row['mail_address'].')';
    257                                                 }
     258                                        $pattern = '/'.$conf_nbc_MailExclusion[$i].'/';
     259                                  if (preg_match($pattern, $row['mail_address']))
     260                                  {
     261                                                $msg_error3 .=  (($msg_error3 <> '') ? '<br/>' : '') . l10n('Err_audit_email_forbidden').$row['username'].' ('.$row['mail_address'].')';
    258262                                        }
    259263                                }
    260264                        }
    261                
    262       if ($msg_error1 <> '')
    263                     $errors[] = $msg_error1.'<br/><br/>';
    264                
    265       if ($msg_error2 <> '')
    266                     $errors[] = $msg_error2.'<br/><br/>';
    267                
    268                 if ($msg_error3 <> '')
    269                 $errors[] = $msg_error3.'<br/><br/>';
    270                
    271                 if ($msg_error1 <> '' or $msg_error2 <> '' or $msg_error3 <> '')
    272                 array_push($page['errors'], l10n('Err_audit_advise'));
    273                 else
    274         array_push($page['infos'], l10n('UserAdvManager_audit_ok'));
     265                }
     266               
     267    if ($msg_error1 <> '')
     268                        $errors[] = $msg_error1.'<br/><br/>';
     269               
     270                if ($msg_error2 <> '')
     271                        $errors[] = $msg_error2.'<br/><br/>';
     272               
     273                if ($msg_error3 <> '')
     274                $errors[] = $msg_error3.'<br/><br/>';
     275               
     276                if ($msg_error1 <> '' or $msg_error2 <> '' or $msg_error3 <> '')
     277                array_push($page['errors'], l10n('Err_audit_advise'));
     278                else
     279        array_push($page['infos'], l10n('UserAdvManager_audit_ok'));
    275280        }
    276281
     
    296301  break;
    297302
     303// *************************************************************************
    298304// +-----------------------------------------------------------------------+
    299305// |                           ConfirmMail Config                          |
    300306// +-----------------------------------------------------------------------+
     307// *************************************************************************
    301308  case 'confirmmail':
    302309       
     
    345352// |                             errors display                            |
    346353// +-----------------------------------------------------------------------+
    347         if ( isset ($errors) and count($errors) != 0)
    348         {
    349           $template->assign('errors',array());
    350                 foreach ($errors as $error)
    351           {
    352                         array_push($page['errors'], $error);
    353           }
    354        
     354                if ( isset ($errors) and count($errors) != 0)
     355                {
     356                $template->assign('errors',array());
     357                        foreach ($errors as $error)
     358                {
     359                                array_push($page['errors'], $error);
     360                }
     361               
    355362
    356363// +-----------------------------------------------------------------------+
     
    367374
    368375
     376// *************************************************************************
    369377// +-----------------------------------------------------------------------+
    370378// |                           Users manager page                          |
    371379// +-----------------------------------------------------------------------+
     380// *************************************************************************
    372381  case 'usermanager':
     382 
    373383  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
    374384  $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
     
    380390// +-----------------------------------------------------------------------+
    381391
    382         if (!defined('PHPWG_ROOT_PATH'))
     392                if (!defined('PHPWG_ROOT_PATH'))
    383393    {
    384394        die('Hacking attempt!');
     
    390400// | Check Access and exit when user status is not ok                      |
    391401// +-----------------------------------------------------------------------+
    392         check_status(ACCESS_ADMINISTRATOR);
     402                check_status(ACCESS_ADMINISTRATOR);
    393403
    394404    $page['order_by_items'] = array(
     
    403413// +-----------------------------------------------------------------------+
    404414
    405         $page['filtered_users'] = get_unvalid_user_list();
     415                $page['filtered_users'] = get_unvalid_user_list();
    406416
    407417// +-----------------------------------------------------------------------+
    408418// |                            selected users                             |
    409419// +-----------------------------------------------------------------------+
    410         if (isset($_POST['Del_Selected']))
    411         {
    412         $collection = array();
    413 
    414                 switch ($_POST['target'])
    415     {
    416         case 'all' :
    417       {
    418         foreach($page['filtered_users'] as $local_user)
    419         {
    420                 array_push($collection, $local_user['id']);
    421         }
    422         break;
    423                         }
    424       case 'selection' :
    425       {
    426         if (isset($_POST['selection']))
    427         {
    428                 $collection = $_POST['selection'];
    429         }
    430         break;
    431       }
    432                 }
    433 
    434     if (count($collection) == 0)
    435     {
    436         array_push($page['errors'], l10n('Select at least one user'));
    437     }
    438         }
     420                if (isset($_POST['Del_Selected']))
     421                {
     422                $collection = array();
     423
     424                        switch ($_POST['target'])
     425        {
     426                case 'all' :
     427        {
     428                foreach($page['filtered_users'] as $local_user)
     429                {
     430                        array_push($collection, $local_user['id']);
     431                }
     432                                        break;
     433                                }
     434        case 'selection' :
     435        {
     436                if (isset($_POST['selection']))
     437                {
     438                        $collection = $_POST['selection'];
     439                }
     440                break;
     441        }
     442                        }
     443
     444                        if (count($collection) == 0)
     445        {
     446                array_push($page['errors'], l10n('Select at least one user'));
     447                }
     448                }
    439449
    440450// +-----------------------------------------------------------------------+
    441451// |                             delete users                              |
    442452// +-----------------------------------------------------------------------+
    443         if (isset($_POST['Del_Selected']) and count($collection) > 0)
    444   {
    445         if (in_array($conf['guest_id'], $collection))
    446         {
    447         array_push($page['errors'], l10n('Guest cannot be deleted'));
    448     }
    449     if (($conf['guest_id'] != $conf['default_user_id']) and
    450         in_array($conf['default_user_id'], $collection))
    451     {
    452         array_push($page['errors'], l10n('Default user cannot be deleted'));
    453     }
    454     if (in_array($conf['webmaster_id'], $collection))
    455     {
    456         array_push($page['errors'], l10n('Webmaster cannot be deleted'));
    457     }
    458     if (in_array($user['id'], $collection))
    459     {
    460         array_push($page['errors'], l10n('You cannot delete your account'));
    461     }
    462 
    463     if (count($page['errors']) == 0)
    464     {
    465         foreach ($collection as $user_id)
    466       {
    467         delete_user($user_id);
    468       }
    469         array_push(
    470         $page['infos'],
    471         l10n_dec(
    472         '%d user deleted', '%d users deleted',
    473         count($collection)
    474         )
    475       );
    476 
    477       foreach ($page['filtered_users'] as $filter_key => $filter_user)
    478       {
    479         if (in_array($filter_user['id'], $collection))
    480         {
    481                 unset($page['filtered_users'][$filter_key]);
    482         }
    483       }
    484                 }
    485         }
    486 
     453                if (isset($_POST['Del_Selected']) and count($collection) > 0)
     454        {
     455                if (in_array($conf['guest_id'], $collection))
     456                {
     457                array_push($page['errors'], l10n('Guest cannot be deleted'));
     458        }
     459        if (($conf['guest_id'] != $conf['default_user_id']) and
     460                in_array($conf['default_user_id'], $collection))
     461        {
     462                array_push($page['errors'], l10n('Default user cannot be deleted'));
     463        }
     464        if (in_array($conf['webmaster_id'], $collection))
     465        {
     466                array_push($page['errors'], l10n('Webmaster cannot be deleted'));
     467        }
     468        if (in_array($user['id'], $collection))
     469        {
     470                array_push($page['errors'], l10n('You cannot delete your account'));
     471        }
     472
     473                        if (count($page['errors']) == 0)
     474        {
     475                foreach ($collection as $user_id)
     476        {
     477                delete_user($user_id);
     478        }
     479                array_push(
     480                $page['infos'],
     481                l10n_dec(
     482                '%d user deleted', '%d users deleted',
     483                count($collection)
     484                )
     485        );
     486
     487        foreach ($page['filtered_users'] as $filter_key => $filter_user)
     488        {
     489                if (in_array($filter_user['id'], $collection))
     490                {
     491                        unset($page['filtered_users'][$filter_key]);
     492                }
     493                }
     494                        }
     495                }
     496
     497// +-----------------------------------------------------------------------+
     498// |                 Resend new validation key to users                    |
     499// +-----------------------------------------------------------------------+
    487500// +-----------------------------------------------------------------------+
    488501// |                            selected users                             |
    489502// +-----------------------------------------------------------------------+
    490         if (isset($_POST['Mail_With_Key']))
    491         {
    492         $collection = array();
    493 
    494                 switch ($_POST['target'])
    495     {
    496         case 'all' :
    497       {
    498         foreach($page['filtered_users'] as $local_user)
    499         {
    500                 array_push($collection, $local_user['id']);
    501         }
    502         break;
    503                         }
    504       case 'selection' :
    505       {
    506         if (isset($_POST['selection']))
    507         {
    508                 $collection = $_POST['selection'];
    509         }
    510         break;
    511       }
    512                 }
    513 
    514     if (count($collection) == 0)
    515     {
    516         array_push($page['errors'], l10n('Select at least one user'));
    517     }
    518         }
     503                if (isset($_POST['Mail_With_Key']))
     504                {
     505                $collection = array();
     506
     507                        switch ($_POST['target'])
     508        {
     509                case 'all' :
     510        {
     511                foreach($page['filtered_users'] as $local_user)
     512                {
     513                        array_push($collection, $local_user['id']);
     514                }
     515                break;
     516                                }
     517        case 'selection' :
     518        {
     519                if (isset($_POST['selection']))
     520                {
     521                        $collection = $_POST['selection'];
     522                }
     523                break;
     524        }
     525                        }
     526
     527        if (count($collection) == 0)
     528        {
     529                array_push($page['errors'], l10n('Select at least one user'));
     530        }
     531                }
    519532// +-----------------------------------------------------------------------+
    520533// |                 Resend new validation key to users                    |
    521534// +-----------------------------------------------------------------------+
    522         if (isset($_POST['Mail_With_Key']) and count($collection) > 0)
    523         {
    524                 if (in_array($conf['guest_id'], $collection))
    525         {
    526         array_push($page['errors'], l10n('No_validation_for_Guest'));
    527     }
    528     if (($conf['guest_id'] != $conf['default_user_id']) and
    529         in_array($conf['default_user_id'], $collection))
    530     {
    531         array_push($page['errors'], l10n('No_validation_for_default_user'));
    532     }
    533         if (in_array($conf['webmaster_id'], $collection))
    534     {
    535         array_push($page['errors'], l10n('No_validation_for_Webmaster'));
    536     }
    537     if (in_array($user['id'], $collection))
    538     {
    539         array_push($page['errors'], l10n('No_validation_for_your_account'));
    540     }
    541 
    542     if (count($page['errors']) == 0)
    543     {
    544         foreach ($collection as $user_id)
    545       {         
    546         $typemail = 1;
    547                                     $query = "
    548                                                         SELECT id, username, mail_address
    549                                                         FROM ".USERS_TABLE."
    550                                                         WHERE id = '".$user_id."'
     535                if (isset($_POST['Mail_With_Key']) and count($collection) > 0)
     536                {
     537                        if (in_array($conf['guest_id'], $collection))
     538                {
     539                array_push($page['errors'], l10n('No_validation_for_Guest'));
     540        }
     541        if (($conf['guest_id'] != $conf['default_user_id']) and
     542                in_array($conf['default_user_id'], $collection))
     543        {
     544                array_push($page['errors'], l10n('No_validation_for_default_user'));
     545        }
     546                if (in_array($conf['webmaster_id'], $collection))
     547        {
     548                array_push($page['errors'], l10n('No_validation_for_Webmaster'));
     549        }
     550        if (in_array($user['id'], $collection))
     551        {
     552                array_push($page['errors'], l10n('No_validation_for_your_account'));
     553        }
     554
     555        if (count($page['errors']) == 0)
     556        {
     557                foreach ($collection as $user_id)
     558        {       
     559                $typemail = 1;
     560                                  $query = "
     561                                                SELECT id, username, mail_address
     562                                                FROM ".USERS_TABLE."
     563                                                WHERE id = '".$user_id."'
    551564                                                ;";
    552                                 $data = mysql_fetch_array(pwg_query($query));
     565                                        $data = mysql_fetch_array(pwg_query($query));
    553566                               
    554         ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],true);
    555       }
    556       array_push(
    557         $page['infos'],
    558         l10n_dec(
    559         '%d_Mail_With_Key', '%d_Mails_With_Key',
    560         count($collection)
    561         )
    562       );
    563 
    564       foreach ($page['filtered_users'] as $filter_key => $filter_user)
    565       {
    566         if (in_array($filter_user['id'], $collection))
    567         {
    568                 unset($page['filtered_users'][$filter_key]);
    569         }
    570                         }
    571                 }
    572         }
    573 
     567                ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],true);
     568        }
     569        array_push(
     570                $page['infos'],
     571                l10n_dec(
     572                        '%d_Mail_With_Key', '%d_Mails_With_Key',
     573                count($collection)
     574                )
     575        );
     576       
     577                                $page['filtered_users'] = get_unvalid_user_list();
     578                        }
     579                }
     580
     581// +-----------------------------------------------------------------------+
     582// |             Send reminder without new key to users                    |
     583// +-----------------------------------------------------------------------+
    574584// +-----------------------------------------------------------------------+
    575585// |                            selected users                             |
    576586// +-----------------------------------------------------------------------+
    577         if (isset($_POST['Mail_Without_Key']))
    578         {
    579         $collection = array();
    580 
    581                 switch ($_POST['target'])
    582     {
    583         case 'all' :
    584       {
    585         foreach($page['filtered_users'] as $local_user)
    586         {
    587                 array_push($collection, $local_user['id']);
    588         }
    589         break;
    590                         }
    591       case 'selection' :
    592       {
    593         if (isset($_POST['selection']))
    594         {
    595                 $collection = $_POST['selection'];
    596         }
    597         break;
    598       }
    599                 }
    600 
    601     if (count($collection) == 0)
    602     {
    603         array_push($page['errors'], l10n('Select at least one user'));
    604     }
    605         }
     587                if (isset($_POST['Mail_Without_Key']))
     588                {
     589                $collection = array();
     590
     591                        switch ($_POST['target'])
     592        {
     593                case 'all' :
     594        {
     595                foreach($page['filtered_users'] as $local_user)
     596                {
     597                        array_push($collection, $local_user['id']);
     598                }
     599                break;
     600                                }
     601        case 'selection' :
     602        {
     603                if (isset($_POST['selection']))
     604                {
     605                        $collection = $_POST['selection'];
     606                }
     607                break;
     608        }
     609                        }
     610
     611        if (count($collection) == 0)
     612        {
     613                array_push($page['errors'], l10n('Select at least one user'));
     614        }
     615                }
    606616// +-----------------------------------------------------------------------+
    607617// |             Send reminder without new key to users                    |
    608618// +-----------------------------------------------------------------------+
    609         if (isset($_POST['Mail_Without_Key']) and count($collection) > 0)
    610         {
    611                 if (in_array($conf['guest_id'], $collection))
    612         {
    613         array_push($page['errors'], l10n('No_validation_for_Guest'));
    614     }
    615     if (($conf['guest_id'] != $conf['default_user_id']) and
    616         in_array($conf['default_user_id'], $collection))
    617     {
    618         array_push($page['errors'], l10n('No_validation_for_default_user'));
    619     }
    620         if (in_array($conf['webmaster_id'], $collection))
    621     {
    622         array_push($page['errors'], l10n('No_validation_for_Webmaster'));
    623     }
    624     if (in_array($user['id'], $collection))
    625     {
    626         array_push($page['errors'], l10n('No_validation_for_your_account'));
    627     }
    628 
    629     if (count($page['errors']) == 0)
    630     {
    631         foreach ($collection as $user_id)
    632       {
    633         $typemail = 2;
    634                                     $query = "
    635                                                         SELECT id, username, mail_address
    636                                                         FROM ".USERS_TABLE."
    637                                                         WHERE id = '".$user_id."'
    638                                                 ;";
    639                                 $data = mysql_fetch_array(pwg_query($query));
     619                if (isset($_POST['Mail_Without_Key']) and count($collection) > 0)
     620                {
     621                        if (in_array($conf['guest_id'], $collection))
     622                {
     623                array_push($page['errors'], l10n('No_validation_for_Guest'));
     624        }
     625        if (($conf['guest_id'] != $conf['default_user_id']) and
     626                in_array($conf['default_user_id'], $collection))
     627        {
     628                array_push($page['errors'], l10n('No_validation_for_default_user'));
     629        }
     630                if (in_array($conf['webmaster_id'], $collection))
     631        {
     632                array_push($page['errors'], l10n('No_validation_for_Webmaster'));
     633        }
     634        if (in_array($user['id'], $collection))
     635        {
     636                array_push($page['errors'], l10n('No_validation_for_your_account'));
     637        }
     638
     639        if (count($page['errors']) == 0)
     640        {
     641                foreach ($collection as $user_id)
     642        {
     643                $typemail = 2;
     644                                  $query = "
     645                                                SELECT id, username, mail_address
     646                                                FROM ".USERS_TABLE."
     647                                                WHERE id = '".$user_id."'
     648                                        ;";
     649                                       
     650                                        $data = mysql_fetch_array(pwg_query($query));
    640651                               
    641         ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],false);                             
    642       }
    643       array_push(
    644         $page['infos'],
    645         l10n_dec(
    646         '%d_Reminder_Sent', '%d_Reminders_Sent',
    647         count($collection)
    648         )
    649       );
    650 
    651       foreach ($page['filtered_users'] as $filter_key => $filter_user)
    652       {
    653         if (in_array($filter_user['id'], $collection))
    654         {
    655                 unset($page['filtered_users'][$filter_key]);
    656         }
    657                         }
    658                 }
    659         }
     652                ResendMail2User($typemail,$user_id,$data['username'],$data['mail_address'],false);                             
     653        }
     654        array_push(
     655                $page['infos'],
     656                l10n_dec(
     657                        '%d_Reminder_Sent', '%d_Reminders_Sent',
     658                count($collection)
     659                )
     660        );
     661       
     662                                $page['filtered_users'] = get_unvalid_user_list();
     663                        }
     664                }
     665
     666// +-----------------------------------------------------------------------+
     667// |                                                                            Force validation                                                         |
     668// +-----------------------------------------------------------------------+
     669// +-----------------------------------------------------------------------+
     670// |                            selected users                             |
     671// +-----------------------------------------------------------------------+
     672                if (isset($_POST['Force_Validation']))
     673                {
     674                $collection = array();
     675
     676                        switch ($_POST['target'])
     677        {
     678                case 'all' :
     679        {
     680                foreach($page['filtered_users'] as $local_user)
     681                {
     682                        array_push($collection, $local_user['id']);
     683                }
     684                break;
     685                                }
     686        case 'selection' :
     687        {
     688                if (isset($_POST['selection']))
     689                {
     690                        $collection = $_POST['selection'];
     691                }
     692                break;
     693        }
     694                        }
     695
     696        if (count($collection) == 0)
     697        {
     698                array_push($page['errors'], l10n('Select at least one user'));
     699        }
     700                }
     701// +-----------------------------------------------------------------------+
     702// |                                                                            Force validation                                                         |
     703// +-----------------------------------------------------------------------+
     704                if (isset($_POST['Force_Validation']) and count($collection) > 0)
     705                {
     706                        if (in_array($conf['guest_id'], $collection))
     707                {
     708                array_push($page['errors'], l10n('No_validation_for_Guest'));
     709        }
     710        if (($conf['guest_id'] != $conf['default_user_id']) and
     711                in_array($conf['default_user_id'], $collection))
     712        {
     713                array_push($page['errors'], l10n('No_validation_for_default_user'));
     714        }
     715                if (in_array($conf['webmaster_id'], $collection))
     716        {
     717                array_push($page['errors'], l10n('No_validation_for_Webmaster'));
     718        }
     719        if (in_array($user['id'], $collection))
     720        {
     721                array_push($page['errors'], l10n('No_validation_for_your_account'));
     722        }
     723
     724        if (count($page['errors']) == 0)
     725        {
     726                foreach ($collection as $user_id)
     727        {
     728                                  $query = "
     729                                                SELECT id, username, mail_address
     730                                                FROM ".USERS_TABLE."
     731                                                WHERE id = '".$user_id."'
     732                                        ;";
     733                                       
     734                                        $data = mysql_fetch_array(pwg_query($query));
     735                               
     736                ForceValidation($data['id']);                           
     737        }
     738        array_push(
     739                $page['infos'],
     740                l10n_dec(
     741                        '%d_Validated_User', '%d_Validated_Users',
     742                count($collection)
     743                )
     744        );
     745
     746                                $page['filtered_users'] = get_unvalid_user_list();
     747                        }
     748                }
    660749
    661750// +-----------------------------------------------------------------------+
     
    663752// +-----------------------------------------------------------------------+
    664753
    665         $groups[-1] = '------------';
     754                $groups[-1] = '------------';
    666755
    667756    $query = '
     
    671760      ;';
    672761
    673         $result = pwg_query($query);
     762                $result = pwg_query($query);
    674763         
    675764    while ($row = mysql_fetch_array($result))
     
    681770// |                           Template Init                               |
    682771// +-----------------------------------------------------------------------+
    683         $base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
     772                $base_url = PHPWG_ROOT_PATH.'admin.php?page=user_list';
    684773
    685774    if (isset($_GET['start']) and is_numeric($_GET['start']))
     
    701790
    702791/* Hide radio-button if not allow to assign adviser */
    703         if ($conf['allow_adviser'])
    704     {
    705       $template->assign('adviser', true);
    706     }
     792                if ($conf['allow_adviser'])
     793        {
     794        $template->assign('adviser', true);
     795        }
    707796       
    708797// +-----------------------------------------------------------------------+
     
    710799// +-----------------------------------------------------------------------+
    711800
    712         $profile_url = get_root_url().'admin.php?page=profile&amp;user_id=';
    713     $perm_url = get_root_url().'admin.php?page=user_perm&amp;user_id=';
     801                $profile_url = get_root_url().'admin.php?page=profile&amp;user_id=';
     802                $perm_url = get_root_url().'admin.php?page=user_perm&amp;user_id=';
    714803
    715804    $visible_user_list = array();
     
    717806    {
    718807/* simulate LIMIT $start, $conf['users_page'] */
    719       if ($num < $start)
     808                        if ($num < $start)
    720809      {
    721810        continue;
     
    727816
    728817      $visible_user_list[] = $local_user;
    729         }
    730 
    731         foreach ($visible_user_list as $local_user)
     818                }
     819
     820                foreach ($visible_user_list as $local_user)
    732821    {
    733822      $groups_string = preg_replace(
     
    738827            $local_user['groups']
    739828         )
    740         );
    741 
    742           if (isset($_POST['pref_submit'])
    743         and isset($_POST['selection'])
    744         and in_array($local_user['id'], $_POST['selection']))
    745           {
    746         $checked = 'checked="checked"';
    747           }
    748       else
    749       {
    750         $checked = '';
    751       }
    752 
    753       $properties = array();
    754       if ( $local_user['level'] != 0 )
    755       {
    756         $properties[] = l10n( sprintf('Level %d', $local_user['level']) );
    757       }
    758       $properties[] =
    759         (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true'))
    760           ? l10n('is_high_enabled') : l10n('is_high_disabled');
     829                        );
     830
     831                if (isset($_POST['pref_submit'])
     832                and isset($_POST['selection'])
     833        and in_array($local_user['id'], $_POST['selection']))
     834                {
     835                                $checked = 'checked="checked"';
     836                }
     837                        else
     838        {
     839                $checked = '';
     840        }
     841
     842        $properties = array();
     843        if ( $local_user['level'] != 0 )
     844                        {
     845                $properties[] = l10n( sprintf('Level %d', $local_user['level']) );
     846                        }
     847        $properties[] =
     848                (isset($local_user['enabled_high']) and ($local_user['enabled_high'] == 'true'))
     849                ? l10n('is_high_enabled') : l10n('is_high_disabled');
    761850             
    762       if (isset($conf_nbc_UserAdvManager_ConfirmMail[1]) and $conf_nbc_UserAdvManager_ConfirmMail[0]=='true' )
    763       {
    764         $template->append(
    765                 'users',
    766               array(
    767                 'ID' => $local_user['id'],
    768                 'CHECKED' => $checked,
    769                 'U_PROFILE' => $profile_url.$local_user['id'],
    770                 'U_PERM' => $perm_url.$local_user['id'],
    771                 'USERNAME' => $local_user['username']
    772                   .($local_user['id'] == $conf['guest_id']
    773                     ? '<BR />['.l10n('is_the_guest').']' : '')
    774                   .($local_user['id'] == $conf['default_user_id']
    775                     ? '<BR />['.l10n('is_the_default').']' : ''),
    776                 'STATUS' => l10n('user_status_'.
    777                   $local_user['status']).(($local_user['adviser'] == 'true')
    778                     ? '<BR />['.l10n('adviser').']' : ''),
    779                 'EMAIL' => get_email_address_as_display_text($local_user['email']),
    780                 'GROUPS' => $groups_string,
    781                 'REGISTRATION' => $local_user['registration_date'],
    782                 )
    783               );
    784         }
    785           }
    786 
    787 
    788 
    789 
     851                        if (isset($conf_nbc_UserAdvManager_ConfirmMail[1]) and $conf_nbc_UserAdvManager_ConfirmMail[0]=='true' )
     852        {
     853                $template->append(
     854                'users',
     855                array(
     856                        'ID' => $local_user['id'],
     857                'CHECKED' => $checked,
     858                'U_PROFILE' => $profile_url.$local_user['id'],
     859                'U_PERM' => $perm_url.$local_user['id'],
     860                'USERNAME' => $local_user['username']
     861                                                        .($local_user['id'] == $conf['guest_id']
     862                                                        ? '<BR />['.l10n('is_the_guest').']' : '')
     863                .($local_user['id'] == $conf['default_user_id']
     864                ? '<BR />['.l10n('is_the_default').']' : ''),
     865                                                'STATUS' => l10n('user_status_'.
     866                                                        $local_user['status']).(($local_user['adviser'] == 'true')
     867                ? '<BR />['.l10n('adviser').']' : ''),
     868                                                'EMAIL' => get_email_address_as_display_text($local_user['email']),
     869                'GROUPS' => $groups_string,
     870                'REGISTRATION' => $local_user['registration_date'],
     871                                        )
     872                                );
     873                        }
     874                }
    790875
    791876// +-----------------------------------------------------------------------+
    792877// |                             errors display                            |
    793878// +-----------------------------------------------------------------------+
    794         if ( isset ($errors) and count($errors) != 0)
    795         {
    796           $template->assign('errors',array());
    797       foreach ($errors as $error)
    798           {
    799                 array_push($page['errors'], $error);
    800           }
    801         } 
     879                if ( isset ($errors) and count($errors) != 0)
     880                {
     881                $template->assign('errors',array());
     882                        foreach ($errors as $error)
     883                {
     884                                array_push($page['errors'], $error);
     885                }
     886                } 
    802887
    803888// +-----------------------------------------------------------------------+
    804889// |                           templates display                           |
    805890// +-----------------------------------------------------------------------+
    806         $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/usermanager.tpl');
     891                $template->set_filename('plugin_admin_content', dirname(__FILE__) . '/usermanager.tpl');
    807892    $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content');         
    808   }
     893        }
    809894  else
    810895  {
    811         array_push($page['infos'], l10n('Err_UserManager_Settings'));
     896                array_push($page['infos'], l10n('Err_UserManager_Settings'));
    812897  }
    813898  break;
    814  
    815899}
    816900?>
  • extensions/NBC_UserAdvManager/trunk/admin/confirmmail.tpl

    r3845 r3858  
    1515      <br>
    1616                </li>
    17                 <!-- This function can't be set due to no access to server's cron functionnalities -->
    18                 <!-- <li><label>{'UserAdvManager_ConfirmMail_AutoDel'|@translate}</label><br>
    19         <input type="radio" value="true" {$UserAdvManager_CONFIRMMAIL_AUTODEL_TRUE} name="UserAdvManager_ConfirmMail_AutoDel"/> {'UserAdvManager_ConfirmMail_AutoDel_true'|@translate}<br>
    20         <input type="radio" value="false" {$UserAdvManager_CONFIRMMAIL_AUTODEL_FALSE} name="UserAdvManager_ConfirmMail_AutoDel"/> {'UserAdvManager_ConfirmMail_AutoDel_false'|@translate}<br>
    21       <br>
    22             </li>-->
    2317    <li><label>{'UserAdvManager_ConfirmMail_Remail'|@translate}</label><br>
    2418        <input type="radio" value="true" {$UserAdvManager_CONFIRMMAIL_REMAIL_TRUE} name="UserAdvManager_ConfirmMail_Remail"/> {'UserAdvManager_ConfirmMail_Remail_true'|@translate}<br>
  • extensions/NBC_UserAdvManager/trunk/admin/usermanager.tpl

    r3846 r3858  
    2929                        <td>{$user.EMAIL}</td>
    3030                        <td>{$user.GROUPS}</td>
    31 
     31                                        <td style="text-align:center;">{$user.REGISTRATION}</td>
    3232                        {foreach from=$user.plugin_columns item=data}
    3333                        <td>{$data}</td>
    34                         {/foreach}
    35                         <td style="text-align:center;">{$user.REGISTRATION}</td>
     34                        {/foreach}                     
    3635                        </tr>
    3736                {/foreach}
     
    5251  <input class="submit" type="submit" value="{'Mail_with_key'|@translate}" name="Mail_With_Key" />
    5352  <input class="submit" type="submit" value="{'Force_Validation'|@translate}" name="Force_Validation" />
    54   <!--
    55 <input class="submit" type="submit" value="{'submit'|@translate}" name="submit" {$TAG_INPUT_ENABLED} />
    56 -->
    5753</p>
    5854  </fieldset>
  • extensions/NBC_UserAdvManager/trunk/include/functions_UserAdvManager.inc.php

    r3845 r3858  
    33load_language('plugin.lang', NBC_UserAdvManager_PATH);
    44
     5/* Function called from main.inc.php to send validation email */
    56function SendMail2User($typemail, $id, $username, $password, $email, $confirm)
    67{
     
    7273/* debugging              */
    7374/* ********************** */ 
    74   MailLog($email,$subject);
     75//  MailLog($email,$subject);
    7576/* ********************** */
    76 
    77 }
     77}
     78
    7879
    7980/* Email sending debugger function */
    80 function MailLog  ($to, $subject)
    81 {
    82    $fo=fopen (NBC_UserAdvManager_PATH.'admin/maillog.txt','a') ;
    83    fwrite($fo,"======================\n") ;
    84    fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n");
    85    fwrite($fo,$to . "\n" . $subject . "\r\n") ;
    86    fclose($fo) ;
     81//function MailLog  ($to, $subject)
     82//{
     83//   $fo=fopen (NBC_UserAdvManager_PATH.'admin/maillog.txt','a') ;
     84//   fwrite($fo,"======================\n") ;
     85//   fwrite($fo,'le ' . date('D, d M Y H:i:s') . "\r\n");
     86//   fwrite($fo,$to . "\n" . $subject . "\r\n") ;
     87//   fclose($fo) ;
    8788   //return mail ($to,$subject) ;
    88 }
    89 
    90 
     89//}
     90
     91
     92/* Function called from UserAdvManager_admin.php to resend validation email with or without new validation key */
    9193function ResendMail2User($typemail, $user_id, $username, $email, $confirm)
    9294{
     
    137139/* debugging              */
    138140/* ********************** */ 
    139   MailLog($email,$subject);
     141//  MailLog($email,$subject);
    140142/* ********************** */
    141 
    142 }
    143 
    144 
     143}
     144
     145
     146/* Function called from functions AddConfirmMail and ResetConfirmMail for validation key generation */
    145147function FindAvailableConfirmMailID()
    146148{
     
    161163
    162164
    163 
     165/* Function called from functions SendMail2User to process unvalidated users and generate validation key link */
    164166function AddConfirmMail($user_id, $email)
    165167{
     
    170172  list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
    171173 
    172   if ( isset($Confirm_Mail_ID) )
     174  if (isset($Confirm_Mail_ID))
    173175  {
    174176    $query = "
     
    192194      AND (
    193195        group_id = '".$conf_nbc_UserAdvManager[3]."'
    194         OR
     196                        OR
    195197        group_id = '".$conf_nbc_UserAdvManager[4]."'
    196198      )
     
    198200    pwg_query($query);
    199201
    200     if ( !is_admin() and $conf_nbc_UserAdvManager[9] <> -1 )
     202    if (!is_admin() and $conf_nbc_UserAdvManager[9] <> -1)
    201203    {
    202204      $query = "
     
    224226
    225227
     228/* Function called from UserAdvManager_admin.php to reset validation key */
    226229function ResetConfirmMail($user_id)
    227230{
     
    232235  list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
    233236 
    234   if ( isset($Confirm_Mail_ID) )
     237  if (isset($Confirm_Mail_ID))
    235238  {
    236239    $query = "
     
    253256
    254257
     258/* Function called from main.inc.php - Triggered on user deletion */
    255259function DeleteConfirmMail($user_id)
    256260{
     
    263267
    264268
    265 
     269/* Function called from ConfirmMail.php to verify validation key used by user according time limit */
    266270function VerifyConfirmMail($id)
    267271{
     
    302306      if (!empty($registration_date))
    303307      {
    304                 // Verify Confirmmail with time limit ON
    305                 if (isset ($conf_nbc_UserAdvManager_ConfirmMail[1]))
    306                 {
    307                         // dates formating and compare
    308                         $today = date("d-m-Y"); // Get today's date
    309                         list($day, $month, $year) = explode('-', $today); // explode date of today                                               
    310                         $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp
     308                                // Verify Confirmmail with time limit ON
     309                                if (isset ($conf_nbc_UserAdvManager_ConfirmMail[1]))
     310                                {
     311                                        // dates formating and compare
     312                                        $today = date("d-m-Y"); // Get today's date
     313                                        list($day, $month, $year) = explode('-', $today); // explode date of today                                               
     314                                        $daytimestamp = mktime(0, 0, 0, $month, $day, $year);// Generate UNIX timestamp
    311315                       
    312                         list($regdate, $regtime) = explode(' ', $registration_date); // Explode date and time from registration date
    313                         list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date
    314                         $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp
     316                                list($regdate, $regtime) = explode(' ', $registration_date); // Explode date and time from registration date
     317                                        list($regyear, $regmonth, $regday) = explode('-', $regdate); // Explode date from registration date
     318                                        $regtimestamp = mktime(0, 0, 0, $regmonth, $regday, $regyear);// Generate UNIX timestamp
    315319                       
    316                         $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps     
    317                         $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days
    318 
    319                         // Condition with the value set for time limit
    320                         if ($deltadays <= $conf_nbc_UserAdvManager_ConfirmMail[1]) // If Nb of days is less than the set limit
    321                         {
    322                                 list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
    323 
    324                                 $query = '
    325                                         UPDATE '.USER_CONFIRM_MAIL_TABLE.'
    326                                         SET date_check="'.$dbnow.'"
    327                                         WHERE id = "'.$id.'"
     320                                        $deltasecs = $daytimestamp - $regtimestamp;// Compare the 2 UNIX timestamps     
     321                                        $deltadays = floor($deltasecs / 86400);// Convert result from seconds to days
     322
     323                                        // Condition with the value set for time limit
     324                                        if ($deltadays <= $conf_nbc_UserAdvManager_ConfirmMail[1]) // If Nb of days is less than the limit set
     325                                        {
     326                                                list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
     327
     328                                                $query = '
     329                                                        UPDATE '.USER_CONFIRM_MAIL_TABLE.'
     330                                                        SET date_check="'.$dbnow.'"
     331                                                        WHERE id = "'.$id.'"
     332                                                ;';
     333                                                pwg_query($query);
     334     
     335                                                if ($conf_nbc_UserAdvManager[3] <> -1)
     336                                                {
     337                                                        $query = "
     338                                                                DELETE FROM ".USER_GROUP_TABLE."
     339                                                                WHERE user_id = '".$data['user_id']."'
     340                                                                AND group_id = '".$conf_nbc_UserAdvManager[3]."'
     341                                                        ;";
     342                                                        pwg_query($query);
     343                                                }
     344           
     345                                                if ($conf_nbc_UserAdvManager[4] <> -1) // Change user's group
     346                                                {
     347                                                        $query = "
     348                                                                DELETE FROM ".USER_GROUP_TABLE."
     349                                                                WHERE user_id = '".$data['user_id']."'
     350                                                                AND group_id = '".$conf_nbc_UserAdvManager[4]."'
     351                                                        ;";
     352                                                        pwg_query($query);
     353       
     354                                                        $query = "
     355                                                                INSERT INTO ".USER_GROUP_TABLE."
     356                                                                        (user_id, group_id)
     357                                                                VALUES
     358                                                                        ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
     359                                                                ;";
     360                                                        pwg_query($query);
     361                                                }
     362
     363                                                if (($conf_nbc_UserAdvManager[5] <> -1 or isset($data['status']))) // Change user's status
     364                                                {
     365                                                        $query = "
     366                                                                UPDATE ".USER_INFOS_TABLE."
     367                                                                SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
     368                                                                WHERE user_id = '".$data['user_id']."'
     369                                                        ;";
     370                                                        pwg_query($query);
     371                                                }
     372                                                // Refresh user's category cache
     373                                                invalidate_user_cache();
     374 
     375                                                return true;
     376                                        }
     377                                        elseif ($deltadays > $conf_nbc_UserAdvManager_ConfirmMail[1]) // If timelimit exeeds
     378                                        {
     379                                                return false;
     380                                        }
     381                                }
     382                                // Verify Confirmmail with time limit OFF
     383                                else
     384                                {
     385                                        list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
     386
     387                                        $query = '
     388                                                UPDATE '.USER_CONFIRM_MAIL_TABLE.'
     389                                                SET date_check="'.$dbnow.'"
     390                                                WHERE id = "'.$id.'"
    328391                                        ;';
    329                                 pwg_query($query);
    330      
    331                                 if ( $conf_nbc_UserAdvManager[3] <> -1 )
    332                                 {
    333                                         $query = "
    334                                                 DELETE FROM ".USER_GROUP_TABLE."
    335                                                 WHERE user_id = '".$data['user_id']."'
    336                                                 AND group_id = '".$conf_nbc_UserAdvManager[3]."'
     392                                        pwg_query($query);
     393     
     394                                        if ($conf_nbc_UserAdvManager[3] <> -1)
     395                                        {
     396                                                $query = "
     397                                                        DELETE FROM ".USER_GROUP_TABLE."
     398                                                        WHERE user_id = '".$data['user_id']."'
     399                                                        AND group_id = '".$conf_nbc_UserAdvManager[3]."'
    337400                                                ;";
    338                                         pwg_query($query);
     401                                                pwg_query($query);
     402                                        }
     403   
     404                                        if ($conf_nbc_UserAdvManager[4] <> -1)
     405                                        {
     406                                                $query = "
     407                                                        DELETE FROM ".USER_GROUP_TABLE."
     408                                                        WHERE user_id = '".$data['user_id']."'
     409                                                        AND group_id = '".$conf_nbc_UserAdvManager[4]."'
     410                                                ;";
     411                                                pwg_query($query);
     412
     413                                                $query = "
     414                                                        INSERT INTO ".USER_GROUP_TABLE."
     415                                                                (user_id, group_id)
     416                                                        VALUES
     417                                                                ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
     418                                                ;";
     419                                                pwg_query($query);
     420                                        }
     421
     422                                        if (($conf_nbc_UserAdvManager[5] <> -1 or isset($data['status'])))
     423                                        {
     424                                                $query = "
     425                                                        UPDATE ".USER_INFOS_TABLE."
     426                                                        SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
     427                                                        WHERE user_id = '".$data['user_id']."'
     428                                                ;";
     429                                                pwg_query($query);
     430                                        }
     431                                        // Refresh user's category cache
     432                                        invalidate_user_cache();
     433 
     434                                        return true;
    339435                                }
    340            
    341                                 if ( $conf_nbc_UserAdvManager[4] <> -1 ) // Change user's group
    342                                 {
    343                                         $query = "
    344                                                 DELETE FROM ".USER_GROUP_TABLE."
    345                                                 WHERE user_id = '".$data['user_id']."'
    346                                                 AND group_id = '".$conf_nbc_UserAdvManager[4]."'
    347                                                 ;";
    348                                         pwg_query($query);
    349        
    350                                         $query = "
    351                                                 INSERT INTO ".USER_GROUP_TABLE."
    352                                                         (user_id, group_id)
    353                                                 VALUES
    354                                                         ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
    355                                                 ;";
    356                                         pwg_query($query);
    357                                 }
    358 
    359                                 if (($conf_nbc_UserAdvManager[5] <> -1 or isset($data['status']))) // Change user's status
    360                                 {
    361                                         $query = "
    362                                                 UPDATE ".USER_INFOS_TABLE."
    363                                                 SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
    364                                                 WHERE user_id = '".$data['user_id']."'
    365                                                 ;";
    366                                         pwg_query($query);
    367                                 }
    368                         // Refresh user's category cache
    369                                 invalidate_user_cache();
    370  
    371                                 return true;
    372                         }
    373                         elseif ($deltadays > $conf_nbc_UserAdvManager_ConfirmMail[1]) // If timelimit exeeds
    374                         {
    375                                 return false;
    376436                        }
    377437                }
    378                 // Verify Confirmmail with time limit OFF
    379                 else
    380                 {
     438        }
     439  else
     440    return false;
     441}
     442
     443/* Function called from UserAdvManager_admin.php to force users validation by admin */
     444function ForceValidation($id)
     445{
     446  global $conf;
     447
     448  include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
     449 
     450  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
     451       
     452  $query = "
     453    SELECT COUNT(*)
     454    FROM ".USER_CONFIRM_MAIL_TABLE."
     455    WHERE user_id = '".$id."'
     456  ;";
     457  list($count) = mysql_fetch_row(pwg_query($query));
     458
     459  if ($count == 1)
     460  {
     461    $query = "
     462      SELECT user_id, status, date_check
     463      FROM ".USER_CONFIRM_MAIL_TABLE."
     464      WHERE user_id = '".$id."'
     465    ;";
     466    $data = mysql_fetch_array(pwg_query($query));
     467
     468    if (!empty($data) and isset($data['user_id']) and !isset($data['date_check']))
     469    {     
    381470                        list($dbnow) = mysql_fetch_row(pwg_query('SELECT NOW();'));
    382471
    383                         $query = '
    384                                 UPDATE '.USER_CONFIRM_MAIL_TABLE.'
    385                                 SET date_check="'.$dbnow.'"
    386                                 WHERE id = "'.$id.'"
    387                                 ;';
     472                        $query = "
     473                                UPDATE ".USER_CONFIRM_MAIL_TABLE."
     474                                SET date_check='".$dbnow."'
     475                                WHERE user_id = '".$data['user_id']."'
     476                        ;";
    388477                        pwg_query($query);
    389       
    390                         if ( $conf_nbc_UserAdvManager[3] <> -1 )
     478             
     479                        if ($conf_nbc_UserAdvManager[3] <> -1)
    391480                        {
    392481                                $query = "
     
    394483                                        WHERE user_id = '".$data['user_id']."'
    395484                                        AND group_id = '".$conf_nbc_UserAdvManager[3]."'
    396                                         ;";
     485                                ;";
    397486                                pwg_query($query);
    398487                        }
    399    
    400                         if ( $conf_nbc_UserAdvManager[4] <> -1 )
     488 
     489                        if ($conf_nbc_UserAdvManager[4] <> -1)
    401490                        {
    402491                                $query = "
     
    404493                                        WHERE user_id = '".$data['user_id']."'
    405494                                        AND group_id = '".$conf_nbc_UserAdvManager[4]."'
    406                                         ;";
     495                                ;";
    407496                                pwg_query($query);
    408 
     497       
    409498                                $query = "
    410499                                        INSERT INTO ".USER_GROUP_TABLE."
     
    412501                                        VALUES
    413502                                                ('".$data['user_id']."', '".$conf_nbc_UserAdvManager[4]."')
    414                                         ;";
     503                                ;";
    415504                                pwg_query($query);
    416505                        }
    417506
    418                         if ( ( $conf_nbc_UserAdvManager[5] <> -1 or isset($data['status']) ) )
     507                        if (($conf_nbc_UserAdvManager[5] <> -1 or isset($data['status'])))
    419508                        {
    420509                                $query = "
     
    422511                                        SET status = '".(isset($data['status']) ? $data['status'] : $conf_nbc_UserAdvManager[5])."'
    423512                                        WHERE user_id = '".$data['user_id']."'
    424                                         ;";
     513                                ;";
    425514                                pwg_query($query);
    426515                        }
    427 // Refresh user's category cache
     516                        // Refresh user's category cache
    428517                        invalidate_user_cache();
    429  
    430518                        return true;
    431519                }
    432       }
    433     }
    434   }
    435   else
    436     return false;
    437 }
    438 
    439 
     520        }
     521}
     522
     523/* Function called from main.inc.php - Get username case insensitive */
    440524function NotSensibleSearchUsername($username)
    441525{
    442526  global $conf;
    443527 
    444   if ( isset($username) )
     528  if (isset($username))
    445529  {
    446530    $query = "
     
    456540
    457541
     542/* Obsolete function - Check for single email in database */
    458543function SearchMail($email)
    459544{
    460545  global $conf, $lang;
    461546 
    462   if ( isset($email) )
     547  if (isset($email))
    463548  {
    464549    $query = "
     
    473558}
    474559
     560
     561/* Function called from main.inc.php - Check if username matches forbidden caracters */
    475562function ValidateUsername($login)
    476563{
     
    479566  $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array();
    480567
    481   if ( isset($login) and isset($conf_nbc_UserAdvManager[8]) and $conf_nbc_UserAdvManager[8] <> '' )
     568  if (isset($login) and isset($conf_nbc_UserAdvManager[8]) and $conf_nbc_UserAdvManager[8] <> '')
    482569  {
    483570        $pattern = '/'.$conf_nbc_UserAdvManager[8].'/';
     
    494581
    495582
     583/* Obsolete function - Check for no forbidden email provider */
     584/* This don't work on function call */
    496585function ValidateEmailProvider($email)
    497586{
     
    515604
    516605
     606/* Function called from UserAdvManager.php - Get unvalidated users according time limit */
    517607function get_unvalid_user_list()
    518608{
     
    520610         
    521611        /* Get ConfirmMail configuration */
    522     $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
     612        $conf_nbc_UserAdvManager_ConfirmMail = isset($conf['nbc_UserAdvManager_ConfirmMail']) ? explode(";" , $conf['nbc_UserAdvManager_ConfirmMail']) : array();
    523613         
    524614        /* Get UserAdvManager configuration */
    525615        $conf_nbc_UserAdvManager = isset($conf['nbc_UserAdvManager']) ? explode(";" , $conf['nbc_UserAdvManager']) : array(); 
    526616 
    527     $users = array();
     617  $users = array();
    528618   
    529619        /* search users depending expiration date */
    530     $query = '
    531         SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
    532                                                                                         u.'.$conf['user_fields']['username'].' AS username,
    533                       u.'.$conf['user_fields']['email'].' AS email,
    534                       ui.status,
    535                       ui.adviser,
    536                       ui.enabled_high,
    537                       ui.level,
    538                       ui.registration_date,
    539                       ug.group_id
    540                         FROM '.USERS_TABLE.' AS u
    541                         INNER JOIN '.USER_INFOS_TABLE.' AS ui
    542                                 ON u.'.$conf['user_fields']['id'].' = ui.user_id
    543                 INNER JOIN '.USER_GROUP_TABLE.' AS ug
    544         ON u.'.$conf['user_fields']['id'].' = ug.user_id
    545         WHERE u.'.$conf['user_fields']['id'].' >= 0
    546         AND ug.group_id = "'.$conf_nbc_UserAdvManager[3].'"
    547         AND TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'"
    548         ORDER BY id ASC
    549                 ;';
     620  $query = '
     621        SELECT DISTINCT u.'.$conf['user_fields']['id'].' AS id,
     622                                                                                u.'.$conf['user_fields']['username'].' AS username,
     623                    u.'.$conf['user_fields']['email'].' AS email,
     624                    ui.status,
     625                    ui.adviser,
     626                    ui.enabled_high,
     627                    ui.level,
     628                    ui.registration_date,
     629                    ug.group_id
     630                FROM '.USERS_TABLE.' AS u
     631                INNER JOIN '.USER_INFOS_TABLE.' AS ui
     632                        ON u.'.$conf['user_fields']['id'].' = ui.user_id
     633                INNER JOIN '.USER_GROUP_TABLE.' AS ug
     634        ON u.'.$conf['user_fields']['id'].' = ug.user_id
     635        WHERE u.'.$conf['user_fields']['id'].' >= 0
     636        AND ug.group_id = "'.$conf_nbc_UserAdvManager[3].'"
     637      AND TO_DAYS(NOW()) - TO_DAYS(ui.registration_date) >= "'.$conf_nbc_UserAdvManager_ConfirmMail[1].'"
     638                ORDER BY id ASC
     639        ;';
    550640
    551641        $result = pwg_query($query);
    552642     
    553     while ($row = mysql_fetch_array($result))
    554         {
    555         $user = $row;
    556         $user['groups'] = array();
    557 
    558         array_push($users, $user);
     643  while ($row = mysql_fetch_array($result))
     644  {
     645        $user = $row;
     646    $user['groups'] = array();
     647
     648    array_push($users, $user);
    559649        }
    560650
    561651        /* add group lists */
    562     $user_ids = array();
    563     foreach ($users as $i => $user)
    564     {
    565         $user_ids[$i] = $user['id'];
     652  $user_ids = array();
     653  foreach ($users as $i => $user)
     654  {
     655        $user_ids[$i] = $user['id'];
    566656        }
    567657       
    568658        $user_nums = array_flip($user_ids);
    569659
    570     if (count($user_ids) > 0)
    571     {
    572         $query = '
    573                 SELECT user_id, group_id
     660  if (count($user_ids) > 0)
     661  {
     662        $query = '
     663        SELECT user_id, group_id
    574664                        FROM '.USER_GROUP_TABLE.'
    575             WHERE user_id IN ('.implode(',', $user_ids).')
    576             ;';
     665      WHERE user_id IN ('.implode(',', $user_ids).')
     666                ;';
    577667       
    578668                $result = pwg_query($query);
    579669       
    580         while ($row = mysql_fetch_array($result))
    581         {
    582                 array_push(
    583                 $users[$user_nums[$row['user_id']]]['groups'],
    584                 $row['group_id']
    585                 );
    586          }
     670    while ($row = mysql_fetch_array($result))
     671    {
     672        array_push(
     673        $users[$user_nums[$row['user_id']]]['groups'],
     674        $row['group_id']
     675                        );
     676                }
    587677        }
    588678
    589 return $users;
     679        return $users;
    590680}
    591681?>
  • extensions/NBC_UserAdvManager/trunk/language/en_UK/plugin.lang.php

    r3742 r3858  
    55$conf_UserAdvManager = isset($conf['UserAdvManager']) ? explode(";" , $conf['UserAdvManager']) : array();
    66
    7 $lang['infos_mail %s'] = '%s, please find here your information to login the gallery :';
    8 $lang['Password: %s'] = 'Password: %s';
    9 $lang['Add of %s'] = 'Add of %s';
    10 $lang['Update of %s'] = 'Update of %s';
    117
    12 $lang['Link: %s'] = 'Please, click on this link to confirm your regsitration : %s';
    13 
    14 $lang['title_confirm_mail'] = 'Validate your registration';
    15 $lang['confirm_mail_page_title'] = 'Validate your registration';
    16 $lang['confirm_mail_ok'] = '<br/><br/><br/>Thank you to have confirmed your email address and your registration on the gallery. Have fun !<br/><br/><br/><br/>';
    17 $lang['confirm_mail_bad'] = '<br/><br/><br/>Your validation key is broken or you haven\'t validated your registration. Please contact the gallery\'s webmaster to check this issue.<br/><br/><br/><br/>';
    18 
     8/* Global Configuration Tab */
    199$lang['Title_Tab1'] = 'UserAdvManager - Global Configuration';
    20 $lang['Tab_Global_Options'] = 'Global Configuration';
    21 
    22 $lang['Title_Tab2'] = 'UserAdvManager - ConfirmMail Configuration';
    23 $lang['Tab_ConfirmMail_Options'] = 'ConfirmMail Configuration';
    24 
     10$lang['Tab_Global'] = 'Global Configuration';
    2511$lang['UserAdvManager_Title'] = 'Advanced users settings';
    26 
    27 $lang['UserAdvManager_Mail_Info'] = 'Mail information user';
    28 $lang['UserAdvManager_Mail_Info_true'] = 'Send a information mail to the user when he registering or updating his profile.';
    29 $lang['UserAdvManager_Mail_Info_false'] = 'Turns off the sending of mail.';
    30 $lang['UserAdvManager_MailInfo_Text'] = 'Text used to introduce the email sent to user on his registration or at his profile update.<br>(!!! <blink>WARNING !</blink> Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
    31 $lang['UserAdvManager_No_Casse'] = 'User insensitive';
    32 $lang['UserAdvManager_No_Casse_true'] = 'Make the user account insensitive at the registration and the identification step';
    33 $lang['UserAdvManager_No_Casse_false'] = 'Let the user-sensitive.';
    34 $lang['UserAdvManager_Username_Char'] = 'Limited charset for unsername';
     12$lang['UserAdvManager_Mail_Info'] = ' Mail information user';
     13$lang['UserAdvManager_Mail_Info_true'] = ' Send an information mail to the user when he registes or updates his profile.';
     14$lang['UserAdvManager_Mail_Info_false'] = ' Turns off the sending of mail.';
     15$lang['UserAdvManager_MailInfo_Text'] = ' Text used to introduce the email sent to user on his registration or at his profile update.<br>(!!! <b style="text-decoration: blink underline;">WARNING !</b> Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
     16$lang['UserAdvManager_No_Casse'] = ' User insensitive';
     17$lang['UserAdvManager_No_Casse_true'] = ' Make the user account insensitive at the registration and the identification step';
     18$lang['UserAdvManager_No_Casse_false'] = ' Let the user-sensitive.';
     19$lang['UserAdvManager_Username_Char'] = ' Limited charset for unsername';
    3520$lang['UserAdvManager_Username_Char_true'] = ' The following characters will be forbidden for username choice';
    3621$lang['UserAdvManager_Username_Char_false'] = ' Use the default username charset control.';
     
    3823$lang['UserAdvManager_Confirm_Mail_true'] = ' Send an email to user to allow him to validate his email and his registration.';
    3924$lang['UserAdvManager_Confirm_Mail_false'] = ' Use the default Piwigo registration system (without registration validation).';
    40 $lang['UserAdvManager_ConfirmMail_Text'] = 'Text used to introduce the email sent to user to allow him to validate his email address<br>(!!! <blink>WARNING !</blink> Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
     25$lang['UserAdvManager_ConfirmMail_Text'] = 'Text used to introduce the email sent to user to allow him to validate his email address<br>(!!! <b style="text-decoration: blink underline;">WARNING !</b> Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
    4126$lang['UserAdvManager_No_Confirm_Group'] = 'Group to use for the users who haven\'t validated their email address.';
    4227$lang['UserAdvManager_Validated_Group'] = 'Group to use for the users who have validated their email address.';
     
    4934$lang['UserAdvManager_MailExclusion_true'] = ' Set the email provider exclusion ON (i.e. : @hotmail.* or @msn.*)';
    5035$lang['UserAdvManager_MailExclusion_false'] = ' Set the email provider exclusion OFF.';
    51 $lang['UserAdvManager_MailExclusion_List'] = ' If email provider exclusion is set to ON, fill the email domains to exclude below. You have to use the following format :<br/>@[domaine_name].[domaine_extension] - Example : @hotmail.com<br/>Seperate the different domains with a comma (,)<br/>';
    52 
     36$lang['UserAdvManager_MailExclusion_List'] = ' If email provider exclusion is set to ON, fill the email domains to exclude below. You have to use the following format :<br>@[domaine_name].[domaine_extension] - Example : @hotmail.com<br>Seperate the different domains with a comma (,)<br>';
    5337$lang['audit'] = 'Audit';
    5438$lang['submit'] = 'Submit';
    5539
     40
     41/* ConfirmMail Configuration Tab */
     42$lang['ConfirmMail_Title'] = 'Advanced management and settings of register confirmation by mail';
     43$lang['Title_Tab2'] = 'UserAdvManager - ConfirmMail Settings';
     44$lang['Tab_ConfirmMail'] = 'ConfirmMail Settings';
     45$lang['UserAdvManager_ConfirmMail_Info'] = 'Time limitation for validation of registration :<br>If you enable this option, select the desired time (x) )in the field below. Visitors who register will then have x days to validate their registration. After this period the validation link they have received by mail will be expired.<br>';
     46$lang['UserAdvManager_ConfirmMail_TimeOut_true'] = 'Enable limiting the registration deadline.';
     47$lang['UserAdvManager_ConfirmMail_TimeOut_false'] = 'Disable limiting the registration deadline.';
     48$lang['UserAdvManager_ConfirmMail_TimeOut'] = 'Validation delay :';
     49$lang['UserAdvManager_ConfirmMail_Delay_Info'] = 'Enter the number of days before expiry of the registration validation : ';
     50/* This function can't work due to no access to server's cron functionnalities */
     51//$lang['UserAdvManager_ConfirmMail_AutoDel'] = 'Suppression automatique des comptes non validés après le délai d\'expiration : ';
     52//$lang['UserAdvManager_ConfirmMail_AutoDel_true'] = 'Activer la suppression automatique - <b style="text-decoration: blink underline;">ATTENTION !</b> La suppression est aveugle et sans notification.';
     53//$lang['UserAdvManager_ConfirmMail_AutoDel_false'] = 'Désactiver la suppression automatique.';
     54$lang['UserAdvManager_ConfirmMail_Remail'] = 'Enable or disable email reminder of unvalidated registers :';
     55$lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Enable email reminder';
     56$lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Disable email reminder';
     57$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Custom content of the recall message with regeneration of validation key.<br>If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)<br><br>(!!! <b style="text-decoration: blink underline;">WARNING !</b> Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
     58$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Custom content of the recall message without regeneration of validation key.<br>If left blank, the recall mail will include only the validation link. It is therefore strongly advised to take a little explanatory text. (NB: The text pre-filled with the installation of the plugin is given as an example)<br><br>(!!! <b style="text-decoration: blink underline;">WARNING !</b> Use the multi language tags from Extended Description plugin if this plugin is activated !!!)';
     59
     60
     61/* UserManager Tab */
     62$lang['UserManager_Title'] = 'Advanced settings of unvalidated registered users';
     63$lang['Title_Tab3'] = 'UserAdvManager - Visitors management';
     64$lang['Tab_UserManager'] = 'Visitors management';
     65$lang['UserAdvManager_ConfirmMail_User_List'] = 'When limiting the deadline for registration is enabled, you will find below the list of users awaiting validation, <b style="text-decoration: underline;">whether or not</b> they are in time to validate.<br><br>In this view, you can:
     66<br><br>
     67- Manually delete accounts <b>(manual drain)</b>
     68<br>
     69- Generate email reminder <b>without</b> generating a new key. Warning: Send an email reminder to targeted visitors. This function does not reset the date of registration of targeted visitors and the timeout is still valid.
     70<br>
     71- Generate email reminder <b>with</b> generating a new key. Warning : Send an email reminder to targeted visitors. This function also resets the date of registration of targeted visitors which equates to extend the deadline for validation.<br>
     72- Submit a registration awaiting validation manually even if the expiry date has passed <b>(forcing validation)</b>.
     73<br>';
     74$lang['Registration'] = 'Registration date';
     75
     76
     77/* Mailing */
     78$lang['infos_mail %s'] = '%s, please find here your information to login the gallery :';
     79$lang['Password: %s'] = 'Password: %s';
     80$lang['Add of %s'] = 'Add of %s';
     81$lang['Update of %s'] = 'Update of %s';
     82$lang['Link: %s'] = 'Please, click on this link to confirm your regsitration : %s';
     83$lang['Reminder_with_key_of_%s'] = '%s, your validation key has been renewed';
     84$lang['Reminder_without_key_of_%s'] = '%s, your validation key will expire';
     85
     86
     87/* Email confirmation page */
     88$lang['title_confirm_mail'] = 'Validate your registration';
     89$lang['confirm_mail_page_title'] = 'Validate your registration';
     90$lang['confirm_mail_ok'] = '<br><br><br>Thank you to have confirmed your email address and your registration on the gallery. Have fun !<br><br><br><br>';
     91$lang['confirm_mail_bad'] = '<br><br><br>Your activation key is incorrect or expired or you have already validated your account, please contact the webmaster to fix this problem.<br><br><br><br>';
     92
     93
     94/* Errors and Warnings */
     95$lang['UserAdvManager_audit_ok'] = 'Audit OK';
     96$lang['UserAdvManager_save_config'] ='Configuration saved.';
    5697$lang['Err_audit_no_casse'] = '<b>These accounts are identical to the case closely :</b> ';
    5798$lang['Err_audit_username_char'] = '<b>This account uses one or more forbidden characters :</b> ';
    5899$lang['Err_audit_email_forbidden'] = '<b>This account uses a forbidden email provider :</b> ';
    59 $lang['Err_audit_advise'] = '<b>you make a correction to comply with new rules that you have activated.<br>use a utility géstion database to correct user accounts directly in the table ### _USERS';
    60 $lang['UserAdvManager_audit_ok'] = 'Audit OK';
    61 $lang['UserAdvManager_save_config'] ='Configuration registered.';
    62 
     100$lang['Err_audit_advise'] = '<b>you have to perform corrections to comply with new rules that you have activated.<br>Use a database management utility to correct user accounts directly in the table ### _USERS';
    63101$lang['UserAdvManager_Empty Author'] = 'The author field have to be filled to send a comment.';
    64 
    65102if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' )
    66   $lang['reg_err_login5'] = 'user name is already taken, attention name is insensitive (Shift = Tiny).';
    67 $lang['reg_err_login6'] = 'Username does not contain the following characters: ';
     103        $lang['reg_err_login5'] = 'Username already exist, WARNING name is case insensitive (Shift = Tiny).';
     104$lang['reg_err_login6'] = 'Username does not match the following characters: ';
    68105$lang['reg_err_login7'] = 'Your email provider is banned for registration. Banned email providers are: ';
    69 
    70 $lang['invalid_pwd'] = 'User name or password invalid !';
    71 
    72106$lang['UserAdvManager_empty_pwd'] = '[empty password]';
    73107$lang['UserAdvManager_no_update_pwd'] = '[profile updated without password changed]';
     108$lang['invalid_pwd'] = 'Invalid username or password !';
     109$lang['Err_ConfirmMail_Settings'] = 'This page will be available only if "Email address confirmation" is activated in tab "Global Configuration".';
     110$lang['Err_UserManager_Settings'] = 'This page is available only if "Enable limiting the registration deadline" is active in the "ConfirmMail Settings" tab.';
     111$lang['No_validation_for_Guest'] = 'The "Guest" account is not subject to validation';
     112$lang['No_validation_for_default_user'] = 'The default account is not subject to validation';
     113$lang['No_validation_for_Webmaster'] = 'The "Webmaster" account is not subject to validation';
     114$lang['No_validation_for_your_account'] = 'You personnal admin account is not subject to validation';
     115$lang['Database_Error'] = '<b><u>Warning! Critical integrity error in your database.</u></b><br><br>Please check the integrity of the #_user_confirm_mail table.';
    74116
    75 $lang['Err_ConfirmMail_Settings'] = 'This page will be available only if "Email address confirmation" is activated in tab "Global Configuration".';
     117
     118/* Processing messages */
     119$lang['%d_Mail_With_Key'] = '%d message with key renewal was sent';
     120$lang['%d_Mails_With_Key'] = '%d messages with key renewal were sent';
     121$lang['%d_Reminder_Sent'] = '%d reminder message was sent';
     122$lang['%d_Reminders_Sent'] = '%d reminder messages were sent';
     123$lang['%d_Validated_User'] = '%d User validated manually';
     124$lang['%d_Validated_Users'] = '%d Users validated manually';
     125
     126
     127/* Action button names */
     128$lang['Delete_selected'] = 'Delete';
     129$lang['Mail_without_key'] = 'Reminder without key';
     130$lang['Mail_with_key'] = 'Reminder with key';
     131$lang['Force_Validation'] = 'Forced validation';
    76132?>
  • extensions/NBC_UserAdvManager/trunk/language/fr_FR/plugin.lang.php

    r3845 r3858  
    55$conf_UserAdvManager = isset($conf['UserAdvManager']) ? explode(";" , $conf['UserAdvManager']) : array();
    66
    7 $lang['infos_mail %s'] = '%s, voici vos informations pour vous identifier sur la galerie :';
    8 $lang['Password: %s'] = 'Mot de passe: %s';
    9 $lang['Add of %s'] = 'Création de %s';
    10 $lang['Update of %s'] = 'Mise à jour de %s';
    117
    12 $lang['Link: %s'] = 'Cliquez sur le lien suivant pour confirmer votre inscription : %s';
    13 
    14 $lang['title_confirm_mail'] = 'Confirmation de votre inscription';
    15 $lang['confirm_mail_page_title'] = 'Confirmation d\'inscription';
    16 $lang['confirm_mail_ok'] = '<br><br><br>Merci d\'avoir confirmé votre mail et aussi et surtout votre inscription sur le site, profitez bien des photos ...<br><br><br><br>';
    17 $lang['confirm_mail_bad'] = '<br><br><br>Votre clef d\'activation unique est érronée ou expirée ou vous avez déjà validé votre compte, veuillez contacter le webmaster pour régler ce problème.<br><br><br><br>';
    18 
     8/* Global Configuration Tab */
    199$lang['Title_Tab1'] = 'UserAdvManager - Configuration Générale';
    2010$lang['Tab_Global'] = 'Configuration Générale';
    21 
    2211$lang['UserAdvManager_Title'] = 'Configuration avancée des utilisateurs';
    23 
    2412$lang['UserAdvManager_Mail_Info'] = 'Mail d\'information à l\'utilisateur';
    2513$lang['UserAdvManager_Mail_Info_true'] = ' Envoyer un mail à l\'utilisateur reprenant ses infos lors de son inscription ou la mise à jour de son profil.';
     
    4735$lang['UserAdvManager_MailExclusion_false'] = ' Désactiver l\'exclusion des domaines de messagerie.';
    4836$lang['UserAdvManager_MailExclusion_List'] = ' Si l\'exclusion de domaines de messagerie est activée, saisissez les domaines à exclure ici. Il faut respecter le format suivant :<br>@[nom_du_domaine].[extension_du_domaine] - Exemple : @hotmail.com<br><br>Séparez les domaines par une virgule<br>';
    49 
    50 
    5137$lang['audit'] = 'Audit';
    5238$lang['submit'] = 'Valider';
    5339
    54 $lang['Err_audit_no_casse'] = '<b>Ces comptes sont identiques à la casse près :</b> ';
    55 $lang['Err_audit_username_char'] = '<b>Ce compte contient un ou des caractères interdits :</b> ';
    56 $lang['Err_audit_email_forbidden'] = '<b>Ce compte contient des domaines de messagerie interdit :</b> ';
    57 $lang['Err_audit_advise'] = '<b>Vous avez des corrections a faire pour respecter les nouvelles règles que vous avez activé<br>utilisez un utilitaire de gestion de base de données pour corriger les comptes utilisateurs directement dans la table ###_USERS si nécessaire.</b>';
    58 $lang['UserAdvManager_audit_ok'] = 'Audit OK';
    59 $lang['UserAdvManager_save_config'] ='Configuration enregistrée.';
    6040
    61 $lang['UserAdvManager_Empty Author'] = 'Le champs auteur doit être rempli pour enregistrer un commentaire.';
    62 
    63 if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' )
    64         $lang['new_reg_err_login5'] = 'ce nom utilisateur est déjà pris, ATTENTION le nom est insensible à la casse (Majuscule = Minuscule).';
    65 $lang['reg_err_login6'] = 'le nom utilisateur ne doit pas contenir les caractère suivants : ';
    66 $lang['reg_err_login7'] = 'L\'adresse email est issue d\'un prestataire interdit. Les prestataires d\'adresses email interdits à l\'inscription sont : ';
    67 
    68 $lang['invalid_pwd'] = 'Nom utilisateur ou Mot de passe invalide !';
    69 
    70 $lang['UserAdvManager_empty_pwd'] = '[mot de passe vide]';
    71 $lang['UserAdvManager_no_update_pwd'] = '[mise à jour du profil sans changement du mot de passe]';
    72 
     41/* ConfirmMail Configuration Tab */
    7342$lang['ConfirmMail_Title'] = 'Configuration et gestion avancée de la confirmation par mail';
    74 $lang['Err_ConfirmMail_Settings'] = 'Cette page n\'est accessible que si "Confirmation de l\'adresse email" est actif dans l\'onglet "Configuration Générale".';
    7543$lang['Title_Tab2'] = 'UserAdvManager - Configuration de ConfirmMail';
    7644$lang['Tab_ConfirmMail'] = 'Configuration de ConfirmMail';
    77 $lang['UserAdvManager_ConfirmMail_Info'] = 'Limitation du délai de validation de l\'inscription :
    78 <br>
    79 Si vous activez cette option, sélectionnez le délai souhaité dans la liste qui suit. Les visiteurs qui s\'inscriront alors auront x jours de délais pour valider leur inscription. Passé ce délai, le lien de validation qu\'ils auront reçu par mail sera expiré.<br>';
     45$lang['UserAdvManager_ConfirmMail_Info'] = 'Limitation du délai de validation de l\'inscription :<br>Si vous activez cette option, sélectionnez le délai (x) )souhaité dans la liste qui suit. Les visiteurs qui s\'inscriront alors auront x jours de délais pour valider leur inscription. Passé ce délai, le lien de validation qu\'ils auront reçu par mail sera expiré.<br>';
    8046$lang['UserAdvManager_ConfirmMail_TimeOut_true'] = 'Activer la limitation du délai d\'inscription.';
    8147$lang['UserAdvManager_ConfirmMail_TimeOut_false'] = 'Désactiver la limitation du délai d\'inscription.';
     
    8652//$lang['UserAdvManager_ConfirmMail_AutoDel_true'] = 'Activer la suppression automatique - <b style="text-decoration: blink underline;">ATTENTION !</b> La suppression est aveugle et sans notification.';
    8753//$lang['UserAdvManager_ConfirmMail_AutoDel_false'] = 'Désactiver la suppression automatique.';
    88 $lang['UserAdvManager_ConfirmMail_Remail'] = 'Activer ou désactiver la fonctionnalité de relance des inscrits non validés :';
    89 $lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Activer la relance par mail';
    90 $lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Désactiver la relance par mail';
    91 $lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Contenu personnalisé du message de relance avec regénération de clé de validation.<br>Si laissé vide, le mail de relance ne comportera que le lien de validation. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)<br><br>(!!! <b style="text-decoration: blink underline;">ATTENTION !</b> Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)';
    92 $lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Contenu personnalisé du message de relance sans regénération de clé de validation.<br>Si laissé vide, le mail de relance sera vide. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)<br><br>(!!! <b style="text-decoration: blink underline;">ATTENTION !</b> Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)';
     54$lang['UserAdvManager_ConfirmMail_Remail'] = 'Activer ou désactiver la fonctionnalité de rappel des inscrits non validés :<br>';
     55$lang['UserAdvManager_ConfirmMail_Remail_true'] = 'Activer le rappel par mail';
     56$lang['UserAdvManager_ConfirmMail_Remail_false'] = 'Désactiver le rappel par mail';
     57$lang['UserAdvManager_ConfirmMail_ReMail_Txt1'] = 'Contenu personnalisé du message de rappel avec regénération de clé de validation.<br>Si laissé vide, le mail de rappel ne comportera que le lien de validation. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)<br><br>(!!! <b style="text-decoration: blink underline;">ATTENTION !</b> Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)';
     58$lang['UserAdvManager_ConfirmMail_ReMail_Txt2'] = 'Contenu personnalisé du message de rappel sans regénération de clé de validation.<br>Si laissé vide, le mail de rappel sera vide. Il est donc vivement conseillé de saisir un petit texte explicatif. (NB : Le texte pré renseigné à l\'installation du plugin est donné en exemple)<br><br>(!!! <b style="text-decoration: blink underline;">ATTENTION !</b> Utilisez la méthode multi language du plugin Extended Description si celui-ci est activé !!!)';
    9359
    9460
    95 $lang['UserManager_Title'] = 'Configuration et gestion avancée de la confirmation par mail';
    96 $lang['Err_UserManager_Settings'] = 'Cette page n\'est accessible que si "Délai de validation d\'inscription" est actif dans l\'onglet "Configuration de ConfirmMail".';
     61/* UserManager Tab */
     62$lang['UserManager_Title'] = 'Gestion avancée des inscrits non validés';
    9763$lang['Title_Tab3'] = 'UserAdvManager - Gestion des visiteurs';
    9864$lang['Tab_UserManager'] = 'Gestion des visiteurs';
     
    10167- Supprimer manuellement les comptes <b>(purge manuelle)</b>
    10268<br>
    103 - Générer l\'email de relance <b>sans génération</b> d\'une nouvelle clef. Rrappel pour le visiteur qu\'il doit valider son inscription. Cette fonction ne réinitialise pas la date d\'inscription du visiteur ciblé et le délai d\'expiration est toujours d\'actualité.
     69- Générer l\'email de rappel <b>sans génération</b> d\'une nouvelle clef. Rappel : Cette fonction ne réinitialise pas la date d\'inscription du visiteur ciblé et le délai d\'expiration est toujours d\'actualité.
    10470<br>
    105 - Générer l\'email de relance <b>avec génération</b> d\'une nouvelle clef. Rappel pour le visiteur qu\'il doit valider son inscription. Cette fonction réinitialise également la date d\'inscription du visiteur ciblé ce qui équivaut à prolonger le délai de validation.<br>
     71- Générer l\'email de rappel <b>avec génération</b> d\'une nouvelle clef. Rappel : Cette fonction réinitialise également la date d\'inscription du visiteur ciblé ce qui équivaut à prolonger le délai de validation.<br>
    10672- Valider manuellement une inscription en attente de validation même si la date d\'expiration est révolue <b>(forçage de la validation)</b>.
    10773<br>';
    10874$lang['Registration'] = 'Date d\'enregistrement';
     75
     76
     77/* Mailing */
     78$lang['infos_mail %s'] = '%s, voici vos informations pour vous identifier sur la galerie :';
     79$lang['Password: %s'] = 'Mot de passe: %s';
     80$lang['Add of %s'] = 'Création de %s';
     81$lang['Update of %s'] = 'Mise à jour de %s';
     82$lang['Link: %s'] = 'Cliquez sur le lien suivant pour confirmer votre inscription : %s';
     83$lang['Reminder_with_key_of_%s'] = '%s, votre clé de confirmation a été renouvelée';
     84$lang['Reminder_without_key_of_%s'] = '%s, votre clé de confirmation va expirer';
     85
     86
     87/* Email confirmation page */
     88$lang['title_confirm_mail'] = 'Confirmation de votre inscription';
     89$lang['confirm_mail_page_title'] = 'Confirmation d\'inscription';
     90$lang['confirm_mail_ok'] = '<br><br><br>Merci d\'avoir confirmé votre mail et aussi et surtout votre inscription sur le site, profitez bien des photos ...<br><br><br><br>';
     91$lang['confirm_mail_bad'] = '<br><br><br>Votre clef d\'activation unique est érronée ou expirée ou vous avez déjà validé votre compte, veuillez contacter le webmaster pour régler ce problème.<br><br><br><br>';
     92
     93
     94/* Errors and Warnings */
     95$lang['UserAdvManager_audit_ok'] = 'Audit OK';
     96$lang['UserAdvManager_save_config'] ='Configuration enregistrée.';
     97$lang['Err_audit_no_casse'] = '<b>Ces comptes sont identiques à la casse près :</b> ';
     98$lang['Err_audit_username_char'] = '<b>Ce compte contient un ou des caractères interdits :</b> ';
     99$lang['Err_audit_email_forbidden'] = '<b>Ce compte contient des domaines de messagerie interdit :</b> ';
     100$lang['Err_audit_advise'] = '<b>Vous avez des corrections a faire pour respecter les nouvelles règles que vous avez activé<br>utilisez un utilitaire de gestion de base de données pour corriger les comptes utilisateurs directement dans la table ###_USERS si nécessaire.</b>';
     101$lang['UserAdvManager_Empty Author'] = 'Le champs auteur doit être rempli pour enregistrer un commentaire.';
     102if ( isset($conf_UserAdvManager[1]) and $conf_UserAdvManager[1] == 'true' )
     103        $lang['new_reg_err_login5'] = 'ce nom utilisateur est déjà pris, ATTENTION le nom est insensible à la casse (Majuscule = Minuscule).';
     104$lang['reg_err_login6'] = 'le nom utilisateur ne doit pas contenir les caractère suivants : ';
     105$lang['reg_err_login7'] = 'L\'adresse email est issue d\'un prestataire interdit. Les prestataires d\'adresses email interdits à l\'inscription sont : ';
     106$lang['UserAdvManager_empty_pwd'] = '[mot de passe vide]';
     107$lang['UserAdvManager_no_update_pwd'] = '[mise à jour du profil sans changement du mot de passe]';
     108$lang['invalid_pwd'] = 'Nom utilisateur ou Mot de passe invalide !';
     109$lang['Err_ConfirmMail_Settings'] = 'Cette page n\'est accessible que si "Confirmation de l\'adresse email" est actif dans l\'onglet "Configuration Générale".';
     110$lang['Err_UserManager_Settings'] = 'Cette page n\'est accessible que si "Délai de validation d\'inscription" est actif dans l\'onglet "Configuration de ConfirmMail".';
    109111$lang['No_validation_for_Guest'] = 'Le compte Guest n\'est pas soumis à validation';
    110112$lang['No_validation_for_default_user'] = 'Le compte par défaut n\'est pas soumis à validation';
    111113$lang['No_validation_for_Webmaster'] = 'Le compte du Webmaster n\'est pas soumis à validation';
    112114$lang['No_validation_for_your_account'] = 'Votre compte d\'admin n\'est pas soumis à validation';
     115$lang['Database_Error'] = '<b><u>Attention ! Erreur critique d\'intégrité dans votre base de données.</u></b><br><br>Veuillez contrôler l\'intégrité de la table #_user_confirm_mail.';
    113116
     117
     118/* Processing messages */
    114119$lang['%d_Mail_With_Key'] = '%d message avec renouvellement de clé a été envoyé';
    115120$lang['%d_Mails_With_Key'] = '%d messages avec renouvellement de clé ont été envoyés';
    116 $lang['%d_Reminder_Sent'] = '%d message de relance a été envoyé';
    117 $lang['%d_Reminders_Sent'] = '%d messages de relance ont été envoyés';
     121$lang['%d_Reminder_Sent'] = '%d message de rappel a été envoyé';
     122$lang['%d_Reminders_Sent'] = '%d messages de rappel ont été envoyés';
     123$lang['%d_Validated_User'] = '%d Utilisateur validé manuellement';
     124$lang['%d_Validated_Users'] = '%d Utilisateurs validés manuellement';
    118125
    119 $lang['Reminder_with_key_of_%s'] = '%s, votre clé de confirmation a été renouvelée';
    120 $lang['Reminder_without_key_of_%s'] = '%s, votre clé de confirmation va expirer';
    121126
     127/* Action button names */
    122128$lang['Delete_selected'] = 'Supprimer';
    123 $lang['Mail_without_key'] = 'Relance sans clé';
    124 $lang['Mail_with_key'] = 'Relance avec clé';
     129$lang['Mail_without_key'] = 'rappel sans clé';
     130$lang['Mail_with_key'] = 'rappel avec clé';
    125131$lang['Force_Validation'] = 'Validation forcée';
    126132?>
  • 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.