summaryrefslogtreecommitdiff
path: root/app/php/controls/LoginBox.php
blob: a22750c4ccccfce48bf5e8be067e40ecc7ef0d50 (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
<?php

Prado::using('Application.web.TemplateControl');

class LoginBox extends TemplateControl {

    public function loginUser($sender, $param) {
        if ($this->Page->IsValid) {
            $this->Response->redirect(
                $this->Application->getModule('auth')->ReturnUrl
                ?: $this->Service->constructUrl(NULL)
            );
        }
    }

    public function validatePassword($sender, $param) {
        $param->IsValid = $this->Application->getModule('auth')->login(
            $this->Login->Text,
            $this->Password->Text
        );
    }

}

?>