From 32e528e1363302ea562fb1fce1cbc5320baeac7c Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Thu, 4 Aug 2011 17:03:55 +0200 Subject: minor --- application/controllers/PersonController.php | 50 +++++++++++++--------------- 1 file changed, 24 insertions(+), 26 deletions(-) (limited to 'application') diff --git a/application/controllers/PersonController.php b/application/controllers/PersonController.php index 76a4abb..30bada3 100644 --- a/application/controllers/PersonController.php +++ b/application/controllers/PersonController.php @@ -22,32 +22,30 @@ class PersonController extends Zend_Controller_Action { if (Zend_Auth::getInstance()->hasIdentity()) { $this->userIDsNamespace = Zend_Session::namespaceGet('userIDs'); - if(!is_array($this->userIDsNamespace)) { - $this->_helper->redirector('selectmembership', 'person'); - return; - } - $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)); - $this->person->setFirstname(sprintf("%s", $personXML->person->firstname)); - $this->person->setHousenumber(sprintf("%s", $personXML->person->housenumber)); - $this->person->setLogin(sprintf("%s", $personXML->person->login)); - $this->person->setLogindate(sprintf("%s", $personXML->person->logindate)); - $this->person->setName(sprintf("%s", $personXML->person->name)); - $this->person->setPostalcode(sprintf("%s", $personXML->person->postalcode)); - $this->person->setRegisterdate(sprintf("%s", $personXML->person->registerdate)); - $this->person->setStreet(sprintf("%s", $personXML->person->street)); - $this->person->setSuspend(sprintf("%s", $personXML->person->suspend)); - $this->person->setTitle(sprintf("%s", $personXML->person->title)); + if(is_array($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)); + $this->person->setFirstname(sprintf("%s", $personXML->person->firstname)); + $this->person->setHousenumber(sprintf("%s", $personXML->person->housenumber)); + $this->person->setLogin(sprintf("%s", $personXML->person->login)); + $this->person->setLogindate(sprintf("%s", $personXML->person->logindate)); + $this->person->setName(sprintf("%s", $personXML->person->name)); + $this->person->setPostalcode(sprintf("%s", $personXML->person->postalcode)); + $this->person->setRegisterdate(sprintf("%s", $personXML->person->registerdate)); + $this->person->setStreet(sprintf("%s", $personXML->person->street)); + $this->person->setSuspend(sprintf("%s", $personXML->person->suspend)); + $this->person->setTitle(sprintf("%s", $personXML->person->title)); + } } $this->memberships = Zend_Session::namespaceGet('memberships'); -- cgit v1.2.3-55-g7522