From b1178725a8e9a24013c23e3073ff1261e535b7af Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Wed, 19 Sep 2007 07:06:17 +0000 Subject: [PATCH] weblib: switchroles_form() user_login_string() handle the new switchroles The switched role data bits have moved to a different place in the session. Trivial to fix here. --- lib/weblib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index d66d515444..b8fd62491d 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3097,9 +3097,9 @@ function user_login_string($course=NULL, $user=NULL) { if (isset($user->username) && $user->username == 'guest') { $loggedinas = $realuserinfo.get_string('loggedinasguest'). " (frametarget href=\"$wwwroot/login/index.php\">".get_string('login').')'; - } else if (!empty($user->switchrole[$context->id])) { + } else if (!empty($user->access['rsw'][$context->path])) { $rolename = ''; - if ($role = get_record('role', 'id', $user->switchrole[$context->id])) { + if ($role = get_record('role', 'id', $user->access['rsw'][$context->path])) { $rolename = ': '.format_string($role->name); } $loggedinas = get_string('loggedinas', 'moodle', $username).$rolename. @@ -4485,7 +4485,7 @@ function switchroles_form($courseid) { return ''; } - if (!empty($USER->switchrole[$context->id])){ // Just a button to return to normal + if (!empty($user->access['rsw'][$context->path])){ // Just a button to return to normal $options = array(); $options['id'] = $courseid; $options['sesskey'] = sesskey(); -- 2.39.5