Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mnet MDL-21257 temporary fix for mnet breaking on session regeneratio…

…n. This is fixed better, but more obtrusively in 2.0
  • Loading branch information...
commit 5a97f0d96bf6c7c36378571aeeec4bdcce6925ee 1 parent c0f891d
Penny Leach authored
Showing with 12 additions and 0 deletions.
  1. +11 −0 auth/mnet/auth.php
  2. +1 −0  auth/mnet/land.php
View
11 auth/mnet/auth.php
@@ -231,6 +231,17 @@ function start_jump_session($mnethostid, $wantsurl) {
}
/**
+ * 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
* returns the local user record on success.
View
1  auth/mnet/land.php
@@ -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;
Please sign in to comment.
Something went wrong with that request. Please try again.