summaryrefslogtreecommitdiff
path: root/framework/Wsat/pages/TWsatLogin.php
diff options
context:
space:
mode:
Diffstat (limited to 'framework/Wsat/pages/TWsatLogin.php')
-rw-r--r--framework/Wsat/pages/TWsatLogin.php59
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