mnet MDL-21257 temporary fix for mnet breaking on session regeneration. This is fixed better, but more obtrusively in 2.0
This commit is contained in:
@@ -230,6 +230,17 @@ class auth_plugin_mnet extends auth_plugin_base {
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* after a successful login, land.php will call complete_user_login
|
||||
* which will in turn regenerate the session id.
|
||||
* this means that what is stored in mnet_session table needs updating.
|
||||
*
|
||||
*/
|
||||
function update_session_id() {
|
||||
global $USER;
|
||||
return set_field('mnet_session', 'session_id', session_id(), 'username', $USER->username, 'mnethostid', $USER->mnethostid, 'useragent', sha1($_SERVER['HTTP_USER_AGENT']));
|
||||
}
|
||||
|
||||
/**
|
||||
* This function confirms the remote (ID provider) host's mnet session
|
||||
* by communicating the token and UA over the XMLRPC transport layer, and
|
||||
|
||||
@@ -34,6 +34,7 @@ $localuser = $mnetauth->confirm_mnet_session($token, $remotewwwroot);
|
||||
// log in
|
||||
$USER = get_complete_user_data('id', $localuser->id, $localuser->mnethostid);
|
||||
complete_user_login($USER);
|
||||
$mnetauth->update_session_id();
|
||||
|
||||
if (!empty($localuser->mnet_foreign_host_array)) {
|
||||
$USER->mnet_foreign_host_array = $localuser->mnet_foreign_host_array;
|
||||
|
||||
Reference in New Issue
Block a user