You've already forked joomla_test
first commit
This commit is contained in:
1
plugins/system/log/index.html
Normal file
1
plugins/system/log/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><title></title>
|
52
plugins/system/log/log.php
Normal file
52
plugins/system/log/log.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* @package Joomla.Plugin
|
||||
* @subpackage System.log
|
||||
*
|
||||
* @copyright Copyright (C) 2005 - 2013 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']);
|
||||
}
|
||||
}
|
35
plugins/system/log/log.xml
Normal file
35
plugins/system/log/log.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<extension version="3.1" type="plugin" group="system">
|
||||
<name>plg_system_log</name>
|
||||
<author>Joomla! Project</author>
|
||||
<creationDate>April 2007</creationDate>
|
||||
<copyright>Copyright (C) 2005 - 2013 Open Source Matters. All rights reserved.</copyright>
|
||||
<license>GNU General Public License version 2 or later; see LICENSE.txt</license>
|
||||
<authorEmail>admin@joomla.org</authorEmail>
|
||||
<authorUrl>www.joomla.org</authorUrl>
|
||||
<version>3.0.0</version>
|
||||
<description>PLG_LOG_XML_DESCRIPTION</description>
|
||||
<files>
|
||||
<filename plugin="log">log.php</filename>
|
||||
<filename>index.html</filename>
|
||||
</files>
|
||||
<languages>
|
||||
<language tag="en-GB">en-GB.plg_system_log.ini</language>
|
||||
<language tag="en-GB">en-GB.plg_system_log.sys.ini</language>
|
||||
</languages>
|
||||
<config>
|
||||
<fields name="params">
|
||||
<fieldset name="basic">
|
||||
<field name="log_username" type="radio"
|
||||
description="PLG_SYSTEM_LOG_FIELD_LOG_USERNAME_DESC"
|
||||
label="PLG_SYSTEM_LOG_FIELD_LOG_USERNAME_LABEL"
|
||||
class="btn-group"
|
||||
default="0"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</config>
|
||||
</extension>
|
Reference in New Issue
Block a user