From d9ed511e80725057ea4eb3f08fec1f2ace325cb3 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Mon, 11 Apr 2011 14:29:18 +0200 Subject: kcl fix im ressource controller --- application/controllers/ResourceController.php | 12 ++++++++---- application/modules/user/controllers/BootmenuController.php | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'application') diff --git a/application/controllers/ResourceController.php b/application/controllers/ResourceController.php index 64d9885..a60b3c9 100644 --- a/application/controllers/ResourceController.php +++ b/application/controllers/ResourceController.php @@ -129,6 +129,7 @@ class ResourceController extends Zend_Controller_Action $bmemapper = new Application_Model_BootMenuEntriesMapper(); $bme = new Application_Model_BootMenuEntries(); + $bootosmapper = new Application_Model_BootOsMapper(); $bmemapper->find($bmeID,$bme); header('Content-Type: text/html'); @@ -137,11 +138,14 @@ class ResourceController extends Zend_Controller_Action header('Pragma: no-cache'); header('Expires: 0'); - if($bme->getKcl() != null) - $result = $bme->getKcl() . " alpha=" . $this->_request->getParam('alpha') . " " . $bme->getKclappend(); - else + if($bme->getKcl() != null){ + @list($bootos) = $bootosmapper->findBy(array('defaultkcl', $bme->getKcl())); + $kcl = $bootos->getDefaultkcl(); + + $result = $kcl . " alpha=" . $this->_request->getParam('alpha') . " " . $bme->getKclappend(); + }else{ $result = "alpha=" . $this->_request->getParam('alpha') . " " .$bme->getKclappend(); - + } echo $result; diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index ed2239b..a7bfb56 100644 --- a/application/modules/user/controllers/BootmenuController.php +++ b/application/modules/user/controllers/BootmenuController.php @@ -125,7 +125,7 @@ class user_BootmenuController extends Zend_Controller_Action $pagination->setPageUrl('/user/bootmenu/index/type/'.$this->type.((isset($this->view->search))?'/search/'.$this->view->search:'')); $bootmenu = $pagination->getElements(); - $this->view->pagination = $pagination->pagination($pageurl); + $this->view->pagination = $pagination->pagination(); $this->view->page = $pagination->getRequestPage(); $this->view->bootmenulist = $bootmenu; -- cgit v1.2.3-55-g7522 From abedb634fe938e85f68d9be5223c97e392e047cc Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Mon, 11 Apr 2011 14:37:44 +0200 Subject: Bessere Fehlerbeschreibung bei Registrierung --- .../modules/user/controllers/AuthController.php | 27 +++++++++++----------- .../modules/user/views/scripts/auth/login.phtml | 1 + .../modules/user/views/scripts/auth/register.phtml | 3 ++- 3 files changed, 16 insertions(+), 15 deletions(-) (limited to 'application') diff --git a/application/modules/user/controllers/AuthController.php b/application/modules/user/controllers/AuthController.php index 8160104..bb16e94 100644 --- a/application/modules/user/controllers/AuthController.php +++ b/application/modules/user/controllers/AuthController.php @@ -45,8 +45,6 @@ class User_AuthController extends Zend_Controller_Action $result = $auth->authenticate($adapter); - // TODO: erweiterte fehlerbeschreibung des Users - if ($result->isValid()) { $this->personmapper = new Application_Model_PersonMapper(); $result = $this->personmapper->findBy(array('email' => Zend_Auth::getInstance()->getIdentity()),true); @@ -58,7 +56,8 @@ class User_AuthController extends Zend_Controller_Action $this->_helper->redirector('selectmembership', 'person'); return; } else { - echo "Wrong Email or Password."; + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify('Wrong Email or Password', 'error'); } } } @@ -80,34 +79,34 @@ class User_AuthController extends Zend_Controller_Action public function registerAction() { if (Zend_Auth::getInstance()->hasIdentity()) { - print_a('Already logged in.'); + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify('Already logged in.', 'error'); } else { if (!isset($_POST["register"])){ $registerForm = new user_Form_Register(); } else { - $registerForm = new user_Form_Register($_POST); - + foreach($_POST as $k => $v) { + if($v != '') { + $data[$k] = $v; + } + } + $registerForm = new user_Form_Register($data); if ($registerForm->isValid($_POST)) { - $person = new Application_Model_Person($_POST); $this->personmapper = new Application_Model_PersonMapper(); - $date = new DateTime(); $person->setRegisterdate($date->getTimestamp()); $person->setPasswordSalt(MD5($date->getTimestamp())); $person->setPassword(MD5($person->getPassword() . $person->getPasswordSalt())); - print_a($person); try { $this->personmapper->save($person); }catch(Zend_Exception $e) { - echo "Caught exception: " . get_class($e) . "
"; - echo "Message: " . $e->getMessage() . "
"; - echo "Email Address already existing.."; + $pbsNotifier = new Pbs_Notifier(); + $this->view->notification = $pbsNotifier->notify('Email already registered', 'error'); + $this->view->registerForm = $registerForm; return; } - echo "Successfully registered.
"; - echo "Continue to Login: Login"; $this->_helper->redirector('login', 'auth'); return; } diff --git a/application/modules/user/views/scripts/auth/login.phtml b/application/modules/user/views/scripts/auth/login.phtml index 899c6e7..cc2a3ef 100644 --- a/application/modules/user/views/scripts/auth/login.phtml +++ b/application/modules/user/views/scripts/auth/login.phtml @@ -1,6 +1,7 @@

