Changeset 1065 in ExiteCMS for branches/PLi-Fusion/includes/user_functions.php
- Timestamp:
- 11/05/07 22:23:47 (5 years ago)
- File:
-
- 1 edited
-
branches/PLi-Fusion/includes/user_functions.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/PLi-Fusion/includes/user_functions.php
r954 r1065 43 43 if (dbrows($result) != 0) { 44 44 $data = dbarray($result); 45 $cookie_value = $data['user_id'].".".$user_pass;46 45 // if the account is suspended, check for an expiry date 47 46 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(); 48 49 // 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']."'"); 50 51 $data['user_status'] = 0; 51 52 } … … 61 62 // HV - end of code change 62 63 header("P3P: CP='NOI ADM DEV PSAi COM NAV OUR OTRo STP IND DEM'"); 64 $cookie_value = $data['user_id'].".".$user_pass; 63 65 setcookie("userinfo", $cookie_value, $cookie_exp, "/", "", "0"); 64 66 redirect(BASEDIR."setuser.php?user=".$data['user_name'], "script"); … … 136 138 137 139 if (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 } 152 156 } 153 157 }
Note: See TracChangeset
for help on using the changeset viewer.
