From 66f4014f053098298691da7ff3089f44c68a4a2c Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 16 Mar 2011 17:48:53 +0100 Subject: Lib umbenannt und beispielverwendung korrigiert --- .../modules/fbgui/controllers/IndexController.php | 2 +- library/Pbs/PbsSession.php | 31 ---------------------- library/Pbs/Session.php | 31 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 library/Pbs/PbsSession.php create mode 100644 library/Pbs/Session.php diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index d141733..685feaa 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -13,7 +13,7 @@ class Fbgui_IndexController extends Zend_Controller_Action // action body // Call this Procedure after Login to create a session and save the alphasessionID to session - $n = new Pbs_PbsSession(); + $n = new Pbs_Session(); $session = new Application_Model_Session(); $session->setBootisoID(1); $session->setTime(time()); diff --git a/library/Pbs/PbsSession.php b/library/Pbs/PbsSession.php deleted file mode 100644 index 1ed7cb1..0000000 --- a/library/Pbs/PbsSession.php +++ /dev/null @@ -1,31 +0,0 @@ -getUniqueCode(10); - $sm = new Application_Model_SessionMapper(); - while(count($sm->findBy('alphasessionID',$uniqid))>0){ - $uniqid = $this->getUniqueCode(16); - } - - $session->setAlphasessionID($uniqid); - $id = $sessionmapper->save($session); - $sessionmapper->find($id, $session); - return $session; - } - private function getUniqueCode($length = "") - { - $code = md5(uniqid(rand(), true)); - if ($length != "") return substr($code, 0, $length); - else return $code; - } -} - -?> diff --git a/library/Pbs/Session.php b/library/Pbs/Session.php new file mode 100644 index 0000000..15cb93b --- /dev/null +++ b/library/Pbs/Session.php @@ -0,0 +1,31 @@ +getUniqueCode(10); + $sm = new Application_Model_SessionMapper(); + while(count($sm->findBy('alphasessionID',$uniqid))>0){ + $uniqid = $this->getUniqueCode(16); + } + + $session->setAlphasessionID($uniqid); + $id = $sessionmapper->save($session); + $sessionmapper->find($id, $session); + return $session; + } + private function getUniqueCode($length = "") + { + $code = md5(uniqid(rand(), true)); + if ($length != "") return substr($code, 0, $length); + else return $code; + } +} + +?> -- cgit v1.2.3-55-g7522