From 5139008cee049b2ab24b870a263996fe9043adeb Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 18 Mar 2011 18:49:30 +0100 Subject: 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 --- library/Pbs/Notifier.php | 14 ++++++++++++++ library/Pbs/Session.php | 14 +++++++++++++- 2 files changed, 27 insertions(+), 1 deletion(-) (limited to 'library/Pbs') diff --git a/library/Pbs/Notifier.php b/library/Pbs/Notifier.php index 23fec57..1c7dfca 100644 --- a/library/Pbs/Notifier.php +++ b/library/Pbs/Notifier.php @@ -6,6 +6,20 @@ class Pbs_Notifier{ public function notify($action,$result){ switch($action){ + default: + switch($result){ + case "forbidden": + $result = "errorbox"; + break; + case "ok": + $result = "okbox"; + break; + case "error": + $result = "warningbox"; + break; + } + $result = "
$action
"; + break; case "delete": switch($result){ case "forbidden": diff --git a/library/Pbs/Session.php b/library/Pbs/Session.php index 592b89c..eb7c927 100644 --- a/library/Pbs/Session.php +++ b/library/Pbs/Session.php @@ -2,7 +2,7 @@ class Pbs_Session{ - public function createsession(Application_Model_Session $session){ + public function CreateSession(Application_Model_Session $session){ $sessionmapper = new Application_Model_SessionMapper(); $uniqid = $this->getUniqueCode(10); @@ -16,6 +16,18 @@ class Pbs_Session{ $sessionmapper->find($id, $session); return $session; } + public function createClient(Application_Model_Client $client){ + $clientmapper = new Application_Model_ClientMapper(); + $result = $clientmapper->findBy('macadress',$client->getMacadress()); + if(($result)>0){ + $client->setOptions($result); + } + else{ + $id = $clientmapper->save($client); + $clientmapper->find($id, $client); + } + return $client; + } private function getUniqueCode($length = "") { $code = md5(uniqid(rand(), true)); -- cgit v1.2.3-55-g7522