summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Geiger2011-07-05 13:37:21 +0200
committerBjörn Geiger2011-07-05 13:37:21 +0200
commite3a7fe443a2cb561116ac254fa3462b90a1a29e5 (patch)
treec8d43aedaa14c0d3d46976891c98ae3a0805b941
parentlogin formular (diff)
downloadpoolctrl-e3a7fe443a2cb561116ac254fa3462b90a1a29e5.tar.gz
poolctrl-e3a7fe443a2cb561116ac254fa3462b90a1a29e5.tar.xz
poolctrl-e3a7fe443a2cb561116ac254fa3462b90a1a29e5.zip
Apikey im Eventcontroller wird nun aus der Session genommen
-rw-r--r--application/configs/application.ini.dist1
-rw-r--r--application/controllers/EventController.php26
-rw-r--r--application/layouts/default.phtml2
3 files changed, 15 insertions, 14 deletions
diff --git a/application/configs/application.ini.dist b/application/configs/application.ini.dist
index dec2a7d..bd19e51 100644
--- a/application/configs/application.ini.dist
+++ b/application/configs/application.ini.dist
@@ -16,7 +16,6 @@ resources.db.isDefaultTableAdapter = true
resources.view[] = ""
resources.modules = ""
pbs2.host =
-pbs2.apikey =
pbs2.getbootoss = /resource/getbootos/apikey/
pbs2.getpools = /resource/getpool/apikey/
pbs2.addbootmenu = /resource/addbootmenu/apikey/
diff --git a/application/controllers/EventController.php b/application/controllers/EventController.php
index 6925403..88d8441 100644
--- a/application/controllers/EventController.php
+++ b/application/controllers/EventController.php
@@ -18,6 +18,7 @@ class EventController extends Zend_Controller_Action
protected $personMapper;
protected $config;
protected $pbs2host;
+ protected $userIDsNamespace;
public function init()
{
@@ -28,13 +29,14 @@ class EventController extends Zend_Controller_Action
$bootstrap = $this->getInvokeArg('bootstrap');
$this->config = $bootstrap->getOptions();
$this->pbs2host = $this->config['pbs2']['host'];
+ $this->userIDsNamespace = Zend_Session::namespaceGet('userIDs');
}
public function indexAction()
{
$events = $this->eventMapper->fetchAll();
if(is_array($events)) {
- $bootOsApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getbootoss'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
+ $bootOsApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getbootoss'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
$bootOsXMLString = $bootOsApiResult['http-body'];
$bootOsXML = new SimpleXMLElement($bootOsXMLString);
foreach($bootOsXML->bootoslist->bootos as $bootos) {
@@ -55,7 +57,7 @@ class EventController extends Zend_Controller_Action
$bootosobj->setTitle(sprintf("%s", $bootos->title));
$bootoslist[$bootosobj->getID()] = $bootosobj;
}
- $poolApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getpools'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
+ $poolApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getpools'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
$poolXMLString = $poolApiResult['http-body'];
$poolXML = new SimpleXMLElement($poolXMLString);
foreach($poolXML->poollist->pool as $pool) {
@@ -90,7 +92,7 @@ class EventController extends Zend_Controller_Action
public function addAction()
{
$eventcategorylist = $this->eventcategoryMapper->fetchAll();
- $bootOsApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getbootoss'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
+ $bootOsApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getbootoss'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
$bootOsXMLString = $bootOsApiResult['http-body'];
$bootOsXML = new SimpleXMLElement($bootOsXMLString);
foreach($bootOsXML->bootoslist->bootos as $bootos) {
@@ -111,7 +113,7 @@ class EventController extends Zend_Controller_Action
$bootosobj->setTitle(sprintf("%s", $bootos->title));
$bootoslist[$bootosobj->getID()] = $bootosobj;
}
- $poolApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getpools'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
+ $poolApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getpools'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
$poolXMLString = $poolApiResult['http-body'];
$poolXML = new SimpleXMLElement($poolXMLString);
foreach($poolXML->poollist->pool as $pool) {
@@ -134,7 +136,7 @@ class EventController extends Zend_Controller_Action
$event = new Application_Model_Event($this->getRequest()->getParams());
$event->setPbs_membershipID(1);
$bootmenuquery = "bootosID=" . $event->getPbs_bootosID() . "&startcounter=0&title=" . $event->getTitle() . "&defaultbootmenu=1&order=0&kcl=0";
- $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['addbootmenu'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootmenuquery);
+ $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['addbootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootmenuquery);
$bootmenuXMLString = $bootmenuApiResult['http-body'];
$bootmenuXML = new SimpleXMLElement($bootmenuXMLString);
$bootmenuID = sprintf("%s", $bootmenuXML->bootmenuid);
@@ -163,10 +165,10 @@ class EventController extends Zend_Controller_Action
if(isset($eventID)) {
$event = new Application_Model_Event();
if($event->getPbs_bootmenuID()) {
- $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletebootmenu'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $event->getPbs_bootmenuID());
+ $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletebootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $event->getPbs_bootmenuID());
}
if($event->getPbs_filterID()) {
- $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletefilter'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $event->getPbs_filterID());
+ $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletefilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $event->getPbs_filterID());
}
$this->eventMapper->find($eventID, $event);
try {
@@ -187,7 +189,7 @@ class EventController extends Zend_Controller_Action
public function editAction()
{
$eventcategorylist = $this->eventcategoryMapper->fetchAll();
- $bootOsApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getbootoss'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
+ $bootOsApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getbootoss'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
$bootOsXMLString = $bootOsApiResult['http-body'];
$bootOsXML = new SimpleXMLElement($bootOsXMLString);
foreach($bootOsXML->bootoslist->bootos as $bootos) {
@@ -208,7 +210,7 @@ class EventController extends Zend_Controller_Action
$bootosobj->setTitle(sprintf("%s", $bootos->title));
$bootoslist[$bootosobj->getID()] = $bootosobj;
}
- $poolApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getpools'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
+ $poolApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getpools'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', '');
$poolXMLString = $poolApiResult['http-body'];
$poolXML = new SimpleXMLElement($poolXMLString);
foreach($poolXML->poollist->pool as $pool) {
@@ -234,17 +236,17 @@ class EventController extends Zend_Controller_Action
$event = new Application_Model_Event();
$this->eventMapper->find($eventID, $event);
if($event->getPbs_bootmenuID()) {
- $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletebootmenu'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $event->getPbs_bootmenuID());
+ $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletebootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $event->getPbs_bootmenuID());
unset($bootmenuApiResult);
}
if($event->getPbs_filterID()) {
- $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletefilter'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $event->getPbs_filterID());
+ $filterApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['deletefilter'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', "bootmenuid=" . $event->getPbs_filterID());
unset($filterApiResult);
}
$event->setOptions($this->getRequest()->getParams());
$event->setID($eventID);
$bootmenuquery = "bootosID=" . $event->getPbs_bootosID() . "&startcounter=0&title=" . $event->getTitle() . "&defaultbootmenu=1&order=0&kcl=0";
- $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['addbootmenu'] . $this->config['pbs2']['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootmenuquery);
+ $bootmenuApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['addbootmenu'] . $this->userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $bootmenuquery);
$bootmenuXMLString = $bootmenuApiResult['http-body'];
$bootmenuXML = new SimpleXMLElement($bootmenuXMLString);
$bootmenuID = sprintf("%s", $bootmenuXML->bootmenuid);
diff --git a/application/layouts/default.phtml b/application/layouts/default.phtml
index 08c4116..550ce8a 100644
--- a/application/layouts/default.phtml
+++ b/application/layouts/default.phtml
@@ -27,7 +27,7 @@ echo $this->headScript()."\n";
<li class='navTreeItem'><a href='/event'>Event</a></li>
<?php }
if(Zend_Auth::getInstance()->hasIdentity()) { ?>
- <li class='navTreeItem'><a href='/person/'>Person</a></li>
+ <li class='navTreeItem'><a href='/person/'>Own Details</a></li>
<?php if(count(Zend_Session::namespaceGet('userIDs')) > 0) { ?>
<li class='navTreeItem'><a href='/person/changemembership'>Change Membership</a></li>
<?php } else { ?>