summaryrefslogtreecommitdiff
path: root/framework/Wsat/pages/layout/TWsatLayout.php
blob: e799125b029c6fb1e3d456fbcb0fa3cef5e39dd5 (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
<?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);
    }

}

?>