diff options
| author | emkael <emkael@tlen.pl> | 2016-03-10 17:11:11 +0100 |
|---|---|---|
| committer | emkael <emkael@tlen.pl> | 2016-03-10 17:11:11 +0100 |
| commit | bb786c1e19aeaa44b81b47265a284e8737c09e65 (patch) | |
| tree | d9896a7d27adc3197ca0d0b3ac7114396a52f5d3 /app/php/components/LoginBox.php | |
| parent | 94fb52459898989ea2158e6b90440632724a1679 (diff) | |
* login box as a component
Diffstat (limited to 'app/php/components/LoginBox.php')
| -rw-r--r-- | app/php/components/LoginBox.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/php/components/LoginBox.php b/app/php/components/LoginBox.php new file mode 100644 index 0000000..33bbcc1 --- /dev/null +++ b/app/php/components/LoginBox.php @@ -0,0 +1,23 @@ +<?php + +class LoginBox extends TTemplateControl { + + 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 + ); + } + +} + +?> |
