From 9d8f41d57a4a6a763cec2dedb44e7098f866a264 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Thu, 14 Apr 2011 13:28:04 +0200 Subject: Notifier if Serial was not found on the USB Stick --- .../modules/fbgui/controllers/IndexController.php | 20 ++++++++++++-------- .../modules/fbgui/views/scripts/index/error.phtml | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 application/modules/fbgui/views/scripts/index/error.phtml (limited to 'application/modules') diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index ae23d86..b82a9f0 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -12,13 +12,17 @@ class Fbgui_IndexController extends Zend_Controller_Action $membershipMapper->find($userIDsNamespace['membershipID'],$this->membership); } + public function errorAction() + { + $result = $this->_request->getParam('serialresult'); + if($result != ""){ + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify('serial',$result); + } + } + public function indexAction() - { - $params = $this->_request->getParam('postdata'); - if(isset($_SESSION['postdata'])){ - $_POST = ($_SESSION['postdata']); - } - + { if(isset($_POST['bootisoID']) || isset($_POST['serialnumber'])){ // Create a session $n = new Pbs_Session(); @@ -32,7 +36,7 @@ class Fbgui_IndexController extends Zend_Controller_Action elseif(isset($_POST['serialnumber'])){ $results = $bootisomapper->findBy(array('serialnumber' => $_POST['serialnumber']),true); if(count($results) == 0){ - echo 'Your serialnumber is not known by the system'; + $this->_redirect('/fbgui/index/index/serialresult/noserial'); } $bootiso->setOptions($results[0]); $bootiso->setID($results[0]['bootisoID']); @@ -103,7 +107,7 @@ class Fbgui_IndexController extends Zend_Controller_Action } } else{ - echo "

Not Welcome

"; + $this->_redirect('/fbgui/index/index/serialresult/noserial'); } } diff --git a/application/modules/fbgui/views/scripts/index/error.phtml b/application/modules/fbgui/views/scripts/index/error.phtml new file mode 100644 index 0000000..1569250 --- /dev/null +++ b/application/modules/fbgui/views/scripts/index/error.phtml @@ -0,0 +1 @@ +notification != ''){echo $this->notification;} ?> -- cgit v1.2.3-55-g7522 From 022b43a4fa6e12eeb49c3e473abcc8f967de95cb Mon Sep 17 00:00:00 2001 From: michael pereira Date: Thu, 14 Apr 2011 13:30:00 +0200 Subject: fix --- application/modules/fbgui/controllers/IndexController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'application/modules') diff --git a/application/modules/fbgui/controllers/IndexController.php b/application/modules/fbgui/controllers/IndexController.php index b82a9f0..6941e47 100644 --- a/application/modules/fbgui/controllers/IndexController.php +++ b/application/modules/fbgui/controllers/IndexController.php @@ -36,7 +36,7 @@ class Fbgui_IndexController extends Zend_Controller_Action elseif(isset($_POST['serialnumber'])){ $results = $bootisomapper->findBy(array('serialnumber' => $_POST['serialnumber']),true); if(count($results) == 0){ - $this->_redirect('/fbgui/index/index/serialresult/noserial'); + $this->_redirect('/fbgui/index/error/serialresult/noserial'); } $bootiso->setOptions($results[0]); $bootiso->setID($results[0]['bootisoID']); @@ -107,7 +107,7 @@ class Fbgui_IndexController extends Zend_Controller_Action } } else{ - $this->_redirect('/fbgui/index/index/serialresult/noserial'); + $this->_redirect('/fbgui/index/error/serialresult/noserial'); } } -- cgit v1.2.3-55-g7522