- md5
- 0f6bdbf4d4a74bf001abdee82a1a6586
- sha1
- 968f928f037de529aef91989ef8a359b6ee4c554
- sha256
- e6b56f2a0c0e523b16e826ae9e769a879a48ede81019bbe21455d0200182da3c
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
<?php
/**
* @package Joomla.Plugin
* @subpackage System.log
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Joomla! System Logging Plugin.
*
* @since 1.5
*/
class PlgSystemLog extends JPlugin
{
/**
* Called if user fails to be logged in.
*
* @param array $response Array of response data.
*
* @return void
*
* @since 1.5
*/
public function onUserLoginFailure($response)
{
$errorlog = array();
switch ($response['status'])
{
case JAuthentication::STATUS_SUCCESS:
$errorlog['status'] = $response['type'] . " CANCELED: ";
$errorlog['comment'] = $response['error_message'];
break;
case JAuthentication::STATUS_FAILURE:
$errorlog['status'] = $response['type'] . " FAILURE: ";
if ($this->params->get('log_username', 0))
{
$errorlog['comment'] = $response['error_message'] . ' ("' . $response['username'] . '")';
}
else
{
$errorlog['comment'] = $response['error_message'];
}
break;
default:
$errorlog['status'] = $response['type'] . " UNKNOWN ERROR: ";
$errorlog['comment'] = $response['error_message'];
break;
}
JLog::addLogger(array(), JLog::INFO);
JLog::add($errorlog['comment'], JLog::INFO, $errorlog['status']);
}
}
The same content is in 20 releases, Joomla 3.4.0-beta1 to 3.5.0-beta. See them all, or every version of this file.