diff options
Diffstat (limited to 'application/modules/user/controllers')
| -rw-r--r-- | application/modules/user/controllers/GroupController.php | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php index bb39287..d3afec9 100644 --- a/application/modules/user/controllers/GroupController.php +++ b/application/modules/user/controllers/GroupController.php @@ -111,6 +111,12 @@ class User_GroupController extends Zend_Controller_Action if ($addForm->isValid($_POST)) { $group = new Application_Model_Group($_POST); + + $db = $this->groupMapper->findBy(array('title'=>$group->getTitle())); + if(count($db)>=1){ + $this->_redirect('/user/group/index/page/'.$this->page.'/addresult/error'); + } + try { $this->groupMapper->save($group); } catch(Zend_Exception $e) @@ -161,7 +167,7 @@ class User_GroupController extends Zend_Controller_Action } } - $this->_helper->redirector('', 'group'); + $this->_redirect('/user/group/index/page/'.$this->page.'/addresult/ok'); return; } } @@ -186,7 +192,7 @@ class User_GroupController extends Zend_Controller_Action return; } if((!Pbs_Acl::checkRight('geo') && $groupID == $this->membership->getGroupID()) || ( !Pbs_Acl::checkRight('ge') && $groupID != $this->membership->getGroupID() )) - $this->_redirect('/user/group/index/page/'.$this->page.'/deleteresult/forbidden'); + $this->_redirect('/user/group/index/page/'.$this->page.'/modifyresult/forbidden'); if (!isset($_POST["save"])){ $group = $this->groupMapper->find($groupID); $_POST['title'] = $group->getTitle(); @@ -205,7 +211,7 @@ class User_GroupController extends Zend_Controller_Action echo "Message: " . $e->getMessage() . "<br/>"; return; } - $this->_helper->redirector('', 'group'); + $this->_redirect('/user/group/index/page/'.$this->page.'/modifyresult/ok'); return; } } @@ -389,7 +395,7 @@ class User_GroupController extends Zend_Controller_Action if(strpos($_SERVER['HTTP_REFERER'], '/user/group/show') !== false && strpos($_SERVER['HTTP_REFERER'], '/groupID/') === false) { $this->_helper->redirector('changemembership', 'person'); } else { - $this->_helper->redirector('', 'group'); + $this->_redirect('/user/group/index/page/'.$this->page.'/deleteresult/ok'); } } else { $this->_helper->redirector('', 'group'); |
