Commit 0015766b authored by Hugh Davenport's avatar Hugh Davenport Committed by Gerrit Code Review
Browse files

Merge "auth/user.php: logout - fix user session db delete"

parents e9a0383f 4cc1cd24
...@@ -1167,6 +1167,8 @@ class LiveUser extends User { ...@@ -1167,6 +1167,8 @@ class LiveUser extends User {
* Logs the current user out * Logs the current user out
*/ */
public function logout () { public function logout () {
require_once(get_config('libroot') . 'ddl.php');
if ($this->changed == true) { if ($this->changed == true) {
log_debug('Destroying user with un-committed changes'); log_debug('Destroying user with un-committed changes');
} }
...@@ -1178,7 +1180,7 @@ class LiveUser extends User { ...@@ -1178,7 +1180,7 @@ class LiveUser extends User {
// Unset session variables related to authentication // Unset session variables related to authentication
$this->SESSION->set('authinstance', null); $this->SESSION->set('authinstance', null);
if (get_config('installed') && !defined('INSTALLER') && $this->get('sessionid') if (get_config('installed') && !defined('INSTALLER') && $this->get('sessionid')
&& function_exists('table_exists') && table_exists('usr_session')) { && table_exists(new XMLDBTable('usr_session'))) {
delete_records('usr_session', 'session', $this->get('sessionid')); delete_records('usr_session', 'session', $this->get('sessionid'));
} }
......
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