Source for file log.php

Documentation is available at log.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Plugin
  4.  * @subpackage  System.log
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE.txt
  8.  */
  9.  
  10. defined('_JEXEC'or die;
  11.  
  12. /**
  13.  * Joomla! System Logging Plugin
  14.  *
  15.  * @package     Joomla.Plugin
  16.  * @subpackage  System.log
  17.  * @since       1.5
  18.  */
  19. class PlgSystemLog extends JPlugin
  20. {
  21.     public function onUserLoginFailure($response)
  22.     {
  23.         $errorlog array();
  24.  
  25.         switch($response['status'])
  26.         {
  27.             case JAuthentication::STATUS_SUCCESS:
  28.                 $errorlog['status']  $response['type'" CANCELED: ";
  29.                 $errorlog['comment'$response['error_message'];
  30.                 break;
  31.  
  32.             case JAuthentication::STATUS_FAILURE:
  33.                 $errorlog['status']  $response['type'" FAILURE: ";
  34.                 if ($this->params->get('log_username'0))
  35.                 {
  36.                     $errorlog['comment'$response['error_message'' ("' $response['username''")';
  37.                 }
  38.                 else
  39.                 {
  40.                     $errorlog['comment'$response['error_message'];
  41.                 }
  42.                 break;
  43.  
  44.             default:
  45.                 $errorlog['status']  $response['type'" UNKNOWN ERROR: ";
  46.                 $errorlog['comment'$response['error_message'];
  47.                 break;
  48.         }
  49.         JLog::addLogger(array()JLog::INFO);
  50.         JLog::add($errorlog['comment']JLog::INFO$errorlog['status']);
  51.     }
  52. }

Documentation generated on Tue, 19 Nov 2013 15:07:24 +0100 by phpDocumentor 1.4.3