summaryrefslogtreecommitdiffstats
path: root/application/modules/fbgui
diff options
context:
space:
mode:
authorSimon2011-03-18 18:49:30 +0100
committerSimon2011-03-18 18:49:30 +0100
commit5139008cee049b2ab24b870a263996fe9043adeb (patch)
treea79c36fce9afc587c73cd4e71c94e72bbc83830e /application/modules/fbgui
parentAnsicht von Pools geändert (diff)
downloadpbs2-5139008cee049b2ab24b870a263996fe9043adeb.tar.gz
pbs2-5139008cee049b2ab24b870a263996fe9043adeb.tar.xz
pbs2-5139008cee049b2ab24b870a263996fe9043adeb.zip
User-Oberfläche, FBGui-Oberfläche legt Session&Clients an - für Kiosk-System
apache-default zum ersetzen, damit server von außen erreichbar ist FilterController weitergearbeitet
Diffstat (limited to 'application/modules/fbgui')
-rw-r--r--application/modules/fbgui/controllers/IndexController.php49
1 files changed, 38 insertions, 11 deletions
diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php
index 685feaa..238edb7 100644
--- a/application/modules/fbgui/controllers/IndexController.php
+++ b/application/modules/fbgui/controllers/IndexController.php
@@ -9,17 +9,44 @@ class Fbgui_IndexController extends Zend_Controller_Action
}
public function indexAction()
- {
- // action body
-
- // Call this Procedure after Login to create a session and save the alphasessionID to session
- $n = new Pbs_Session();
- $session = new Application_Model_Session();
- $session->setBootisoID(1);
- $session->setTime(time());
- $session->setIp($_SERVER['REMOTE_ADDR']);
- $session = $n->createsession($session);
- $_SESSION['alphasessionID'] = $session->getAlphasessionID();
+ {
+ if(isset($this->_request->getParam('post')) && $this->_request->getParam('keys')){
+ $data = $this->_request->getParam('post');
+ $keys = $this->_request->getParam('keys');
+ $_POST = array_combine ( $keys , $data );
+ }
+ if(isset($_POST['bootisoID'])){
+ // Create a session
+ $n = new Pbs_Session();
+
+ $bootisomapper = new Application_Model_BootIsoMapper();
+ $bootiso = new Application_Model_BootIso();
+ $bootisomapper->find($_POST['bootisoID'],$bootiso);
+ $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 "<h1>Welcome</h1>";
+ print_a('Session is now set','Your alphasessionID is '.$session->getAlphasessionID());
+ $this->_redirect('/dev/bootmenu/index/bootmenuid/1');
+ }
+ else{
+ echo "<h1>Not Welcome</h1>";
+ print_a($_POST);
+ }
+ die();
}