CoreFiles by mySites.guru
log.php52 lines, 1,313 bytes, from Joomla_3.0.2-Stable-Full_Package.zip
Raw History Compare with 3.0.1
md5
72fba92a5b54eca24ccd886e09c0f417
sha1
f4fb68aa6174a45b04df1f9f283348873dcb51cd
sha256
3696521ce26d92208ea5f7b1edbedf6a90f3ce9cb254d5ce28f420b231807ff8
<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  System.log
 *
 * @copyright   Copyright (C) 2005 - 2012 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
 *
 * @package     Joomla.Plugin
 * @subpackage  System.log
 * @since       1.5
 */
class plgSystemLog extends JPlugin
{
	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 3 releases, Joomla 3.0.0 to 3.0.2. See them all, or every version of this file.