From 6c8bc91d89000410a6604e5173d1fb1e4b4fa5d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jannis=20Mo=C3=9Fhammer?= Date: Tue, 22 Oct 2013 14:28:35 +0200 Subject: [PATCH] Add login page with own template --- .../controllers/AuthenticationController.php | 3 +- .../forms/Authentication/LoginForm.php | 10 +--- application/layouts/scripts/login.phtml | 55 +++++++++++++++++++ .../views/scripts/authentication/login.phtml | 21 ++++--- public/css/icinga/login.less | 50 +++++++++++++++++ 5 files changed, 123 insertions(+), 16 deletions(-) create mode 100755 application/layouts/scripts/login.phtml create mode 100644 public/css/icinga/login.less diff --git a/application/controllers/AuthenticationController.php b/application/controllers/AuthenticationController.php index 9a5979019..b85edaa8d 100644 --- a/application/controllers/AuthenticationController.php +++ b/application/controllers/AuthenticationController.php @@ -59,8 +59,9 @@ class AuthenticationController extends ActionController public function loginAction() { $credentials = new Credential(); - $this->_helper->layout->setLayout('inline'); + $this->_helper->layout->setLayout('login'); $this->view->form = new LoginForm(); + $this->view->form->setRequest($this->_request); $this->view->title = "Icinga Web Login"; try { diff --git a/application/forms/Authentication/LoginForm.php b/application/forms/Authentication/LoginForm.php index 2d96b4f87..c731f5eea 100644 --- a/application/forms/Authentication/LoginForm.php +++ b/application/forms/Authentication/LoginForm.php @@ -62,13 +62,7 @@ class LoginForm extends Form ) ); - $this->addElement( - 'submit', - 'submit', - array( - 'label' => t('Login'), - 'class' => 'pull-right' - ) - ); + $this->setSubmitLabel('Login'); + } } diff --git a/application/layouts/scripts/login.phtml b/application/layouts/scripts/login.phtml new file mode 100755 index 000000000..a99ab45c2 --- /dev/null +++ b/application/layouts/scripts/login.phtml @@ -0,0 +1,55 @@ + + + + + + + + + + + <?= $this->title ? $this->title : 'Icinga Web'; ?> + + + + + + + + + + + + + + + + + + +
+
+ + +
+
+
+ layout()->content; ?> + +
+ + diff --git a/application/views/scripts/authentication/login.phtml b/application/views/scripts/authentication/login.phtml index 9b56c817c..cfa81a9a1 100644 --- a/application/views/scripts/authentication/login.phtml +++ b/application/views/scripts/authentication/login.phtml @@ -1,14 +1,21 @@ -
-

Login

- - form->render(); ?> errorInfo)): ?> -
+
+
+
+
errorInfo ?> +
- +
+ +
+
+
+ form; ?> +
+
+
-