Phundament-Components
[ class tree: Phundament-Components ] [ index: Phundament-Components ] [ 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: schmunk $
  9.  * @version $Revision: 601 $  $Date: 2007-02-24 23:49:30 +0100 (Sa, 24 Feb 2007) $
  10.  * @package Phundament.Components
  11.  * @subpackage Pages
  12.  */
  13.  
  14. /**
  15.  * Displays a login box
  16.  *
  17.  * @package Admin.Pages
  18.  * @subpackage Authentication
  19.  */
  20. class UserLogin extends TPage
  21. {
  22.     /**
  23.      * Login with username and password from form
  24.      */
  25.     public function login($sender$param)
  26.     {
  27.         $manager$this->Application->getModule('auth');
  28.         if (!$manager->login($this->Username->Text$this->Password->Text))
  29.         {
  30.             $param->IsValidfalse;
  31.             $url$this->Service->constructUrl("packages.UserLogin");
  32.             $this->Response->redirect($url);
  33.         }
  34.         else
  35.         {
  36.             $this->Session['Lithron:User:IsLoggedIn'true;
  37.             if ($this->User->isInRole("root"))
  38.             {
  39.                 $this->Application->Session->add("SqLiteAdminAllowed""yes");
  40.             }
  41.         }
  42.     }
  43.  
  44.     /**
  45.      * Handles response after login
  46.      */
  47.     public function onLoadComplete($param)
  48.     {
  49.         parent :: onLoadComplete($param);
  50.  
  51.         $return_url$this->Application->getModule('auth')->getReturnUrl();
  52.         if (!$return_url)
  53.         {
  54.             $url$this->Service->constructUrl("packages.Administration");
  55.             #echo $url;exit;
  56.             $this->Response->redirect($url);
  57.             #$return_url = $this->Request->constructUrl("page",$this->Application->Service->getDefaultPage());
  58.         }
  59.  
  60.         if ($this->IsPostBack && $this->IsValid)
  61.             $this->Response->redirect($return_url);
  62.  
  63.     }
  64. }
  65. ?>

Documentation generated on Sun, 25 Feb 2007 16:11:51 +0100 by phpDocumentor 1.3.1