summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
authorBjörn Geiger2011-08-05 12:15:51 +0200
committerBjörn Geiger2011-08-05 12:15:51 +0200
commit2ad7dcd8251dcd1ec99f0f6c998dfb5423e36d6f (patch)
treeeb0c0125242fe7d69fc406514c1155255d9183a7 /application/controllers
parentFehler korrigiert (diff)
downloadpoolctrl-2ad7dcd8251dcd1ec99f0f6c998dfb5423e36d6f.tar.gz
poolctrl-2ad7dcd8251dcd1ec99f0f6c998dfb5423e36d6f.tar.xz
poolctrl-2ad7dcd8251dcd1ec99f0f6c998dfb5423e36d6f.zip
verschiedene Fehler korrigiert
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/IndexController.php3
-rw-r--r--application/controllers/PersonController.php12
2 files changed, 6 insertions, 9 deletions
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('/');