diff options
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 |