-
Improvement
-
Resolution: Fixed
-
Minor
-
3.0.1, 3.0.2, 3.0.3, 3.2, 3.4.4, 3.5, 3.6
-
MOODLE_30_STABLE, MOODLE_32_STABLE, MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE
-
MOODLE_36_STABLE
-
MDL-54551_master -
Replication instructions:
- Edit config.php and add
$CFG->sessiontimeout = 10;
This just sets a session expiry time of 10 seconds.
- Log in and wait on the dashboard/site home for 10 seconds.
- Now, click to expand either the messages or notifications menu in the header
- Notice the exception popup, which doesn't provide the user with a whole lot of useful information.
Summary
When not logged in AJAX webservices return the error code servicenotavailable.
This is not a useful error code as it cannot be used to inform the user that they or not currently logged in.
I suggest a new error code of 'servicerequireslogin'
/lib/ajax/service.php
if (!isloggedin()) {
|
error_log('This external function is not available to public users. Failed to call "' . $methodname . '"');
|
throw new moodle_exception('servicerequireslogin', 'webservice');
|
} else {
|
require_sesskey();
|
}
|
This would obviously require a new language string for 'servicerequireslogin'
- has a non-specific relationship to
-
MDL-36067 Error updating user preference 'filepicker_recentrepository' using ajax.
-
- Closed
-
-
MDL-63210 AJAX webservices return poor error message when not logged in (backport of MDL-54551)
-
- Closed
-
- is duplicated by
-
MDL-56896 Web service is not available error when clicking messaging icon after expected timeout
-
- Closed
-