Navigation Menu

Skip to content

Commit

Permalink
mnet MDL-21257 temporary fix for mnet breaking on session regeneratio…
Browse files Browse the repository at this point in the history
…n. This is fixed better, but more obtrusively in 2.0
  • Loading branch information
Penny Leach committed Feb 17, 2010
1 parent c0f891d commit 5a97f0d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions auth/mnet/auth.php
Expand Up @@ -230,6 +230,17 @@ function start_jump_session($mnethostid, $wantsurl) {
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
Expand Down
1 change: 1 addition & 0 deletions auth/mnet/land.php
Expand Up @@ -34,6 +34,7 @@
// 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;
Expand Down

0 comments on commit 5a97f0d

Please sign in to comment.