diff options
author | Daniel <darthdaniel85@gmail.com> | 2013-11-22 15:25:30 -0500 |
---|---|---|
committer | Daniel <darthdaniel85@gmail.com> | 2013-11-22 15:25:30 -0500 |
commit | ab6effd64caefa732ef0994d6c3048f5cd474bf6 (patch) | |
tree | 73f4e568295f4d7625fc16af9ce03c58bbbaab2a /framework/Wsat/pages/TWsatLogin.php | |
parent | 85ca63b0896be3d12a098b44b5ec0c65a5b76a6c (diff) |
WSAT beta release.
Diffstat (limited to 'framework/Wsat/pages/TWsatLogin.php')
-rw-r--r-- | framework/Wsat/pages/TWsatLogin.php | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/framework/Wsat/pages/TWsatLogin.php b/framework/Wsat/pages/TWsatLogin.php index 7435d75d..0bbdc53f 100644 --- a/framework/Wsat/pages/TWsatLogin.php +++ b/framework/Wsat/pages/TWsatLogin.php @@ -1,30 +1,31 @@ -<?php
-
-/**
- * Description of Inicio
- *
- * @author daniels
- */
-class TWsatLogin extends TPage {
-
- public function login() {
- $config_pass = $this->getService()->getPassword();
- $user_pass = $this->password->Text;
-
- if ($user_pass === $config_pass) {
- $this->Session["wsat_password"] = $config_pass;
-
- $authManager = $this->Application->getModule('auth');
- $url = $authManager->ReturnUrl;
- if (empty($url)) {
- $url = $this->Service->constructUrl('TWsatHome');
- }
- $this->Response->redirect($url);
- } else {
- echo "user or pass wrong";
- }
- }
-
-}
-
+<?php + +/** + * Description of Inicio + * + * @author daniels + */ +class TWsatLogin extends TPage { + + public function login() { + if ($this->IsValid) { + $this->Session["wsat_password"] = $this->getService()->getPassword(); + + $authManager = $this->Application->getModule('auth'); + $url = $authManager->ReturnUrl; + if (empty($url)) { + $url = $this->Service->constructUrl('TWsatHome'); + } + $this->Response->redirect($url); + } + } + + public function validatePassword($sender, $param) { + $config_pass = $this->getService()->getPassword(); + $user_pass = $this->password->Text; + $param->IsValid = $user_pass === $config_pass; + } + +} + ?>
\ No newline at end of file |