summaryrefslogtreecommitdiff
path: root/framework/Wsat/pages/layout/TWsatLayout.php
blob: 67caa77df34e66f5d51472eb1c20f031af0223cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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);
        }

}