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

}

?>