diff options
author | emkael <emkael@tlen.pl> | 2016-02-24 23:18:07 +0100 |
---|---|---|
committer | emkael <emkael@tlen.pl> | 2016-02-24 23:18:07 +0100 |
commit | 6f7fdef0f500cd4bb540affd3bc1482243f337c1 (patch) | |
tree | 4853eecd0769a903e6130c1896e1d070848150dd /lib/prado/framework/Wsat/pages/layout/TWsatLayout.php | |
parent | 61f2ea48a4e11cb5fb941b3783e19c9e9ef38a45 (diff) |
* Prado 3.3.0
Diffstat (limited to 'lib/prado/framework/Wsat/pages/layout/TWsatLayout.php')
-rw-r--r-- | lib/prado/framework/Wsat/pages/layout/TWsatLayout.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/prado/framework/Wsat/pages/layout/TWsatLayout.php b/lib/prado/framework/Wsat/pages/layout/TWsatLayout.php new file mode 100644 index 0000000..67caa77 --- /dev/null +++ b/lib/prado/framework/Wsat/pages/layout/TWsatLayout.php @@ -0,0 +1,36 @@ +<?php + +/** + * Description of MainLayout + * + * @author daniels + */ +class TWsatLayout extends TTemplateControl +{ + + public function onLoad($param) + { + parent::onLoad($param); + $this->validateSecurity(); + } + + private function validateSecurity() + { + if ($this->Session["wsat_password"] !== $this->getService()->getPassword()) + { + if (!$this->getPage() instanceof TWsatLogin) + { + $url = $this->Service->constructUrl('TWsatLogin'); + $this->Response->redirect($url); + } + } + } + + public function logout() + { + $this->Session["wsat_password"] = ""; + $url = $this->Service->constructUrl('TWsatLogin'); + $this->Response->redirect($url); + } + +}
\ No newline at end of file |