diff options
Diffstat (limited to 'application/modules/fbgui/controllers/IndexController.php')
| -rw-r--r-- | application/modules/fbgui/controllers/IndexController.php | 54 |
1 files changed, 45 insertions, 9 deletions
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index f5f8cdf..6c4a542 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -10,7 +10,10 @@ class Fbgui_IndexController extends Zend_Controller_Action public function indexAction() { - + if(isset($_SESSION['postdata'])){ + $_POST = ($_SESSION['postdata']); + unset($_SESSION['postdata']); + } $keys = $this->_request->getParam('keys'); $post = $this->_request->getParam('post'); if($post != '' && $keys != ''){ @@ -25,8 +28,17 @@ class Fbgui_IndexController extends Zend_Controller_Action $bootisomapper = new Application_Model_BootIsoMapper(); $bootiso = new Application_Model_BootIso(); - $bootisomapper->find($_POST['bootisoID'],$bootiso); - $groupID = $bootiso->getGroupID(); + if(isset($_POST['bootisoID'])){ + $bootisomapper->find($_POST['bootisoID'],$bootiso); + $groupID = $bootiso->getGroupID(); + } + elseif(isset($_POST['serialnumber'])){ + $results = $bootisomapper->findBy('serialnumber',$_POST['serialnumber']); + $bootiso->setOptions($results[0]); + $bootiso->setID($result[0]['bootisoID']); + $groupID = $bootiso->getGroupID(); + + } $client = new Application_Model_Client(); $client->setMacadress($_POST['mac']); @@ -51,10 +63,11 @@ class Fbgui_IndexController extends Zend_Controller_Action // Request Bootmenu $pbsFilter = new Pbs_Filter(); $bootmenuID = $pbsFilter->evaluate(); - print_a('bootmenuID is ',$bootmenuID); if($bootmenuID != null){ - print_a('goto bootmenu'); - #$this->_redirect('/dev/bootmenu/index/bootmenuid/'.$bootmenuID); + print_a('goto bootmenu '.$bootmenuID); + $bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper(); + $res = $bootmenuentriesMapper->findBy('bootmenuID',$bootmenuID); + $this->view->entries = $res; } else{ print_a('no filter is valid, goto login'); @@ -64,10 +77,33 @@ class Fbgui_IndexController extends Zend_Controller_Action else{ echo "<h1>Not Welcome</h1>"; print_a($_POST); - } - die(); + } + } - + public function startAction(){ + $bootmenuntryID = $this->_request->getParam('bme'); + $bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper(); + $bootmenuentry = new Application_Model_BootMenuEntries(); + $bootmenuentriesMapper->find($bootmenuntryID,$bootmenuentry); + + $sessionMapper = new Application_Model_SessionMapper(); + $session_k = $sessionMapper->findBy('alphasessionID',$_SESSION['alphasessionID']); + + $session = new Application_Model_Session(); + $session->setOptions($session_k[0]); + $session->setID($session_k[0]['sessionID']); +# print_a($bootmenuentry);die(); + $session->setBootmenuentryID($bootmenuntryID); + $session->setBootosID($bootmenuentry->getBootosID()); + echo "<h1>Downloading</h1>"; + echo "<script>\n"; + echo "fbgui.startDownload('http://132.230.2.27/dev/resource/getkernel/".$_SESSION['alphasessionID']."/file/kernel');\n"; + echo "fbgui.startDownload('http://132.230.2.27/dev/resource/getkernel/".$_SESSION['alphasessionID']."/file/initramfs');\n"; + echo "fbgui.startDownload('http://132.230.2.27/dev/resource/getkernel/".$_SESSION['alphasessionID']."/file/kcl');\n"; + echo "fbgui.getSession('".$_SESSION['alphasessionID']."');\n"; + echo "</script>"; + + } } |
