mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 10:56:56 +02:00
MDL-66151 Performance: Session Manager modularisation
Storage of session metadata has moved into the session handler class. This allows for other classes to fully control session handling and removes the dependancy on the core sessions database table. Previously, the standard method of interaction with the session metadata was direct DB calls; this may break other plugins as there are now proper APIs available through the session manager. Co-authored-by: Darren Cocco <moodle@darren.cocco.id.au> Co-authored-by: Trisha Milan <trishamilan@catalyst-au.net> Co-authored-by: Andrew Nicols <andrew@nicols.co.uk>
This commit is contained in:
parent
072fb90384
commit
e52fbd2f84
30 changed files with 1408 additions and 700 deletions
|
@ -2689,7 +2689,8 @@ function require_logout() {
|
|||
'other' => array('sessionid' => $sid),
|
||||
)
|
||||
);
|
||||
if ($session = $DB->get_record('sessions', array('sid'=>$sid))) {
|
||||
$session = \core\session\manager::get_session_by_sid($sid);
|
||||
if (isset($session->id)) {
|
||||
$event->add_record_snapshot('sessions', $session);
|
||||
}
|
||||
|
||||
|
@ -3675,7 +3676,7 @@ function delete_user(stdClass $user) {
|
|||
}
|
||||
|
||||
// Force logout - may fail if file based sessions used, sorry.
|
||||
\core\session\manager::kill_user_sessions($user->id);
|
||||
\core\session\manager::destroy_user_sessions($user->id);
|
||||
|
||||
// Generate username from email address, or a fake email.
|
||||
$delemail = !empty($user->email) ? $user->email : $user->username . '.' . $user->id . '@unknownemail.invalid';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue