_request->getParam('data'); $keys = $this->_request->getParam('keys'); $post = $this->_request->getParam('post'); if(isset($_SESSION['postdata'])){ $_POST = ($_SESSION['postdata']); unset($_SESSION['postdata']); } elseif($params != ''){ print_a(json_decode($this->_request->getParam('data'))); $data = array(); $data = json_decode($this->_request->getParam('data')); $_POST['bootisoID'] = $data->bootisoID; $_POST['mac'] = $data->mac; $_POST['hardwarehash'] = $data->hardwarehash; } elseif($post != '' && $keys != ''){ $keys = $keys; $post = $post; $_POST = array_combine ( $keys , $post ); print_a($keys, $data,$_POST); } if(isset($_POST['bootisoID'])){ // 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('serialnumber',$_POST['serialnumber']); $bootiso->setOptions($results[0]); $bootiso->setID($result[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($_POST['bootisoID']); $session->setClientID($clientID); $session->setTime(time()); $session->setIp($_SERVER['REMOTE_ADDR']); $session = $n->createSession($session); $_SESSION['alphasessionID'] = $session->getAlphasessionID(); echo "

Welcome

"; print_a('Session is now set', 'Your sessionID is '.$session->getID(), 'Your alphasessionID is '.$session->getAlphasessionID(), 'Your client is '.$session->getClientID()); // Request Bootmenu $pbsFilter = new Pbs_Filter(); $bootmenuID = $pbsFilter->evaluate(); if($bootmenuID != null){ 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'); #$this->_redirect('/dev/auth/index/'); } } else{ echo "

Not Welcome

"; print_a($_POST); } } 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); $session->setBootmenuentryID($bootmenuntryID); $session->setBootosID($bootmenuentry->getBootosID()); $sessionMapper->save($session); echo "

Downloading

"; echo ""; } }