diff options
| author | michael pereira | 2011-03-18 19:27:33 +0100 |
|---|---|---|
| committer | michael pereira | 2011-03-18 19:27:33 +0100 |
| commit | 87b3b1d9c0cecf76d1eb39cf2548072607de59ea (patch) | |
| tree | 5d07af0d68e20a38422a72864b3ca68b1a1b07be /library | |
| parent | BootOs Update implementiert, BootISO anlegen und some fixes (diff) | |
| parent | User-Oberfläche, FBGui-Oberfläche legt Session&Clients an - für Kiosk-System (diff) | |
| download | pbs2-87b3b1d9c0cecf76d1eb39cf2548072607de59ea.tar.gz pbs2-87b3b1d9c0cecf76d1eb39cf2548072607de59ea.tar.xz pbs2-87b3b1d9c0cecf76d1eb39cf2548072607de59ea.zip | |
newsql geaendert
Diffstat (limited to 'library')
| -rw-r--r-- | library/Pbs/Notifier.php | 40 | ||||
| -rw-r--r-- | library/Pbs/Session.php | 14 |
2 files changed, 53 insertions, 1 deletions
diff --git a/library/Pbs/Notifier.php b/library/Pbs/Notifier.php index 256aea4..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 = "<div class='$result'>$action</div>"; + break; case "delete": switch($result){ case "forbidden": @@ -45,6 +59,32 @@ class Pbs_Notifier{ break; } break; + case "link": + switch($result){ + case "forbidden": + $result = "<div class='errorbox'>Not allowed to link this</div>"; + break; + case "ok": + $result = "<div class='okbox'>Link sucessful</div>"; + break; + case "error": + $result = "<div class='warningbox'>Link failed</div>"; + break; + } + break; + case "unlink": + switch($result){ + case "forbidden": + $result = "<div class='errorbox'>Not allowed to unlink this</div>"; + break; + case "ok": + $result = "<div class='okbox'>Unlink sucessful</div>"; + break; + case "error": + $result = "<div class='warningbox'>Unlink failed</div>"; + break; + } + break; } return $result; 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)); |
