EventHandler
[ class tree: EventHandler ] [ index: EventHandler ] [ all elements ]

Source for file AuthLoggingHandler.php

Documentation is available at AuthLoggingHandler.php

  1. <?php
  2. /**
  3.  * MVClasses
  4.  *
  5.  * LICENSE
  6.  *
  7.  * "THE BEER-WARE LICENSE" (Revision 42):
  8.  * "Sven Strittmatter" <ausserirdisch@sven-space.de> wrote this file.
  9.  * As long as you retain this notice you can do whatever you want with
  10.  * this stuff. If we meet some day, and you think this stuff is worth it,
  11.  * you can buy me a beer in return.
  12.  *
  13.  * @category    MVClasses
  14.  * @package     EventHandler
  15.  * @copyright   Copyright (c) 2007 Sven Strittmatter
  16.  */
  17.  
  18. /**
  19.  * @see EventHandler
  20.  */
  21. require_once dirname(__FILE__)."/EventHandler.php";
  22.  
  23. /**
  24.  * Enter description here...
  25.  * 
  26.  * Longdesc
  27.  *
  28.  * @todo complete description
  29.  *
  30.  * @category    MVClasses
  31.  * @package     EventHandler
  32.  * @uses        Registry
  33.  * @copyright     Copyright (c) 2007 Sven Strittmatter
  34.  * @author    "Sven Strittmatter" <ausserirdisch@sven-space.de>
  35.  * @version     1.0
  36.  * @link        http://www.sven-space.de/code/php/MVClasses
  37.  */
  38. class AuthLoggingHandler implements EventHandler {
  39.     private $_log;
  40.     
  41.     public function __construct($log{
  42.         $this->_log $log;
  43.     }
  44.     
  45.     public function handle(Event $e{
  46.         $auth_data $e->getInfo();
  47.     $fields array(
  48.             date("Y-m-d H:i:s"),
  49.             Registry::getInstance()->getRequest()->getRemoteAddress(),
  50.             $e->getName(),
  51.             $auth_data['username'],
  52.             $auth_data['password']
  53.     );
  54.         
  55.     error_log(implode("|"$fields"\n"3$this->_log);
  56.     }
  57. }

Documentation generated on Sun, 02 Aug 2009 17:14:50 +0200 by phpDocumentor 1.4.2