Skip to content

Commit

Permalink
MDL-43049 accesslib: Fix typo in memory optimization code
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncoggins committed Nov 25, 2013
1 parent f7434db commit 529b85b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/accesslib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1113,12 +1113,12 @@ function get_empty_accessdata() {
function get_user_accessdata($userid, $preloadonly=false) {
global $CFG, $ACCESSLIB_PRIVATE, $USER;

if (!empty($USER->acces['rdef']) and empty($ACCESSLIB_PRIVATE->rolepermissions)) {
if (!empty($USER->access['rdef']) and empty($ACCESSLIB_PRIVATE->rolepermissions)) {
// share rdef from USER session with rolepermissions cache in order to conserve memory
foreach($USER->acces['rdef'] as $k=>$v) {
$ACCESSLIB_PRIVATE->rolepermissions[$k] =& $USER->acces['rdef'][$k];
foreach ($USER->access['rdef'] as $k=>$v) {
$ACCESSLIB_PRIVATE->rolepermissions[$k] =& $USER->access['rdef'][$k];
}
$ACCESSLIB_PRIVATE->accessdatabyuser[$USER->id] = $USER->acces;
$ACCESSLIB_PRIVATE->accessdatabyuser[$USER->id] = $USER->access;
}

if (!isset($ACCESSLIB_PRIVATE->accessdatabyuser[$userid])) {
Expand Down

0 comments on commit 529b85b

Please sign in to comment.