Commit 4cc1cd24 authored by Eugene Venter's avatar Eugene Venter
Browse files

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



Bug #826453

Change-Id: I1e6c102b67ad0342a1d91494e84f74617722db93
Signed-off-by: default avatarEugene Venter <eugene@catalyst.net.nz>
parent 77c45fa7
......@@ -1167,6 +1167,8 @@ class LiveUser extends User {
* Logs the current user out
*/
public function logout () {
require_once(get_config('libroot') . 'ddl.php');
if ($this->changed == true) {
log_debug('Destroying user with un-committed changes');
}
......@@ -1178,7 +1180,7 @@ class LiveUser extends User {
// Unset session variables related to authentication
$this->SESSION->set('authinstance', null);
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'));
}
......
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