mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-54551 core: AJAX call redirects to login page when session expired
This commit is contained in:
parent
8c51626841
commit
acf94de6d5
4 changed files with 19 additions and 7 deletions
|
@ -208,10 +208,10 @@ class external_api {
|
|||
// Do not allow access to write or delete webservices as a public user.
|
||||
if ($externalfunctioninfo->loginrequired) {
|
||||
if (defined('NO_MOODLE_COOKIES') && NO_MOODLE_COOKIES && !PHPUNIT_TEST) {
|
||||
throw new moodle_exception('servicenotavailable', 'webservice');
|
||||
throw new moodle_exception('servicerequireslogin', 'webservice');
|
||||
}
|
||||
if (!isloggedin()) {
|
||||
throw new moodle_exception('servicenotavailable', 'webservice');
|
||||
throw new moodle_exception('servicerequireslogin', 'webservice');
|
||||
} else {
|
||||
require_sesskey();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue