PageRenderTime 40ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/security/class.atksecuritylistener.inc

https://github.com/ibuildingsnl/ATK
PHP | 51 lines | 10 code | 2 blank | 39 comment | 1 complexity | 0a1252b7b7c251f2db984702c9239d6c MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, MPL-2.0-no-copyleft-exception, LGPL-3.0
  1. <?php
  2. /**
  3. * This file is part of the Achievo ATK distribution.
  4. * Detailed copyright and licensing information can be found
  5. * in the doc/COPYRIGHT and doc/LICENSE files which should be
  6. * included in the distribution.
  7. *
  8. * @package atk
  9. * @subpackage security
  10. *
  11. * @copyright (c)2007 Ibuildings.nl BV
  12. * @license http://www.achievo.org/atk/licensing ATK Open Source License
  13. *
  14. * @version $Revision: 5798 $
  15. * $Id$
  16. */
  17. /**
  18. * ATK security listener.
  19. *
  20. * An instance of the ATK security listener can be registered as listener for the
  21. * ATK security manager. It will then be notified of successful logins and logouts.
  22. *
  23. * The following events are supported:
  24. *
  25. * preLogin: This event is thrown just before the user get's authenticated.
  26. * postLogin: This event is thrown just after the user is successfully authenticated.
  27. * preLogout: This event is thrown just before the user get's logged out the system.
  28. * postLogout: This event is thrown just after the user is logged out the system.
  29. *
  30. * @author Peter C. Verhage <peter@ibuildings.nl>
  31. * @package atk
  32. * @subpackage security
  33. */
  34. class atkSecurityListener
  35. {
  36. /**
  37. * Handle event. In the default implementation, if a method exists with the same
  38. * name as the event this method will be called.
  39. *
  40. * @param string $event event name
  41. * @param string $username user name
  42. */
  43. function handleEvent($event, $username)
  44. {
  45. if (method_exists($this, $event))
  46. $this->$event($username);
  47. }
  48. }
  49. ?>