Ignore:
Timestamp:
11/05/07 22:23:47 (5 years ago)
Author:
hverton
Message:

Merged trunk revision 1056:1064 into the PLi-Fusion branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/PLi-Fusion/includes/user_functions.php

    r954 r1065  
    4343    if (dbrows($result) != 0) { 
    4444        $data = dbarray($result); 
    45         $cookie_value = $data['user_id'].".".$user_pass; 
    4645        // if the account is suspended, check for an expiry date 
    4746        if ($data['user_status'] == 1 && $data['user_ban_expire'] > 0 && $data['user_ban_expire'] < time() ) { 
     47            // if this user's email address is marked as bad, reset the countdown counter 
     48            $data['user_bad_email'] = $data['user_bad_email'] == 0 ? 0 : time(); 
    4849            // reset the user status and the expiry date 
    49             $result = dbquery("UPDATE ".$db_prefix."users SET user_status='0', user_ban_expire='0' WHERE user_id='".$data['user_id']."'"); 
     50            $result = dbquery("UPDATE ".$db_prefix."users SET user_status='0', user_ban_expire='0', user_bad_email = '".$data['user_bad_email']."' WHERE user_id='".$data['user_id']."'"); 
    5051            $data['user_status'] = 0; 
    5152        } 
     
    6162            // HV - end of code change 
    6263            header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'"); 
     64            $cookie_value = $data['user_id'].".".$user_pass; 
    6365            setcookie("userinfo", $cookie_value, $cookie_exp, "/", "", "0"); 
    6466            redirect(BASEDIR."setuser.php?user=".$data['user_name'], "script"); 
     
    136138 
    137139if (isset($userdata) && is_array($userdata)) { 
    138     // get the users own group memberships into an array 
    139     $groups = explode(".", substr($userdata['user_groups'], 1)); 
    140     foreach ($groups as $group) { 
    141         // check if this groups has subgroups. If so, add them to the array 
    142         getsubgroups($group); 
    143     } 
    144     // create a new user_group field with all inherited groups, and 
    145     // get the inherited group rights and add them to the user own rights 
    146     $userdata['user_groups'] = ""; 
    147     foreach ($groups as $group) { 
    148         $userdata['user_groups'] .= ".".$group; 
    149         $result = dbarray(dbquery("SELECT group_rights FROM ".$db_prefix."user_groups WHERE group_id = '".$group."'")); 
    150         if (isset($result['group_rights']) && $result['group_rights'] != "") { 
    151             $userdata['user_rights'] .= ($userdata['user_rights']==""?"":".").$result['group_rights']; 
     140    // if group memberships are defined, get the users own group memberships into an array 
     141    if (!empty($userdata['user_groups'])) { 
     142        $groups = explode(".", substr($userdata['user_groups'], 1)); 
     143        foreach ($groups as $group) { 
     144            // check if this groups has subgroups. If so, add them to the array 
     145            getsubgroups($group); 
     146        } 
     147        // create a new user_group field with all inherited groups, and 
     148        // get the inherited group rights and add them to the user own rights 
     149        $userdata['user_groups'] = ""; 
     150        foreach ($groups as $group) { 
     151            $userdata['user_groups'] .= ".".$group; 
     152            $result = dbarray(dbquery("SELECT group_rights FROM ".$db_prefix."user_groups WHERE group_id = '".$group."'")); 
     153            if (isset($result['group_rights']) && $result['group_rights'] != "") { 
     154                $userdata['user_rights'] .= ($userdata['user_rights']==""?"":".").$result['group_rights']; 
     155            } 
    152156        } 
    153157    } 
Note: See TracChangeset for help on using the changeset viewer.