summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-08 17:28:22 +0200
committerBjörn Geiger2011-08-08 17:28:22 +0200
commitc1c47b2010a2e3453139501dfa4accf48bb6a92c (patch)
tree16657ccd1e93dbae8e9c77c9399c4613cd99e1af /application
parentkleine änderungen (diff)
downloadpoolctrl-c1c47b2010a2e3453139501dfa4accf48bb6a92c.tar.gz
poolctrl-c1c47b2010a2e3453139501dfa4accf48bb6a92c.tar.xz
poolctrl-c1c47b2010a2e3453139501dfa4accf48bb6a92c.zip
ACL hinzugefügt
Diffstat (limited to 'application')
-rw-r--r--application/controllers/AuthController.php10
-rw-r--r--application/controllers/ErrorController.php8
-rw-r--r--application/controllers/EventController.php4
-rw-r--r--application/controllers/GearmanController.php6
-rw-r--r--application/controllers/IndexController.php6
-rw-r--r--application/controllers/PersonController.php4
6 files changed, 34 insertions, 4 deletions
diff --git a/application/controllers/AuthController.php b/application/controllers/AuthController.php
index cd3c34d..0ba5027 100644
--- a/application/controllers/AuthController.php
+++ b/application/controllers/AuthController.php
@@ -12,14 +12,20 @@
class AuthController extends Zend_Controller_Action
{
- protected $config;
- protected $pbs2host;
+ protected $config = null;
+ protected $pbs2host = null;
+ protected $userIDsNamespace = null;
+ protected $acl = null;
public function init()
{
$bootstrap = $this->getInvokeArg('bootstrap');
$this->config = $bootstrap->getOptions();
$this->pbs2host = $this->config['pbs2']['host'];
+ $this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+ if(isset($this->userIDsNamespace['apikey'])) {
+ $this->acl = new Poolctrl_Acl($this->pbs2host, $this->config['pbs2']['checkright'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ }
}
public function indexAction()
diff --git a/application/controllers/ErrorController.php b/application/controllers/ErrorController.php
index 3866450..49ecdcf 100644
--- a/application/controllers/ErrorController.php
+++ b/application/controllers/ErrorController.php
@@ -4,13 +4,19 @@ class ErrorController extends Zend_Controller_Action
{
protected $config;
protected $pbs2host;
+ protected $userIDsNamespace;
+ protected $acl;
public function errorAction()
{
$bootstrap = $this->getInvokeArg('bootstrap');
$this->config = $bootstrap->getOptions();
$this->pbs2host = $this->config['pbs2']['host'];
-
+ $this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+ if(isset($this->userIDsNamespace['apikey'])) {
+ $this->acl = new Poolctrl_Acl($this->pbs2host, $this->config['pbs2']['checkright'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ }
+
$errors = $this->_getParam('error_handler');
if (!$errors || !$errors instanceof ArrayObject) {
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index b30f671..1fd1d9c 100644
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -17,6 +17,7 @@ class EventController extends Zend_Controller_Action
protected $config;
protected $pbs2host;
protected $userIDsNamespace;
+ protected $acl;
public function init()
{
@@ -25,6 +26,9 @@ class EventController extends Zend_Controller_Action
$this->config = $bootstrap->getOptions();
$this->pbs2host = $this->config['pbs2']['host'];
$this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+ if(isset($this->userIDsNamespace['apikey'])) {
+ $this->acl = new Poolctrl_Acl($this->pbs2host, $this->config['pbs2']['checkright'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ }
if($this->userIDsNamespace['membershipID'] !='') {
$this->eventMapper = new Application_Model_EventMapper();
$this->eventcategoryMapper = new Application_Model_EventcategoryMapper();
diff --git a/application/controllers/GearmanController.php b/application/controllers/GearmanController.php
index dcad3dc..608e88c 100644
--- a/application/controllers/GearmanController.php
+++ b/application/controllers/GearmanController.php
@@ -5,15 +5,19 @@ class GearmanController extends Zend_Controller_Action
protected $gearmanClient;
protected $config;
protected $pbs2host;
+ protected $userIDsNamespace;
+ protected $acl;
public function init()
{
-
if (Zend_Auth::getInstance()->hasIdentity()) {
$bootstrap = $this->getInvokeArg('bootstrap');
$this->config = $bootstrap->getOptions();
$this->pbs2host = $this->config['pbs2']['host'];
$this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+ if(isset($this->userIDsNamespace['apikey'])) {
+ $this->acl = new Poolctrl_Acl($this->pbs2host, $this->config['pbs2']['checkright'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ }
$this->gearmanClient = new GearmanClient();
$this->gearmanClient->addServer('127.0.0.1');
} else {
diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php
index 0099301..65757c1 100644
--- a/application/controllers/IndexController.php
+++ b/application/controllers/IndexController.php
@@ -4,12 +4,18 @@ class IndexController extends Zend_Controller_Action
{
protected $config;
protected $pbs2host;
+ protected $userNamespace;
+ protected $acl;
public function init()
{
$bootstrap = $this->getInvokeArg('bootstrap');
$this->config = $bootstrap->getOptions();
$this->pbs2host = $this->config['pbs2']['host'];
+ $this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+ if(isset($this->userIDsNamespace['apikey'])) {
+ $this->acl = new Poolctrl_Acl($this->pbs2host, $this->config['pbs2']['checkright'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ }
}
public function indexAction()
diff --git a/application/controllers/PersonController.php b/application/controllers/PersonController.php
index 40ef456..b38f454 100644
--- a/application/controllers/PersonController.php
+++ b/application/controllers/PersonController.php
@@ -19,6 +19,7 @@ class PersonController extends Zend_Controller_Action
protected $userIDsNamespace = null;
protected $config;
protected $pbs2host;
+ protected $acl;
public function init()
{
@@ -27,6 +28,9 @@ class PersonController extends Zend_Controller_Action
$this->config = $bootstrap->getOptions();
$this->pbs2host = $this->config['pbs2']['host'];
$this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
+ if(isset($this->userIDsNamespace['apikey'])) {
+ $this->acl = new Poolctrl_Acl($this->pbs2host, $this->config['pbs2']['checkright'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ }
foreach(Zend_Session::namespaceGet('persons') as $person) {
if($person->getID() == $this->userIDsNamespace['personID']) {
$this->person = $person;