Changeset 1060 in ExiteCMS for trunk/setuser.php


Ignore:
Timestamp:
11/05/07 21:36:09 (5 years ago)
Author:
hverton
Message:

Added a feature to handle invalid member email addresses. Once a user has been marked to have an invalid address, a login will redirect to the edit_profile module and the user will be prompted to correct the address. If this doesn't happen within 90 days, the user account will be deactivated and will disappear from the member lists. The account is not deleted or disabled, a login will reactivate the account again (and the 90 day countdown timer will start again).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/setuser.php

    r954 r1060  
    1818// temp storage for template variables 
    1919$variables = array(); 
     20 
     21// set the redirect url (set in theme_cleanup) 
     22if (isset($_COOKIE['last_url'])) { 
     23    $variables['url'] = $_COOKIE['last_url']; 
     24} elseif (empty($_SERVER['HTTP_REFERER'])) { 
     25    $variables['url'] = BASEDIR."index.php"; 
     26} else { 
     27    $variables['url'] = substr(strstr($_SERVER['HTTP_REFERER'], ":"), strlen($_SERVER['HTTP_HOST'])+3); 
     28} 
    2029 
    2130if (isset($_REQUEST['logout']) && $_REQUEST['logout'] == "yes") { 
     
    4655            $user_pass = (preg_match("/^[0-9a-z]{32}$/", $cookie_vars['1']) ? $cookie_vars['1'] : ""); 
    4756            $user_name = preg_replace(array("/\=/","/\#/","/\sOR\s/"), "", stripinput($user)); 
    48             if (!dbcount("(user_id)", "users", "user_name='$user_name' AND user_password='".$user_pass."'")) { 
    49                 $message = "<b>".$locale['196']."</b><br /><br />\n"; 
    50             } else { 
     57            $result = dbquery("SELECT * FROM ".$db_prefix."users WHERE user_name='".$user_name."' AND user_password='".$user_pass."'"); 
     58            if ($data = dbarray($result)) { 
     59                if ($data['user_bad_email'] != 0) { 
     60                    $variables['url'] = BASEDIR."edit_profile.php?check=email&value=".(90 - intval((time() - $data['user_bad_email']) / 86400)); 
     61                } 
    5162                $result = dbquery("DELETE FROM ".$db_prefix."online WHERE online_user='0' AND online_ip='".USER_IP."'"); 
    5263                $message = "<b>".$locale['193'].$user."</b><br /><br />\n"; 
     64            } else { 
     65                $message = "<b>".$locale['196']."</b><br /><br />\n"; 
    5366            } 
    5467        } 
Note: See TracChangeset for help on using the changeset viewer.