function delete_all_sessions() { global $CFG; // TODO: Expires each PHP session individually // $sessions = get_records('mnet_session', 'mnethostid', $this->id); $sessions = get_records('mnet_session', 'mnethostid', $this->id); if (count($sessions) > 0 && file_exists($CFG->dirroot . '/auth/mnet/auth.php')) { require_once $CFG->dirroot . '/auth/mnet/auth.php'; $auth = new auth_plugin_mnet(); $auth->end_local_sessions($sessions); } $deletereturn = delete_records_select('mnet_session', " mnethostid = '{$this->id}'"); return true; }
function delete_all_sessions() { global $CFG, $DB; // TODO: Expires each PHP session individually $sessions = $DB->get_records('mnet_session', array('mnethostid' => $this->id)); if (count($sessions) > 0 && file_exists($CFG->dirroot . '/auth/mnet/auth.php')) { require_once $CFG->dirroot . '/auth/mnet/auth.php'; $auth = new auth_plugin_mnet(); $auth->end_local_sessions($sessions); } $deletereturn = $DB->delete_records('mnet_session', array('mnethostid' => $this->id)); return true; }