/*
* Loop through the plugins and check of the creditials can be used to authenticate
* the user
*
* Any errors raised in the plugin should be returned via the JAuthenticationResponse
* and handled appropriately.
*/
foreach ($plugins as $plugin)
{
$className = 'plg'.$plugin->type.$plugin->name;
if (class_exists( $className )) {
$plugin = new $className($this, (array)$plugin);
}
120 // Try to authenticate
121 $plugin->onAuthenticate($credentials, $options, $response);
122
// If authentication is successfull break out of the loop
if($response->status === JAUTHENTICATE_STATUS_SUCCESS)
{
if (empty( $response->type )) {
$response->type = isset( $plugin->_name ) ? $plugin->_name : $plugin->name;
}
if (empty( $response->username )) {
$response->username = $credentials['username'];
}
if (empty( $response->fullname )) {
$response->fullname = $credentials['username'];
}
if (empty( $response->password )) {
$response->password = $credentials['password'];
}
break;
}
}
return $response;
}
}