summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/ResourceController.php28
-rw-r--r--application/controllers/SessionController.php18
2 files changed, 20 insertions, 26 deletions
diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php
index fe564fc..aef8649 100644
--- a/application/controllers/ResourceController.php
+++ b/application/controllers/ResourceController.php
@@ -3,8 +3,6 @@
class ResourceController extends Zend_Controller_Action
{
- private $startval = 878923467;
- private $pass = array('lsfks_!$fks', 'un!fr€iburg', '0pen$lx_rulez', 'rand0mText');
public function init()
{
@@ -20,12 +18,8 @@ class ResourceController extends Zend_Controller_Action
public function getinitramfsAction()
{
$this->_helper->layout->disableLayout();
- $this->_helper->viewRenderer->setNoRender();
- /*
- $bootosID = $this->_request->getParam('bootosID');
- $bootosID = $this->alphaID($bootosID, true, false, $this->pass[0]);
- $bootosID -= $this->startval;
- */
+ $this->_helper->viewRenderer->setNoRender();
+
$alphasessionID = $this->_request->getParam('alpha');
$session = new Application_Model_Session();
$sm = new Application_Model_SessionMapper();
@@ -53,11 +47,7 @@ class ResourceController extends Zend_Controller_Action
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
- /*
- $configID = $this->_request->getParam('configID');
- $configID = $this->alphaID($configID, true, false, $this->pass[1]);
- $configID -= $this->startval;
- */
+
$alphasessionID = $this->_request->getParam('alpha');
$session = new Application_Model_Session();
$sm = new Application_Model_SessionMapper();
@@ -89,11 +79,7 @@ class ResourceController extends Zend_Controller_Action
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
- /*
- $bootosID = $this->_request->getParam('bootosID');
- $bootosID = $this->alphaID($bootosID, true, false, $this->pass[2]);
- $bootosID -= $this->startval;
- */
+
$alphasessionID = $this->_request->getParam('alpha');
$session = new Application_Model_Session();
$sm = new Application_Model_SessionMapper();
@@ -121,11 +107,7 @@ class ResourceController extends Zend_Controller_Action
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
- /*
- $bmeID = $this->_request->getParam('bootmenuentryID');
- $bmeID = $this->alphaID($bmeID, true, false, $this->pass[3]);
- $bmeID -= $this->startval;
- */
+
$alphasessionID = $this->_request->getParam('alpha');
$session = new Application_Model_Session();
$sm = new Application_Model_SessionMapper();
diff --git a/application/controllers/SessionController.php b/application/controllers/SessionController.php
index bf318a0..ddb6fac 100644
--- a/application/controllers/SessionController.php
+++ b/application/controllers/SessionController.php
@@ -35,9 +35,12 @@ class SessionController extends Zend_Controller_Action
$bmem = new Application_Model_BootMenuEntriesMapper();
$bootmenuentries = $bmem->fetchAll();
+ $mm = new Application_Model_MembershipMapper();
+ $memberships = $mm->fetchAll();
+
if (!isset($_POST["add"])){
- $createsession = new Application_Form_Session(array('buttontext' => 'Create Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos));
+ $createsession = new Application_Form_Session(array('buttontext' => 'Create Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos,'memberships'=>$memberships));
$this->view->createsession = $createsession;
}else {
// TODO extend with normal function not only with post
@@ -67,6 +70,9 @@ class SessionController extends Zend_Controller_Action
if($session->getBootmenuentryID() == ''){
$session->setBootmenuentryID(null);
}
+ if($session->getMembershipID() == ''){
+ $session->setMembershipID(null);
+ }
$sessionmapper = new Application_Model_SessionMapper();
$sessionmapper->save($session);
@@ -93,6 +99,9 @@ class SessionController extends Zend_Controller_Action
$bmem = new Application_Model_BootMenuEntriesMapper();
$bootmenuentries = $bmem->fetchAll();
+
+ $mm = new Application_Model_MembershipMapper();
+ $memberships = $mm->fetchAll();
if (!isset($_POST["add"])){
// TODO: ACL implementieren ob er editieren darf
@@ -106,7 +115,7 @@ class SessionController extends Zend_Controller_Action
$session2 = $session->toArray();
#print_a($session2);
- $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos));
+ $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos,'memberships'=>$memberships));
$editsession->populate($session2);
$this->view->editsession = $editsession;
}catch (Zend_Exception $e) {
@@ -117,7 +126,7 @@ class SessionController extends Zend_Controller_Action
try{
$sessionID = $this->_request->getParam('sessionID');
- $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos),$_POST);
+ $editsession = new Application_Form_Session(array('buttontext' => 'Edit Session','bootmenuentries'=>$bootmenuentries,'clients'=>$clients,'bootos'=>$bootos,'bootisos'=>$bootisos,'memberships'=>$memberships),$_POST);
if ($editsession->isValid($_POST)) {
$session = new Application_Model_Session($_POST);
@@ -132,6 +141,9 @@ class SessionController extends Zend_Controller_Action
if($session->getBootmenuentryID() == ''){
$session->setBootmenuentryID(null);
}
+ if($session->getMembershipID() == ''){
+ $session->setMembershipID(null);
+ }
$sessionmapper = new Application_Model_SessionMapper();
$sessionmapper->save($session);
echo 'valid';