From 699001c79be1a484ea74d4e8f1086cf5158380b8 Mon Sep 17 00:00:00 2001 From: Gilles-Philippe Leblanc Date: Fri, 16 Jan 2015 09:43:10 -0500 Subject: [PATCH] MDL-48873 auth_cas: Wrong redirection with bad multiauth login --- auth/cas/auth.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/auth/cas/auth.php b/auth/cas/auth.php index d6c22184908..eaf3f6c9ffa 100644 --- a/auth/cas/auth.php +++ b/auth/cas/auth.php @@ -113,6 +113,12 @@ class auth_plugin_cas extends auth_plugin_ldap { // If the multi-authentication setting is used, check for the param before connecting to CAS. if ($this->config->multiauth) { + + // If there is an authentication error, stay on the default authentication page. + if (!empty($SESSION->loginerrormsg)) { + return; + } + $authCAS = optional_param('authCAS', '', PARAM_RAW); if ($authCAS == 'NOCAS') { return;