From 001bd88aeeb5d830ec043d805ca418889c6e1c23 Mon Sep 17 00:00:00 2001 From: Juan Leyva Date: Fri, 4 Nov 2016 15:51:05 +0000 Subject: [PATCH] MDL-56765 webservice: After a new session is started unset old preferences --- webservice/lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/webservice/lib.php b/webservice/lib.php index 776b1e75ca4..09e7f0f8055 100644 --- a/webservice/lib.php +++ b/webservice/lib.php @@ -111,6 +111,7 @@ class webservice { // setup user session to check capability \core\session\manager::set_user($user); + set_login_session_preferences(); //assumes that if sid is set then there must be a valid associated session no matter the token type if ($token->sid) { @@ -1000,6 +1001,7 @@ abstract class webservice_server implements webservice_server_interface { // now fake user login, the session is completely empty too enrol_check_plugins($user); \core\session\manager::set_user($user); + set_login_session_preferences(); $this->userid = $user->id; if ($this->authmethod != WEBSERVICE_AUTHMETHOD_SESSION_TOKEN && !has_capability("webservice/$this->wsname:use", $this->restricted_context)) {