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:
Penny Leach
2010-02-17 01:32:14 +00:00
parent c0f891d6fe
commit 5a97f0d96b
2 changed files with 12 additions and 0 deletions
+11
View File
@@ -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
+1
View File
@@ -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;