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

Source for file UserLogin.php

Documentation is available at UserLogin.php

  1. <?php
  2.  
  3. /**
  4. * Class file.
  5. *
  6. * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
  7. * @copyright 2005, diemeisterei GmbH. All rights reserved.
  8. * @author $Author: spheenik $
  9. * @version $Revision: 201 $ $Date: 2006-05-12 11:47:21 +0200 (Fr, 12 Mai 2006) $
  10. * @package Lithron
  11. * @subpackage Pages
  12. */
  13.  
  14. /**
  15. * Displays a login box
  16. *
  17. * @package Lithron
  18. */
  19. class UserLogin extends TPage
  20. {
  21. /**
  22. * Login with username and password from form
  23. */
  24. public function login($sender, $param)
  25. {
  26. $manager= $this->Application->getModule('auth');
  27. if (!$manager->login($this->Username->Text, $this->Password->Text))
  28. {
  29. $param->IsValid= false;
  30. }
  31. else
  32. {
  33. if ($this->User->isInRole("admin"))
  34. {
  35. $this->Application->Session->add("SqLiteAdminAllowed", "yes");
  36. }
  37. }
  38. }
  39.  
  40. /**
  41. * Handles response after login
  42. */
  43. public function onLoadComplete($param)
  44. {
  45. parent :: onLoadComplete($param);
  46.  
  47. if ($return_url= $this->Application->getModule('auth')->getReturnUrl())
  48. {
  49. }
  50. else
  51. {
  52. $url= $this->Request->constructUrl("page", "packages.Administration");
  53. $this->Response->redirect($url);
  54. #$return_url = $this->Request->constructUrl("page",$this->Application->Service->getDefaultPage());
  55. }
  56.  
  57. if ($this->IsPostBack && $this->IsValid)
  58. $this->Response->redirect($return_url);
  59.  
  60. }
  61. }
  62. ?>

Documentation generated on Tue, 20 Jun 2006 05:15:25 +0200 by phpDocumentor 1.3.0RC4