diff --git a/libraries/cms/application/cms.php b/libraries/cms/application/cms.php index 6a3c9788dcc2e..0f90abc1e8024 100644 --- a/libraries/cms/application/cms.php +++ b/libraries/cms/application/cms.php @@ -808,11 +808,10 @@ public function login($credentials, $options = array()) * This permits authentication plugins blocking the user. */ $authorisations = $authenticate->authorise($response, $options); - + $previousauth = null; foreach ($authorisations as $authorisation) { $denied_states = array(JAuthentication::STATUS_EXPIRED, JAuthentication::STATUS_DENIED); - if (in_array($authorisation->status, $denied_states)) { // Trigger onUserAuthorisationFailure Event. @@ -823,24 +822,28 @@ public function login($credentials, $options = array()) { return false; } - - // Return the error. - switch ($authorisation->status) + // If the user has duplicated request for login ignore the duplicate attempt's message. + if ($previousauth != $authorisation) { - case JAuthentication::STATUS_EXPIRED: + // Return the error. + switch ($authorisation->status) + { + case JAuthentication::STATUS_EXPIRED: return JError::raiseWarning('102002', JText::_('JLIB_LOGIN_EXPIRED')); break; - case JAuthentication::STATUS_DENIED: + case JAuthentication::STATUS_DENIED: return JError::raiseWarning('102003', JText::_('JLIB_LOGIN_DENIED')); break; - default: + default: return JError::raiseWarning('102004', JText::_('JLIB_LOGIN_AUTHORISATION')); break; + } + $previousauth = $authorisation; } } }