mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
lib MDL-1975 Users who have been auto logged in by guest are now redirected to login on capability exceptions rather than being shown the exception.
This commit is contained in:
parent
ee14924440
commit
d9e0726431
2 changed files with 7 additions and 1 deletions
|
@ -274,11 +274,16 @@ class invalid_dataroot_permissions extends moodle_exception {
|
|||
* @return void -does not return. Terminates execution!
|
||||
*/
|
||||
function default_exception_handler($ex) {
|
||||
global $DB, $OUTPUT;
|
||||
global $CFG, $DB, $OUTPUT, $USER, $FULLME, $SESSION;
|
||||
|
||||
// detect active db transactions, rollback and log as error
|
||||
abort_all_db_transactions();
|
||||
|
||||
if (($ex instanceof required_capability_exception) && !CLI_SCRIPT && !AJAX_SCRIPT && !empty($CFG->autologinguests) && !empty($USER->autologinguest)) {
|
||||
$SESSION->wantsurl = $FULLME;
|
||||
redirect(get_login_url());
|
||||
}
|
||||
|
||||
$info = get_exception_info($ex);
|
||||
|
||||
if (debugging('', DEBUG_MINIMAL)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue