From bb786c1e19aeaa44b81b47265a284e8737c09e65 Mon Sep 17 00:00:00 2001 From: emkael Date: Thu, 10 Mar 2016 17:11:11 +0100 Subject: * login box as a component --- app/php/components/LoginBox.php | 23 +++++++++++++++++++++++ app/php/components/LoginBox.tpl | 29 +++++++++++++++++++++++++++++ app/php/pages/Login.page | 30 +----------------------------- app/php/pages/Login.php | 23 ----------------------- 4 files changed, 53 insertions(+), 52 deletions(-) create mode 100644 app/php/components/LoginBox.php create mode 100644 app/php/components/LoginBox.tpl delete mode 100644 app/php/pages/Login.php 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 @@ +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 + ); + } + +} + +?> diff --git a/app/php/components/LoginBox.tpl b/app/php/components/LoginBox.tpl new file mode 100644 index 0000000..c602b88 --- /dev/null +++ b/app/php/components/LoginBox.tpl @@ -0,0 +1,29 @@ +Username: + + +
+Password: + + + +
+ diff --git a/app/php/pages/Login.page b/app/php/pages/Login.page index 5f02a5f..15bc93e 100644 --- a/app/php/pages/Login.page +++ b/app/php/pages/Login.page @@ -1,31 +1,3 @@ - Username: - - -
- Password: - - - -
- +
diff --git a/app/php/pages/Login.php b/app/php/pages/Login.php deleted file mode 100644 index c4d33c2..0000000 --- a/app/php/pages/Login.php +++ /dev/null @@ -1,23 +0,0 @@ -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 - ); - } - -} - -?> -- cgit v1.2.3