_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 "