From 2ad7dcd8251dcd1ec99f0f6c998dfb5423e36d6f Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Fri, 5 Aug 2011 12:15:51 +0200 Subject: verschiedene Fehler korrigiert --- application/controllers/IndexController.php | 3 +-- application/controllers/PersonController.php | 12 +++++------- application/layouts/default.phtml | 8 ++++---- application/views/scripts/event/index.phtml | 10 +++++----- 4 files changed, 15 insertions(+), 18 deletions(-) (limited to 'application') diff --git a/application/controllers/IndexController.php b/application/controllers/IndexController.php index f04aad4..0099301 100644 --- a/application/controllers/IndexController.php +++ b/application/controllers/IndexController.php @@ -18,5 +18,4 @@ class IndexController extends Zend_Controller_Action } -} - +} \ No newline at end of file diff --git a/application/controllers/PersonController.php b/application/controllers/PersonController.php index c2f6422..792bb8f 100644 --- a/application/controllers/PersonController.php +++ b/application/controllers/PersonController.php @@ -27,16 +27,17 @@ class PersonController extends Zend_Controller_Action $this->config = $bootstrap->getOptions(); $this->pbs2host = $this->config['pbs2']['host']; $this->userIDsNamespace = Zend_Session::namespaceGet('userIDs'); + $this->membershipMapper = new Application_Model_MembershipMapper(); + $this->currentMembership = new Application_Model_Membership(); + $this->person = new Application_Model_Person(); + $this->memberships = Zend_Session::namespaceGet('memberships'); if(count($this->userIDsNamespace)) { $membershipID = $this->userIDsNamespace['membershipID']; - $this->currentMembership = new Application_Model_Membership(); - $this->membershipMapper = new Application_Model_MembershipMapper(); $this->membershipMapper->find($membershipID, $this->currentMembership); $personApiResult = PostToHost($this->pbs2host, $this->config['pbs2']['getperson'] . $this->currentMembership->getApikey(), 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', ''); $personXMLString = $personApiResult['http-body']; if(strlen($personXMLString) > 0) { $personXML = new SimpleXMLElement($personXMLString); - $this->person = new Application_Model_Person(); $this->person->setID(sprintf("%s", $personXML->person->id)); $this->person->setCity(sprintf("%s", $personXML->person->city)); $this->person->setEmail(sprintf("%s", $personXML->person->email)); @@ -53,9 +54,6 @@ class PersonController extends Zend_Controller_Action } } - $this->memberships = Zend_Session::namespaceGet('memberships'); - $this->view->apikeys = array(); - if(isset($this->memberships)) { foreach($this->memberships as $membership) { $grouprequest = "groupid=" . $membership['groupID']; @@ -109,8 +107,8 @@ class PersonController extends Zend_Controller_Action if(isset($_POST['selectmembership'])) { $userSession = new Zend_Session_Namespace('userIDs'); $userSession->membershipID = $_POST['membershipID']; - $userSession->personID = $this->person->getID(); $membership = $this->membershipMapper->find($_POST['membershipID']); + $userSession->personID = $membership->getPersonID(); $userSession->groupID = $membership->getGroupID(); $userSession->apikey = $membership->getApikey(); $this->_redirect('/'); diff --git a/application/layouts/default.phtml b/application/layouts/default.phtml index f9de7ca..1932d5b 100644 --- a/application/layouts/default.phtml +++ b/application/layouts/default.phtml @@ -1,7 +1,7 @@ getParam('bootstrap'); $config = $bootstrap->getOptions(); -$pbs2host = $this->config['pbs2']['host']; +$pbs2host = $config['pbs2']['host']; ?> doctype(); ?> @@ -65,7 +65,7 @@ echo $this->headScript()."\n";
hasIdentity()){ - echo 'Logged in as'; + echo 'Logged in as '; $userIDsNamespace = Zend_Session::namespaceGet('userIDs'); if(isset($userIDsNamespace['membershipID'])){ @@ -97,8 +97,8 @@ if(Zend_Auth::getInstance()->hasIdentity()){ } if(isset($userIDsNamespace['groupID'])){ echo " in group "; - $grouprequest = "groupid=" . $membership['groupID']; - $groupApiResult = PostToHost($pbs2host, $config['pbs2']['getgroup'] . $membership['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $grouprequest); + $grouprequest = "groupid=" . $userIDsNamespace['groupID']; + $groupApiResult = PostToHost($pbs2host, $config['pbs2']['getgroup'] . $userIDsNamespace['apikey'], 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 'poolctrl', $grouprequest); $groupXMLString = $groupApiResult['http-body']; if(strlen($groupXMLString) > 0) { $groupXML = new SimpleXMLElement($groupXMLString); diff --git a/application/views/scripts/event/index.phtml b/application/views/scripts/event/index.phtml index 38fec17..aa090de 100644 --- a/application/views/scripts/event/index.phtml +++ b/application/views/scripts/event/index.phtml @@ -95,13 +95,13 @@ if(count($this->eventlist)>0) { ?> poollist as $pool): - $poolEvents = $this->eventlist[$pool->getID()]; ?> -