_request->getParam('postdata'); if(isset($_SESSION['postdata'])){ $_POST = ($_SESSION['postdata']); } if(isset($_POST['bootisoID']) || isset($_POST['serialnumber'])){ // Create a session $n = new Pbs_Session(); $bootisomapper = new Application_Model_BootIsoMapper(); $bootiso = new Application_Model_BootIso(); if(isset($_POST['bootisoID'])){ $bootisomapper->find($_POST['bootisoID'],$bootiso); $groupID = $bootiso->getGroupID(); } elseif(isset($_POST['serialnumber'])){ $results = $bootisomapper->findBy(array('serialnumber' => $_POST['serialnumber']),true); if(count($results) == 0){ echo 'Your serialnumber is not known by the system'; } $bootiso->setOptions($results[0]); $bootiso->setID($results[0]['bootisoID']); $groupID = $bootiso->getGroupID(); } $client = new Application_Model_Client(); $client->setMacadress($_POST['mac']); $client->setHardwarehash($_POST['hardwarehash']); $client->setGroupID($groupID); $client = $n->createClient($client); $clientID = $client->getID(); $session = new Application_Model_Session(); $session->setBootisoID($bootiso->getID()); $session->setClientID($clientID); $session->setTime(time()); $session->setIp($_SERVER['REMOTE_ADDR']); $session = $n->createSession($session); $_SESSION['alphasessionID'] = $session->getAlphasessionID(); // Request Bootmenu $pbsFilter = new Pbs_Filter(); $bootmenuID = $pbsFilter->evaluate(); if($bootmenuID != null){ /* 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); */ $bootmenuentriesMapper = new Application_Model_BootMenuEntriesMapper(); $res = $bootmenuentriesMapper->findBy(array('bootmenuID' => $bootmenuID),false); $this->view->entries = $res; if (!Zend_Auth::getInstance()->hasIdentity()) { echo "Goto Login to get your Bootmenu"; } } 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'); */ echo "Goto Login to get your Bootmenu"; } } else{ echo "

Not Welcome

"; } } 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(array('alphasessionID' => $_SESSION['alphasessionID']),true); $session = new Application_Model_Session(); $session->setOptions($session_k[0]); $session->setID($session_k[0]['sessionID']); #print_a($bootmenuentry); $session->setBootmenuentryID($bootmenuntryID); $session->setBootosID($bootmenuentry->getBootosID()); $sessionMapper->save($session); echo "

Downloading

"; echo ""; } }