Ignore:
Timestamp:
Aug 15, 2010, 2:55:57 AM (14 years ago)
Author:
Eric
Message:
  • Bug 1795 fixed: Fixes rules using email information and/or email of validation
  • Language files fixed
File:
1 edited

Legend:

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

    r6753 r6757  
    128128  $conf_UAM = unserialize($conf['UserAdvManager']);
    129129 
    130   /* Sending registration confirmation by email */
    131   if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
    132   {
    133     if (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'true')
    134     {
    135     $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
    136     SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
    137     }
    138     elseif (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'false')
    139     {
     130  if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
     131  {
     132    /* This is to send an information email and set user to "waiting" group or status until admin validation */
    140133    $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
    141134    SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
     135    setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
     136  }
     137  elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'false') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
     138  {
     139    /* This is to set user to "wainting" group or status until admin validation */
     140    setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
     141  }
     142  elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'false'))
     143  {
     144    /* This is to send an information email without validation key */
     145    $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
     146    SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
     147  }
     148  /* Sending registration confirmation by email */
     149  elseif ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
     150  {
     151    if (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'true')
     152    {
     153      $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
     154      SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
     155    }
     156    elseif (is_admin() and isset($conf_UAM[20]) and $conf_UAM[20] == 'false')
     157    {
     158      $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
     159      SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], false);
    142160    }
    143161    elseif (!is_admin())
    144162    {
    145     $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
    146     SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
     163      $passwd = (isset($_POST['password'])) ? $_POST['password'] : '';
     164      SendMail2User(1, $register_user['id'], $register_user['username'], $passwd, $register_user['email'], true);
    147165    }
    148166  }
     
    337355     
    338356      /* Sending registration confirmation by email */
    339       if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
     357      if ((isset($conf_UAM[0]) and $conf_UAM[0] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'true') or (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
    340358      {
    341359        $confirm_mail_need = false;
     
    350368         
    351369          list($current_email) = pwg_db_fetch_row(pwg_query($query));
    352      
    353           if ($_POST['mail_address'] != $current_email and ( isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
     370
     371          /* This is to send a new validation key */
     372          if ($_POST['mail_address'] != $current_email and (isset($conf_UAM[1]) and $conf_UAM[1] == 'true'))
    354373       
    355374            $confirm_mail_need = true;
     375
     376          /* This is to set the user to "waiting" group or status until admin validation */
     377          if ($_POST['mail_address'] != $current_email and (isset($conf_UAM[1]) and $conf_UAM[1] == 'local'))
     378       
     379            setgroup($register_user['id']);// Set to "waiting" group or status until admin validation
     380            $confirm_mail_need = false;
    356381        }
    357382       
Note: See TracChangeset for help on using the changeset viewer.