summaryrefslogtreecommitdiff
path: root/manager/application/views
diff options
context:
space:
mode:
authorMarkus Warg <markus@mawaunix.mawa.sls>2010-03-31 16:43:49 +0200
committerMarkus Warg <markus@mawaunix.mawa.sls>2010-03-31 16:43:49 +0200
commit4f4c5ce3ccf0370f926d75e700e8b0bd2208f3f6 (patch)
tree82cb017ac68772ea36c0f522ec019bf14fbdc77a /manager/application/views
parent8398c9048d34a1f51212ae770998fc082fc93b69 (diff)
downloadcacert-mgr-4f4c5ce3ccf0370f926d75e700e8b0bd2208f3f6.tar.gz
cacert-mgr-4f4c5ce3ccf0370f926d75e700e8b0bd2208f3f6.tar.xz
cacert-mgr-4f4c5ce3ccf0370f926d75e700e8b0bd2208f3f6.zip
initial setup of framework code
enabled features * login * crt login * top / left menu * logging * db layer
Diffstat (limited to 'manager/application/views')
-rw-r--r--manager/application/views/helpers/LeftNav.php96
-rw-r--r--manager/application/views/helpers/TopNav.php99
-rw-r--r--manager/application/views/helpers/UserInfo.php95
-rw-r--r--manager/application/views/scripts/error/error.phtml28
-rw-r--r--manager/application/views/scripts/error/permissiondenied.phtml8
-rw-r--r--manager/application/views/scripts/index/index.phtml7
-rw-r--r--manager/application/views/scripts/login/index.phtml16
-rw-r--r--manager/application/views/scripts/login/loginresult.phtml16
-rw-r--r--manager/application/views/scripts/logout/index.phtml7
9 files changed, 372 insertions, 0 deletions
diff --git a/manager/application/views/helpers/LeftNav.php b/manager/application/views/helpers/LeftNav.php
new file mode 100644
index 0000000..7523d6e
--- /dev/null
+++ b/manager/application/views/helpers/LeftNav.php
@@ -0,0 +1,96 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id: LeftNav.php 8 2009-11-24 10:32:47Z markus $
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Container_Standalone */
+require_once 'Zend/View/Helper/Placeholder/Container/Standalone.php';
+
+/**
+ * Helper for building an applications top navigation bar
+ *
+ * @uses Zend_View_Helper_Placeholder_Container_Standalone
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_LeftNav extends Zend_View_Helper_Placeholder_Container_Standalone
+{
+ /**
+ * Registry key for placeholder
+ * @var string
+ */
+ protected $_regKey = 'Zend_View_Helper_LeftNav';
+
+ protected $items = array();
+
+ /**
+ * Retrieve placeholder for navigation element and optionally set state
+ *
+ * Single Link elements to be made with $this->url(array('controller'=>'<controller>'), 'default', true);
+ *
+ * @param string $link
+ * @param string $setType
+ * @param string $setPos
+ * @return Zend_View_Helper_LeftNav
+ */
+ public function leftNav($link = null, $setType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $setPos = 0)
+ {
+ $link = (string) $link;
+ if ($link !== '') {
+ if ($setType == Zend_View_Helper_Placeholder_Container_Abstract::SET) {
+ if ($setPos != 0)
+ $this->items[$setPos] = $link;
+ else
+ $this->items[] = $link;
+ } elseif ($setType == Zend_View_Helper_Placeholder_Container_Abstract::PREPEND) {
+ $this->items = array_merge(array($link), $this->items);
+ } else {
+ $this->items[] = $link;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Turn helper into string
+ *
+ * @param string|null $indent
+ * @param string|null $locale
+ * @return string
+ */
+ public function __toString($indent = null, $locale = null)
+ {
+ $output = '';
+ $indent = (null !== $indent)
+ ? $this->getWhitespace($indent)
+ : $this->getIndent();
+
+ $output .= $indent . "<ul>\n";
+ foreach ($this->items as $item) {
+ $output .= $indent . "<li>" . $item . "</li>\n";
+ }
+ $output .= $indent . "</ul>\n";
+
+ return $output;
+ }
+}
diff --git a/manager/application/views/helpers/TopNav.php b/manager/application/views/helpers/TopNav.php
new file mode 100644
index 0000000..604178a
--- /dev/null
+++ b/manager/application/views/helpers/TopNav.php
@@ -0,0 +1,99 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id: TopNav.php 20 2009-12-01 14:26:22Z markus $
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Container_Standalone */
+require_once 'Zend/View/Helper/Placeholder/Container/Standalone.php';
+
+/**
+ * Helper for building an applications top navigation bar
+ *
+ * @uses Zend_View_Helper_Placeholder_Container_Standalone
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_TopNav extends Zend_View_Helper_Placeholder_Container_Standalone
+{
+ /**
+ * Registry key for placeholder
+ * @var string
+ */
+ protected $_regKey = 'Zend_View_Helper_TopNav';
+
+ protected $items = array();
+
+ /**
+ * Retrieve placeholder for navigation element and optionally set state
+ *
+ * Single Link elements to be made with $this->url(array('controller'=>'<controller>'), 'default', true);
+ *
+ * @param string $link
+ * @param string $setType
+ * @param string $setPos
+ * @return Zend_View_Helper_TopNav
+ */
+ public function topNav($link = null, $setType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $setPos = 0)
+ {
+ $link = (string) $link;
+ if ($link !== '') {
+ if ($setType == Zend_View_Helper_Placeholder_Container_Abstract::SET) {
+ if ($setPos != 0)
+ $this->items[$setPos] = $link;
+ else
+ $this->items[] = $link;
+ } elseif ($setType == Zend_View_Helper_Placeholder_Container_Abstract::PREPEND) {
+ $this->items = array_merge(array($link), $this->items);
+ } else {
+ $this->items[] = $link;
+ }
+ }
+
+ return $this;
+ }
+
+ /**
+ * Turn helper into string
+ *
+ * @param string|null $indent
+ * @param string|null $locale
+ * @return string
+ */
+ public function __toString($indent = null, $locale = null)
+ {
+ $output = '';
+ $indent = (null !== $indent)
+ ? $this->getWhitespace($indent)
+ : $this->getIndent();
+
+ ksort($this->items);
+
+ $output .= $indent . "<ul>\n";
+
+ foreach ($this->items as $item) {
+ $output .= $indent . "<li>" . $item . "</li>\n";
+ }
+ $output .= $indent . "</ul>\n";
+
+ return $output;
+ }
+}
diff --git a/manager/application/views/helpers/UserInfo.php b/manager/application/views/helpers/UserInfo.php
new file mode 100644
index 0000000..31b0b05
--- /dev/null
+++ b/manager/application/views/helpers/UserInfo.php
@@ -0,0 +1,95 @@
+<?php
+/**
+ * Zend Framework
+ *
+ * LICENSE
+ *
+ * This source file is subject to the new BSD license that is bundled
+ * with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://framework.zend.com/license/new-bsd
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@zend.com so we can send you a copy immediately.
+ *
+ * @category Zend
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @version $Id: UserInfo.php 33 2009-12-10 15:08:38Z markus $
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+
+/** Zend_View_Helper_Placeholder_Container_Standalone */
+require_once 'Zend/View/Helper/Placeholder/Container/Standalone.php';
+
+/**
+ * Helper for displaying an user info div somewhere
+ *
+ * @uses Zend_View_Helper_Placeholder_Container_Standalone
+ * @package Zend_View
+ * @subpackage Helper
+ * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @license http://framework.zend.com/license/new-bsd New BSD License
+ */
+class Zend_View_Helper_UserInfo extends Zend_View_Helper_Placeholder_Container_Standalone
+{
+ /**
+ * Registry key for placeholder
+ * @var string
+ */
+ protected $_regKey = 'Zend_View_Helper_UserInfo';
+
+ private $items = array();
+
+ /**
+ * Retrieve placeholder for navigation element and optionally set state
+ *
+ * Single Link elements to be made with $this->url(array('controller'=>'<controller>'), 'default', true);
+ *
+ * @param array $data
+ * @return Zend_View_Helper_UserData
+ */
+ public function UserInfo($ar = null, $setType = Zend_View_Helper_Placeholder_Container_Abstract::APPEND, $setPos = 0)
+ {
+ if ($ar !== null && is_array($ar)) {
+ $this->items = $ar;
+ }
+ return $this;
+ }
+
+ /**
+ * Turn helper into string
+ *
+ * @param string|null $indent
+ * @param string|null $locale
+ * @return string
+ */
+ public function __toString($indent = null, $locale = null)
+ {
+ $session = Zend_Registry::get('session');
+ $this->items = $session->authdata;
+
+ $output = '';
+
+ if ($session->authdata['authed'] !== true)
+ return $output;
+
+# $indent = (null !== $indent)
+# ? $this->getWhitespace($indent)
+# : $this->getIndent();
+ $indent = '';
+
+ $output .= $indent . "<div id=\"userinfo\">\n";
+ $output .= $indent . "\tUser: " . $this->items['authed_username'] . "<br>\n";
+ $output .= $indent . "\tName: " . $this->items['authed_fname'] . ' ' . $this->items['authed_lname'] . "<br>\n";
+ $output .= $indent . "\tRole: " . $this->items['authed_role'] . "<br>\n";
+ if ($this->items['authed_by_crt'] === true)
+ $output .= $indent . "\tLoginmethod: CRT<br>\n";
+ else
+ $output .= $indent . "\tLoginmethod: PASSWD<br>\n";
+ $output .= $indent . "</div>\n";
+
+ return $output;
+ }
+}
diff --git a/manager/application/views/scripts/error/error.phtml b/manager/application/views/scripts/error/error.phtml
new file mode 100644
index 0000000..1782039
--- /dev/null
+++ b/manager/application/views/scripts/error/error.phtml
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>Zend Framework Default Application</title>
+</head>
+<body>
+ <h1>An error occurred</h1>
+ <h2><?php echo $this->message ?></h2>
+
+ <?php if ('development' == APPLICATION_ENV): ?>
+
+ <h3>Exception information:</h3>
+ <p>
+ <b>Message:</b> <?php echo $this->exception->getMessage() ?>
+ </p>
+
+ <h3>Stack trace:</h3>
+ <pre><?php echo $this->exception->getTraceAsString() ?>
+ </pre>
+
+ <h3>Request Parameters:</h3>
+ <pre><?php echo var_export($this->request->getParams(), true) ?>
+ </pre>
+ <?php endif ?>
+
+</body>
+</html>
diff --git a/manager/application/views/scripts/error/permissiondenied.phtml b/manager/application/views/scripts/error/permissiondenied.phtml
new file mode 100644
index 0000000..8219e5b
--- /dev/null
+++ b/manager/application/views/scripts/error/permissiondenied.phtml
@@ -0,0 +1,8 @@
+<?php
+/**
+ * @author markus
+ * $Id: loginresult.phtml 7 2009-11-19 15:03:59Z markus $
+ */
+?>
+<H1><?php print I18n::_('Permission Denied')?></H1>
+<?php print I18n::_('You do not have the permission to perform the requested action'); ?> \ No newline at end of file
diff --git a/manager/application/views/scripts/index/index.phtml b/manager/application/views/scripts/index/index.phtml
new file mode 100644
index 0000000..58c9dc9
--- /dev/null
+++ b/manager/application/views/scripts/index/index.phtml
@@ -0,0 +1,7 @@
+<?php
+/**
+ * @author markus
+ * $Id: index.phtml 25 2009-12-02 15:43:21Z markus $
+ */
+?>
+<H1><?php print I18n::_('Dashboard'); ?></H1>
diff --git a/manager/application/views/scripts/login/index.phtml b/manager/application/views/scripts/login/index.phtml
new file mode 100644
index 0000000..57f49ea
--- /dev/null
+++ b/manager/application/views/scripts/login/index.phtml
@@ -0,0 +1,16 @@
+<?php
+/**
+ * @author markus
+ * $Id: index.phtml 36 2009-12-15 15:49:57Z markus $
+ */
+
+// $this->headScript()->appendFile('js/1st.js');
+// $this->headScript()->appendFile('js/2nd.js');
+$this->headLink()->appendStylesheet('/css/login.css');
+
+$this->headLink()->appendStylesheet('/css/form_dl.css');
+?>
+
+<H1><?php print I18n::_('Please log in'); ?></H1>
+<?php print $this->form;?>
+<a href='/login/crt'><?php print I18n::_('Client Cert Login'); ?></a> \ No newline at end of file
diff --git a/manager/application/views/scripts/login/loginresult.phtml b/manager/application/views/scripts/login/loginresult.phtml
new file mode 100644
index 0000000..09437ca
--- /dev/null
+++ b/manager/application/views/scripts/login/loginresult.phtml
@@ -0,0 +1,16 @@
+<?php
+/**
+ * @author markus
+ * $Id: loginresult.phtml 7 2009-11-19 15:03:59Z markus $
+ */
+
+if ($this->session->authdata['authed']) {
+?>
+<H1>Willkommen im Club, <?php print $this->session->authdata['authed_username']; ?></H1>
+<?php
+}
+else {
+?>
+<H1>Bitte loggen Sie sich ein.</H1>
+<?php
+} \ No newline at end of file
diff --git a/manager/application/views/scripts/logout/index.phtml b/manager/application/views/scripts/logout/index.phtml
new file mode 100644
index 0000000..5106390
--- /dev/null
+++ b/manager/application/views/scripts/logout/index.phtml
@@ -0,0 +1,7 @@
+<?php
+/**
+ * @author markus
+ * $Id: index.phtml 7 2009-11-19 15:03:59Z markus $
+ */
+?>
+<H1><?php print I18n::_('You have successfully been logged out'); ?></H1>