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

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

Prado::using('Application.facades.UserFacade');

class RegistrationForm extends FacadeTemplateControl {

    public function checkUsername($sender, $param) {
        $param->IsValid = $this->getFacade()->checkForUsername($this->Login->SafeText);
    }

    public function registerUser($sender, $param) {
        if ($this->Page->IsValid) {
            $this->getFacade()->registerUser(
                $this->Login->SafeText,
                $this->Password->Text,
                $this->Admin->Checked
            );
            $this->Response->redirect(
                $this->Service->constructUrl(NULL)
            );
        }
    }

}

?>