Page 1 of 1

Changes in libraries\joomla\application\application.php

Posted: Mon Aug 10, 2009 5:07 pm
by Ruby Salton
Hi
I would like to offer to add the following change in libraries\joomla\application\application.php:

/**
* Login authentication function.
*
* Username and encoded password are passed the the onLoginUser event which
* is responsible for the user validation. A successful validation updates
* the current session record with the users details.
*
* Username and encoded password are sent as credentials (along with other
* possibilities) to each observer (authentication plugin) for user
* validation. Successful validation will update the current session with
* the user details.
*
* @param array Array( 'username' => string, 'password' => string )
* @param array Array( 'remember' => boolean )
* @return boolean True on success.
* @access public
* @since 1.5
*/
function login($credentials, $options = array())
{
.
.
.
//change this last line
//Original code: return JError::raiseWarning('SOME_ERROR_CODE', JText::_('E_LOGIN_AUTHENTICATE'));

//with the following line
return JError::raiseWarning('SOME_ERROR_CODE', $response->error_message);
}

The suggested change will allow authentication plugins to set custom error messages during a login process. currently there is no usage for the $response->error_message which is usaly defined whithin onAuthenticate() inside of authentication plugins.

Cheers
Ruby