summaryrefslogtreecommitdiffstats
path: root/application/modules/ipxe/controllers/IndexController.php
diff options
context:
space:
mode:
Diffstat (limited to 'application/modules/ipxe/controllers/IndexController.php')
-rw-r--r--application/modules/ipxe/controllers/IndexController.php118
1 files changed, 46 insertions, 72 deletions
diff --git a/application/modules/ipxe/controllers/IndexController.php b/application/modules/ipxe/controllers/IndexController.php
index ad24551..e1211c6 100644
--- a/application/modules/ipxe/controllers/IndexController.php
+++ b/application/modules/ipxe/controllers/IndexController.php
@@ -18,12 +18,7 @@ class Ipxe_IndexController extends Zend_Controller_Action
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
- /* Initialize action controller here */
- $userIDsNamespace = Zend_Session::namespaceGet('userIDs');
- $membershipMapper = new Application_Model_MembershipMapper();
- $this->membership = new Application_Model_Membership();
- $membershipMapper->find($userIDsNamespace['membershipID'],$this->membership);
}
public function errorAction()
@@ -31,7 +26,7 @@ class Ipxe_IndexController extends Zend_Controller_Action
$result = $this->_request->getParam('serialresult');
if($result != ""){
$pbsNotifier = new Pbs_Notifier();
- $this->view->notification = $pbsNotifier->notify('serial',$result);
+ echo $pbsNotifier->notify('serial',$result);
}
}
@@ -42,14 +37,9 @@ class Ipxe_IndexController extends Zend_Controller_Action
if(count($mySession->postdata)<=0){
$mySession->postdata = $_POST;
}
-
- $result = $this->_request->getParam('notify');
- if($result == 'nomember'){
- //fehler
- }
- $d = new Pbs_Debug();
- $d->debug(array('IpxeIndexController',$_SERVER['REMOTE_ADDR'],implode("\t",$mySession->postdata)));
+// $d = new Pbs_Debug();
+// $d->debug(array('IpxeIndexController',$_SERVER['REMOTE_ADDR'],implode("\t",$mySession->postdata)));
if(isset($mySession->postdata['serialnumber'])){
// Create a session
@@ -60,7 +50,7 @@ class Ipxe_IndexController extends Zend_Controller_Action
$results = $bootisomapper->findBy(array('serialnumber' => $mySession->postdata['serialnumber']),true);
if(count($results) == 0){
- $this->_redirect('/fbgui/index/error/serialresult/noserial2');
+ $this->_redirect('/ipxe/index/error/serialresult/noserial2');
}
$bootiso->setOptions($results[0]);
$bootiso->setID($results[0]['bootisoID']);
@@ -70,7 +60,6 @@ class Ipxe_IndexController extends Zend_Controller_Action
$client = new Application_Model_Client();
$client->setMacadress($mySession->postdata['mac']);
- $client->setHardwarehash($mySession->postdata['hardwarehash']);
$client->setGroupID($groupID);
$client->setCreated(time());
$client = $n->createClient($client);
@@ -95,69 +84,54 @@ class Ipxe_IndexController extends Zend_Controller_Action
$sessionMapper = new Application_Model_SessionMapper();
$sessions = $sessionMapper->findBy(array('alphasessionID'=>$_SESSION['alphasessionID']));
$session = $sessions[0];
- if($this->membership->getID() != '' && $session->getMembershipID() == ''){
- $session->setMembershipID($this->membership->getID());
- $sessionMapper->save($session);
- }
- }
- // Request Bootmenu
- $pbsFilter = new Pbs_Filter();
- $bootmenuID = $pbsFilter->evaluate();
- if($bootmenuID != null){
- $this->view->alphasessionID = $_SESSION['alphasessionID'];
- // print_a('Debug Output',
- // 'Session is now set',
- // 'Your sessionID is '.$session->getID(),
- // 'Your alphasessionID is '.$session->getAlphasessionID(),
- // 'Your client is '.$session->getClientID(),
- // 'goto bootmenu '.$bootmenuID);
-
- $bootmenuMapper = new Application_Model_BootMenuMapper();
- $bm = $bootmenuMapper->find($bootmenuID);
- $this->view->title = $bm->getTitle();
- $this->view->startcounter = $bm->getStartcounter();
-
- $bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper();
- $res = $bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID),false);
- $this->view->entries = $res;
-
- if (!Zend_Auth::getInstance()->hasIdentity()) {
- $this->view->loginmenu = true;
- }
-
- if(Zend_Auth::getInstance()->hasIdentity()){
- if($bm->MembershipID != '' && $bm->MembershipID == $this->membership->getID()){}
- else{
- $pbsNotifier = new Pbs_Notifier();
- $this->view->notification = $pbsNotifier->notify("This is not your Bootmenu. There is currently a BootMenu with a higher priority active.",'info');
- }
- }
- }
- else{
- // print_a('Debug Output',
- // 'Session is now set',
- // 'Your sessionID is '.$session->getID(),
- // 'Your alphasessionID is '.$session->getAlphasessionID(),
- // 'Your client is '.$session->getClientID(),
- // 'there is no bootmenu for you');
- if (!Zend_Auth::getInstance()->hasIdentity()) {
- $this->view->loginmenu = true;
- $pbsNotifier = new Pbs_Notifier();
- $this->view->notification = $pbsNotifier->notify("There is no default BootMenu, please Login to get your BootMenu.",'info');
- }
- else{
- $pbsNotifier = new Pbs_Notifier();
- $this->view->notification = $pbsNotifier->notify("You have no BootMenu.",'info');
- }
- $this->view->nobootmenu = true;
}
+// // Request Bootmenu
+// $pbsFilter = new Pbs_Filter();
+// $bootmenuID = $pbsFilter->evaluate();
+// if($bootmenuID != null){
+// $this->view->alphasessionID = $_SESSION['alphasessionID'];
+// // print_a('Debug Output',
+// // 'Session is now set',
+// // 'Your sessionID is '.$session->getID(),
+// // 'Your alphasessionID is '.$session->getAlphasessionID(),
+// // 'Your client is '.$session->getClientID(),
+// // 'goto bootmenu '.$bootmenuID);
+//
+// $bootmenuMapper = new Application_Model_BootMenuMapper();
+// $bm = $bootmenuMapper->find($bootmenuID);
+// $this->view->title = $bm->getTitle();
+// $this->view->startcounter = $bm->getStartcounter();
+//
+// $bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper();
+// $res = $bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID),false);
+// $this->view->entries = $res;
+//
+// }
+// else{
+// // print_a('Debug Output',
+// // 'Session is now set',
+// // 'Your sessionID is '.$session->getID(),
+// // 'Your alphasessionID is '.$session->getAlphasessionID(),
+// // 'Your client is '.$session->getClientID(),
+// // 'there is no bootmenu for you');
+// if (!Zend_Auth::getInstance()->hasIdentity()) {
+// $this->view->loginmenu = true;
+// $pbsNotifier = new Pbs_Notifier();
+// $this->view->notification = $pbsNotifier->notify("There is no default BootMenu, please Login to get your BootMenu.",'info');
+// }
+// else{
+// $pbsNotifier = new Pbs_Notifier();
+// $this->view->notification = $pbsNotifier->notify("You have no BootMenu.",'info');
+// }
+// $this->view->nobootmenu = true;
+// }
}
else{
- #$this->_redirect('/fbgui/index/error/serialresult/noserial');
+ $this->_redirect('/ipxe/index/error/serialresult/noserial');
}
}
- public function startAction(){
+ public function startAction(){
$bootmenuntryID = $this->_request->getParam('bme');
$a = $_SESSION['alphasessionID'];
$bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper();