summaryrefslogtreecommitdiffstats
path: root/application/controllers/GearmanController.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers/GearmanController.php')
-rw-r--r--application/controllers/GearmanController.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/application/controllers/GearmanController.php b/application/controllers/GearmanController.php
index e959c42..b4b8f6c 100644
--- a/application/controllers/GearmanController.php
+++ b/application/controllers/GearmanController.php
@@ -14,13 +14,17 @@ class GearmanController extends Zend_Controller_Action
public function init()
{
- /*if (Zend_Auth::getInstance()->hasIdentity()) {
+ 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->acl = new Poolctrl_Acl($this->pbs2host, $this->config['pbs2']['checkright'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
+ }
+ if(!$this->acl->checkRight('er')) {
+ header('HTTP/1.0 403 No Right to run events');
+ die();
}
$this->gearmanServerPort = $this->config['gearman']['server']['port'];
$this->gearmanServerHost = $this->config['gearman']['server']['host'];
@@ -28,11 +32,10 @@ class GearmanController extends Zend_Controller_Action
$this->gearmanWorkerUpdateRate = $this->config['gearman']['worker']['updateRate'];
$this->gearmanClient = new GearmanClient();
$this->gearmanClient->addServer($this->gearmanServerHost);
- } else {
+ } else {
$this->_helper->redirector('login', 'auth');
return;
- }*/
- $this->_redirect('/');
+ }
}
public function indexAction()