Login

loginForm->setAction($this->url()); +echo $this->notification; echo $this->loginForm; ?>
\ No newline at end of file diff --git a/application/modules/user/views/scripts/auth/register.phtml b/application/modules/user/views/scripts/auth/register.phtml index 6217e06..eb59c68 100644 --- a/application/modules/user/views/scripts/auth/register.phtml +++ b/application/modules/user/views/scripts/auth/register.phtml @@ -1,5 +1,6 @@

New Account

notification; $this->registerForm->setAction($this->url()); echo $this->registerForm; -?> \ No newline at end of file +?> -- cgit v1.2.3-55-g7522 From 97383600c745298d595e6ee6258cc0f0e769c65a Mon Sep 17 00:00:00 2001 From: michael pereira Date: Mon, 11 Apr 2011 15:15:00 +0200 Subject: fixes --- application/modules/user/controllers/BootmenuController.php | 11 ++++++----- application/modules/user/controllers/ConfigController.php | 11 ++++++----- application/modules/user/forms/Bootiso.php | 2 +- application/modules/user/forms/Bootmenu.php | 10 +++++++--- application/modules/user/forms/BootmenuEntries.php | 9 +++++++-- application/modules/user/forms/Bootos.php | 2 +- application/modules/user/forms/Config.php | 9 ++++++--- application/modules/user/forms/Preboot.php | 2 +- 8 files changed, 35 insertions(+), 21 deletions(-) (limited to 'application') diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index e60679a..deea70d 100644 --- a/application/modules/user/controllers/BootmenuController.php +++ b/application/modules/user/controllers/BootmenuController.php @@ -147,10 +147,10 @@ class user_BootmenuController extends Zend_Controller_Action $this->_redirect('/user/bootmenu/index/type/'.$this->type.'/page/'.$this->page.'/addresult/forbidden'); if (!isset($_POST["createbootmenu"])){ - $bootmenuForm = new user_Form_Bootmenu(array('action' => 'createbootmenu','page' => $this->page)); + $bootmenuForm = new user_Form_Bootmenu(array('action' => 'createbootmenu','page' => $this->page, 'type'=>$this->type)); } else { - $bootmenuForm = new user_Form_Bootmenu(array('action' => 'createbootmenu','page' => $this->page),$_POST); + $bootmenuForm = new user_Form_Bootmenu(array('action' => 'createbootmenu','page' => $this->page, 'type'=>$this->type),$_POST); if ($bootmenuForm->isValid($_POST)) { @@ -192,11 +192,11 @@ class user_BootmenuController extends Zend_Controller_Action if (!isset($_POST["editbootmenu"])){ - $bootmenuForm = new user_Form_Bootmenu(array('action' => 'editbootmenu','page' => $this->page)); + $bootmenuForm = new user_Form_Bootmenu(array('action' => 'editbootmenu','page' => $this->page, 'type'=>$this->type)); $bootmenuForm->populate($bootmenu->toArray()); }else{ - $bootmenuForm = new user_Form_Bootmenu(array('action' => 'editbootmenu','page' => $this->page),$_POST); + $bootmenuForm = new user_Form_Bootmenu(array('action' => 'editbootmenu','page' => $this->page, 'type'=>$this->type),$_POST); if ($bootmenuForm->isValid($_POST)) { @@ -451,7 +451,8 @@ class user_BootmenuController extends Zend_Controller_Action } if (!isset($_POST["editbootmenuentry"])){ - + if(!isset($_POST['bootosID'])) + $_POST['bootosID'] = $bootmenuentry->getBootosID(); if(!isset($_POST['kcl'])) $_POST['kcl'] = $bootmenuentry->getKcl(); diff --git a/application/modules/user/controllers/ConfigController.php b/application/modules/user/controllers/ConfigController.php index a38af00..2491c0e 100644 --- a/application/modules/user/controllers/ConfigController.php +++ b/application/modules/user/controllers/ConfigController.php @@ -30,7 +30,8 @@ class user_ConfigController extends Zend_Controller_Action } else { $this->_helper->redirector('login', 'auth'); } - $this->page = $this->_request->getParam('page'); } + $this->page = $this->_request->getParam('page'); + } public function indexAction() { @@ -106,9 +107,9 @@ class user_ConfigController extends Zend_Controller_Action $this->_redirect('/user/config/index/type/'.$this->type.'/page/'.$this->page.'/addresult/forbidden'); if (!isset($_POST["createconfig"])){ - $configForm = new user_Form_Config(array('action' => 'createconfig','page'=>$this->page)); + $configForm = new user_Form_Config(array('action' => 'createconfig','page'=>$this->page, 'type'=>$this->type)); } else { - $configForm = new user_Form_Config(array('action' => 'createconfig','page'=>$this->page),$_POST); + $configForm = new user_Form_Config(array('action' => 'createconfig','page'=>$this->page, 'type'=>$this->type),$_POST); if ($configForm->isValid($_POST)) { @@ -162,11 +163,11 @@ class user_ConfigController extends Zend_Controller_Action if (!isset($_POST["editconfig"])){ - $configForm = new user_Form_Config(array('action' => 'editconfig','page'=>$this->page)); + $configForm = new user_Form_Config(array('action' => 'editconfig','page'=>$this->page, 'type'=>$this->type)); $configForm->populate($config->toArray()); }else{ - $configForm = new user_Form_Config(array('action' => 'editconfig','page'=>$this->page),$_POST); + $configForm = new user_Form_Config(array('action' => 'editconfig','page'=>$this->page, 'type'=>$this->type),$_POST); if ($configForm->isValid($_POST)) { diff --git a/application/modules/user/forms/Bootiso.php b/application/modules/user/forms/Bootiso.php index 7a3547e..3f5431c 100644 --- a/application/modules/user/forms/Bootiso.php +++ b/application/modules/user/forms/Bootiso.php @@ -26,7 +26,7 @@ class user_Form_Bootiso extends Zend_Form $this->setName($this->action); $this->setMethod('post'); - if (!Pbs_Acl::checkRight('be')) + if (!Pbs_Acl::checkRight('be') && $this->action == 'editbootiso') $meta = true; else $meta = null; diff --git a/application/modules/user/forms/Bootmenu.php b/application/modules/user/forms/Bootmenu.php index 8389fa8..73791fd 100644 --- a/application/modules/user/forms/Bootmenu.php +++ b/application/modules/user/forms/Bootmenu.php @@ -4,6 +4,7 @@ class user_Form_Bootmenu extends Zend_Form { private $action; private $page; + private $type; public function setAction($action){ $this->action = $action; @@ -17,13 +18,16 @@ class user_Form_Bootmenu extends Zend_Form public function setPage($page){ $this->page = $page; } - + public function setType($type){ + $this->type = $type; + } + public function init() { $this->setName($this->action); $this->setMethod('post'); - if (!Pbs_Acl::checkRight('booee')) + if (!Pbs_Acl::checkRight('booee') && $this->action == 'editbootmenu') $meta = true; else $meta = null; @@ -49,7 +53,7 @@ class user_Form_Bootmenu extends Zend_Form )); $this->addElement('button', 'Cancel', array( - 'onclick' => 'self.location="/user/bootmenu/index/page/'.$this->page.'"' + 'onclick' => 'self.location="/user/bootmenu/index/type/'.$this->type.'/page/'.$this->page.'"' )); } diff --git a/application/modules/user/forms/BootmenuEntries.php b/application/modules/user/forms/BootmenuEntries.php index 58a2820..3168bee 100644 --- a/application/modules/user/forms/BootmenuEntries.php +++ b/application/modules/user/forms/BootmenuEntries.php @@ -8,6 +8,7 @@ class user_Form_BootmenuEntries extends Zend_Form private $maxorder; private $action; private $page; + private $type; public function setAction($action){ $this->action = $action; @@ -30,6 +31,10 @@ class user_Form_BootmenuEntries extends Zend_Form $this->configlist = $configlist; } + public function setType($type){ + $this->type = $type; + } + public function setPage($page){ $this->page = $page; } @@ -48,7 +53,7 @@ class user_Form_BootmenuEntries extends Zend_Form $this->setName($this->action); $this->setMethod('post'); - if (!Pbs_Acl::checkRight('booee')) + if (!Pbs_Acl::checkRight('booee') && $this->action == 'editbootmenuentry') $meta = true; else $meta = null; @@ -152,7 +157,7 @@ class user_Form_BootmenuEntries extends Zend_Form )); $this->addElement('button', 'Cancel', array( - 'onclick' => 'self.location="/user/bootmenu/index/page/'.$this->page.'"' + 'onclick' => 'self.location="/user/bootmenu/index/type/'.$this->type.'/page/'.$this->page.'"' )); } diff --git a/application/modules/user/forms/Bootos.php b/application/modules/user/forms/Bootos.php index 6edc7eb..5420a83 100644 --- a/application/modules/user/forms/Bootos.php +++ b/application/modules/user/forms/Bootos.php @@ -28,7 +28,7 @@ class user_Form_Bootos extends Zend_Form $this->setName("BootOsCreate"); $this->setMethod('post'); - if (!Pbs_Acl::checkRight('boe')) + if (!Pbs_Acl::checkRight('boe') && $this->action == 'editbootos') $meta = true; else $meta = null; diff --git a/application/modules/user/forms/Config.php b/application/modules/user/forms/Config.php index 2ee221d..a9f4c62 100644 --- a/application/modules/user/forms/Config.php +++ b/application/modules/user/forms/Config.php @@ -5,6 +5,7 @@ class user_Form_Config extends Zend_Form private $action; private $page; + private $type; public function setAction($action){ $this->action = $action; @@ -12,13 +13,15 @@ class user_Form_Config extends Zend_Form public function setPage($p){ $this->page = $p; } - + public function setType($type){ + $this->type = $type; + } public function init() { $this->setName($this->action); $this->setMethod('post'); - if (!Pbs_Acl::checkRight('ce')) + if (!Pbs_Acl::checkRight('ce') && $this->action == 'editconfig') $meta = true; else $meta = null; @@ -57,7 +60,7 @@ class user_Form_Config extends Zend_Form )); $this->addElement('button', 'Cancel', array( - 'onclick' => 'self.location="/user/config/index/page/'.$this->page.'"' + 'onclick' => 'self.location="/user/config/index/type/'.$this->type.'/page/'.$this->page.'"' )); } diff --git a/application/modules/user/forms/Preboot.php b/application/modules/user/forms/Preboot.php index 9d2f3aa..404a559 100644 --- a/application/modules/user/forms/Preboot.php +++ b/application/modules/user/forms/Preboot.php @@ -18,7 +18,7 @@ class user_Form_Preboot extends Zend_Form $this->setName($this->action); $this->setMethod('post'); - if ((!Pbs_Acl::checkRight('pre') && $this->action == 'editpreboot')) + if (!Pbs_Acl::checkRight('pre') && $this->action == 'editpreboot') $meta = true; else $meta = null; -- cgit v1.2.3-55-g7522 From cca2d69c25e36b8c5384899cbe2a18002d1b76a9 Mon Sep 17 00:00:00 2001 From: michael pereira Date: Mon, 11 Apr 2011 15:19:51 +0200 Subject: fixes --- application/modules/user/controllers/BootmenuController.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'application') diff --git a/application/modules/user/controllers/BootmenuController.php b/application/modules/user/controllers/BootmenuController.php index deea70d..d2e3508 100644 --- a/application/modules/user/controllers/BootmenuController.php +++ b/application/modules/user/controllers/BootmenuController.php @@ -350,6 +350,7 @@ class user_BootmenuController extends Zend_Controller_Action 'maxorder'=> $maxorder, 'configlist'=> $configlist, 'page' => $this->page, + 'type' => $this->type, 'action' => 'addbootmenuentry', )); @@ -366,6 +367,7 @@ class user_BootmenuController extends Zend_Controller_Action 'maxorder'=> $maxorder, 'configlist'=>$configlist, 'page' => $this->page, + 'type' => $this->type, 'action' => 'addbootmenuentry', ),$_POST); @@ -462,6 +464,7 @@ class user_BootmenuController extends Zend_Controller_Action 'maxorder'=> $maxorder-1, 'configlist'=> $configlist, 'page' => $this->page, + 'type' => $this->type, 'action' => 'editbootmenuentry', )); @@ -481,6 +484,7 @@ class user_BootmenuController extends Zend_Controller_Action 'maxorder'=> $maxorder-1, 'configlist'=> $configlist, 'page' => $this->page, + 'type' => $this->type, 'action' => 'editbootmenuentry'),$_POST); if ($bootmenuentryForm->isValid($_POST)) { -- cgit v1.2.3-55-g7522