summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-04 17:03:55 +0200
committerBjörn Geiger2011-08-04 17:03:55 +0200
commit32e528e1363302ea562fb1fce1cbc5320baeac7c (patch)
tree2742f415de4e913e921f409546725c49792ac370 /application
parentminor (diff)
downloadpoolctrl-32e528e1363302ea562fb1fce1cbc5320baeac7c.tar.gz
poolctrl-32e528e1363302ea562fb1fce1cbc5320baeac7c.tar.xz
poolctrl-32e528e1363302ea562fb1fce1cbc5320baeac7c.zip
minor
Diffstat (limited to 'application')
-rw-r--r--application/controllers/PersonController.php50
1 files changed, 24 insertions, 26 deletions
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');