summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--application/controllers/ErrorController.php103
-rw-r--r--application/controllers/EventController.php4
-rw-r--r--application/controllers/GearmanController.php12
-rw-r--r--application/controllers/IndexController.php17
-rw-r--r--application/controllers/PersonController.php4
-rw-r--r--application/layouts/default.phtml1
6 files changed, 78 insertions, 63 deletions
diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php
index 4dc12aa..f9b9178 100644
--- a/application/controllers/ErrorController.php
+++ b/application/controllers/ErrorController.php
@@ -2,56 +2,61 @@
class ErrorController extends Zend_Controller_Action
{
+ protected $config;
+ protected $pbs2host;
- public function errorAction()
- {
- $errors = $this->_getParam('error_handler');
-
- if (!$errors || !$errors instanceof ArrayObject) {
- $this->view->message = 'You have reached the error page';
- return;
- }
-
- switch ($errors->type) {
- case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
- case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
- case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
- // 404 error -- controller or action not found
- $this->getResponse()->setHttpResponseCode(404);
- $priority = Zend_Log::NOTICE;
- $this->view->message = 'Page not found';
- break;
- default:
- // application error
- $this->getResponse()->setHttpResponseCode(500);
- $priority = Zend_Log::CRIT;
- $this->view->message = 'Application error';
- break;
- }
-
- // Log exception, if logger available
- if ($log = $this->getLog()) {
- $log->log($this->view->message, $priority, $errors->exception);
- $log->log('Request Parameters', $priority, $errors->request->getParams());
- }
-
- // conditionally display exceptions
- if ($this->getInvokeArg('displayExceptions') == true) {
- $this->view->exception = $errors->exception;
- }
-
- $this->view->request = $errors->request;
- }
-
- public function getLog()
- {
- $bootstrap = $this->getInvokeArg('bootstrap');
- if (!$bootstrap->hasResource('Log')) {
- return false;
- }
- $log = $bootstrap->getResource('Log');
- return $log;
- }
+ public function errorAction()
+ {
+ $this->config = $bootstrap->getOptions();
+ $this->pbs2host = $this->config['pbs2']['host'];
+
+ $errors = $this->_getParam('error_handler');
+
+ if (!$errors || !$errors instanceof ArrayObject) {
+ $this->view->message = 'You have reached the error page';
+ return;
+ }
+
+ switch ($errors->type) {
+ case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE:
+ case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
+ case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
+ // 404 error -- controller or action not found
+ $this->getResponse()->setHttpResponseCode(404);
+ $priority = Zend_Log::NOTICE;
+ $this->view->message = 'Page not found';
+ break;
+ default:
+ // application error
+ $this->getResponse()->setHttpResponseCode(500);
+ $priority = Zend_Log::CRIT;
+ $this->view->message = 'Application error';
+ break;
+ }
+
+ // Log exception, if logger available
+ if ($log = $this->getLog()) {
+ $log->log($this->view->message, $priority, $errors->exception);
+ $log->log('Request Parameters', $priority, $errors->request->getParams());
+ }
+
+ // conditionally display exceptions
+ if ($this->getInvokeArg('displayExceptions') == true) {
+ $this->view->exception = $errors->exception;
+ }
+
+ $this->view->request = $errors->request;
+ }
+
+ public function getLog()
+ {
+ $bootstrap = $this->getInvokeArg('bootstrap');
+ if (!$bootstrap->hasResource('Log')) {
+ return false;
+ }
+ $log = $bootstrap->getResource('Log');
+ return $log;
+ }
}
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index f3a5f50..3c7fa69 100644
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -23,6 +23,8 @@ class EventController extends Zend_Controller_Action
public function init()
{
if (Zend_Auth::getInstance()->hasIdentity()) {
+ $this->config = $bootstrap->getOptions();
+ $this->pbs2host = $this->config['pbs2']['host'];
$this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
if($this->userIDsNamespace['membershipID'] !='') {
$this->eventMapper = new Application_Model_EventMapper();
@@ -30,8 +32,6 @@ class EventController extends Zend_Controller_Action
$this->eventactionMapper = new Application_Model_EventactionMapper();
$this->membershipMapper = new Application_Model_MembershipMapper();
$bootstrap = $this->getInvokeArg('bootstrap');
- $this->config = $bootstrap->getOptions();
- $this->pbs2host = $this->config['pbs2']['host'];
} else {
$this->_helper->redirector('selectmembership', 'person');
return;
diff --git a/application/controllers/GearmanController.php b/application/controllers/GearmanController.php
index 5b4c054..3775996 100644
--- a/application/controllers/GearmanController.php
+++ b/application/controllers/GearmanController.php
@@ -3,11 +3,15 @@
class GearmanController extends Zend_Controller_Action
{
protected $gearmanClient;
+ protected $config;
+ protected $pbs2host;
public function init()
{
if (Zend_Auth::getInstance()->hasIdentity()) {
+ $this->config = $bootstrap->getOptions();
+ $this->pbs2host = $this->config['pbs2']['host'];
$this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
$this->gearmanClient = new GearmanClient();
$this->gearmanClient->addServer('127.0.0.1');
@@ -87,7 +91,7 @@ class GearmanController extends Zend_Controller_Action
'updateRate' => $updateRate,
'clients' => array(
0 => array('id' => '1', 'ip' =>'132.230.4.24', 'mac' =>'00:13:72:C7:FD:A1'), //PC im HiWi-Raum rechts auf dem Tisch
-/* 1 => array('id' => '2', 'ip' =>'132.230.4.2', 'mac' =>''),
+ /* 1 => array('id' => '2', 'ip' =>'132.230.4.2', 'mac' =>''),
2 => array('id' => '3', 'ip' =>'132.230.4.3', 'mac' =>''),
3 => array('id' => '4', 'ip' =>'132.230.4.4', 'mac' =>''),
4 => array('id' => '5', 'ip' =>'132.230.4.5', 'mac' =>''),
@@ -128,7 +132,7 @@ class GearmanController extends Zend_Controller_Action
}
$this->view->result = $result;
}
-
+
public function shutdownAction() {
$eventName = 'test';
$updateRate = 1;
@@ -137,7 +141,7 @@ class GearmanController extends Zend_Controller_Action
'updateRate' => $updateRate,
'clients' => array(
0 => array('id' => '1', 'ip' =>'132.230.4.24', 'mac' =>'00:13:72:C7:FD:A1'), //PC im HiWi-Raum rechts auf dem Tisch
-/* 1 => array('id' => '2', 'ip' =>'132.230.4.2', 'mac' =>''),
+ /* 1 => array('id' => '2', 'ip' =>'132.230.4.2', 'mac' =>''),
2 => array('id' => '3', 'ip' =>'132.230.4.3', 'mac' =>''),
3 => array('id' => '4', 'ip' =>'132.230.4.4', 'mac' =>''),
4 => array('id' => '5', 'ip' =>'132.230.4.5', 'mac' =>''),
@@ -178,5 +182,5 @@ class GearmanController extends Zend_Controller_Action
}
$this->view->result = $result;
}
-
+
}
diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php
index 249e14e..1321c14 100644
--- a/application/controllers/IndexController.php
+++ b/application/controllers/IndexController.php
@@ -2,16 +2,19 @@
class IndexController extends Zend_Controller_Action
{
+ protected $config;
+ protected $pbs2host;
- public function init()
- {
- /* Initialize action controller here */
- }
+ public function init()
+ {
+ $this->config = $bootstrap->getOptions();
+ $this->pbs2host = $this->config['pbs2']['host'];
+ }
- public function indexAction()
- {
+ public function indexAction()
+ {
- }
+ }
}
diff --git a/application/controllers/PersonController.php b/application/controllers/PersonController.php
index 30bada3..f701a8e 100644
--- a/application/controllers/PersonController.php
+++ b/application/controllers/PersonController.php
@@ -17,10 +17,14 @@ class PersonController extends Zend_Controller_Action
protected $currentMembership = null;
protected $memberships = null;
protected $userIDsNamespace = null;
+ protected $config;
+ protected $pbs2host;
public function init()
{
if (Zend_Auth::getInstance()->hasIdentity()) {
+ $this->config = $bootstrap->getOptions();
+ $this->pbs2host = $this->config['pbs2']['host'];
$this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
if(is_array($this->userIDsNamespace)) {
$membershipID = $this->userIDsNamespace['membershipID'];
diff --git a/application/layouts/default.phtml b/application/layouts/default.phtml
index a4cd82f..b948b8d 100644
--- a/application/layouts/default.phtml
+++ b/application/layouts/default.phtml
@@ -16,7 +16,6 @@ echo $this->headScript()."\n";
<script type="text/javascript"
src='/media/js/jquery-ui-timepicker-addon.js'></script>
<script type="text/javascript" src='/media/js/script.js'></script>
-<script type="text/javascript" src='/media/js/user.js'></script>
<!-- files for calendar -->
<script type='text/javascript' src='/media/js/jquery-1.5.2.min.js'></script>