Commit e8c5b56e authored by Nigel McNie's avatar Nigel McNie
Browse files

Put the ID of the authinstance that was used in the session for MNET users....

Put the ID of the authinstance that was used in the session for MNET users. Unset all MNET related variables in the session when logging out.
parent 3623da12
......@@ -633,6 +633,14 @@ class LiveUser extends User {
if ($this->authenticated === true) {
$this->SESSION->set('messages', array());
}
// Unset all mnet related variables. These are set in
// auth/xmlrpc/lib.php
$this->SESSION->set('mnetuser', null);
$this->SESSION->set('mnetauthinstance', null);
$this->SESSION->set('mnetwwwroot', null);
$this->SESSION->set('mnetsitename', null);
reset($this->defaults);
foreach (array_keys($this->defaults) as $key) {
$this->set($key, $this->defaults[$key]);
......
......@@ -366,9 +366,19 @@ class AuthXmlrpc extends Auth {
// We know who our user is now. Bring her back to life.
$USER->reanimate($user->id, $this->instanceid);
// Set session variables to let the application know this session was
// initiated by MNET. Don't forget that users could initiate their
// sessions without MNET sometimes, which is why this data is stored in
// the session object.
//
// Note that if you add/remove something from the session here, you
// must do the same in the User->logout method in auth/user.php!
$SESSION->set('mnetuser', true);
$SESSION->set('mnetauthinstance', $this->instanceid);
$SESSION->set('mnetwwwroot', $peer->wwwroot);
$SESSION->set('mnetsitename', $peer->name);
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment