- <?php
-
- /**
- * Class file.
- *
- * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
- * @copyright 2005, diemeisterei GmbH. All rights reserved.
- * @author $Author: spheenik $
- * @version $Revision: 201 $ $Date: 2006-05-12 11:47:21 +0200 (Fr, 12 Mai 2006) $
- * @package Lithron
- * @subpackage Pages
- */
-
- /**
- * Displays a login box
- *
- * @package Lithron
- */
- class UserLogin extends TPage
- {
- /**
- * Login with username and password from form
- */
- public function login($sender, $param)
- {
- $manager= $this->Application->getModule('auth');
- if (!$manager->login($this->Username->Text, $this->Password->Text))
- {
- $param->IsValid= false;
- }
- else
- {
- if ($this->User->isInRole("admin"))
- {
- $this->Application->Session->add("SqLiteAdminAllowed", "yes");
- }
- }
- }
-
- /**
- * Handles response after login
- */
- public function onLoadComplete($param)
- {
- parent :: onLoadComplete($param);
-
- if ($return_url= $this->Application->getModule('auth')->getReturnUrl())
- {
- }
- else
- {
- $url= $this->Request->constructUrl("page", "packages.Administration");
- $this->Response->redirect($url);
- #$return_url = $this->Request->constructUrl("page",$this->Application->Service->getDefaultPage());
- }
-
- if ($this->IsPostBack && $this->IsValid)
- $this->Response->redirect($return_url);
-
- }
- }
- ?>