diff options
| author | Simon | 2011-04-11 12:19:28 +0200 |
|---|---|---|
| committer | Simon | 2011-04-11 12:19:28 +0200 |
| commit | 4ab3be484d93b93f17b30753b69a53b691b2a4fb (patch) | |
| tree | 9cb334ec2610f703d5530f5dc74e7352f210c29e /application/modules/user | |
| parent | kleine anpassungen (diff) | |
| download | pbs2-4ab3be484d93b93f17b30753b69a53b691b2a4fb.tar.gz pbs2-4ab3be484d93b93f17b30753b69a53b691b2a4fb.tar.xz pbs2-4ab3be484d93b93f17b30753b69a53b691b2a4fb.zip | |
Recht um als neu registrierter Benutzer Gruppen beizutreten
Diffstat (limited to 'application/modules/user')
3 files changed, 17 insertions, 10 deletions
diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php index d910707..a767f82 100644 --- a/application/modules/user/controllers/GroupController.php +++ b/application/modules/user/controllers/GroupController.php @@ -262,7 +262,12 @@ class User_GroupController extends Zend_Controller_Action $membership->setPersonID($groupRequest->getPersonID()); $membership->setRoleID($_POST['roleID']); try { - $this->membershipMapper->save($membership); + $id = $this->membershipMapper->save($membership); + + $membership->setID($id); + + $newMember = new Pbs_NewMember(); + $newMember->createDefaults($membership); } catch(Zend_Exception $e) { echo "Caught exception: " . get_class($e) . "<br/>"; diff --git a/application/modules/user/controllers/PersonController.php b/application/modules/user/controllers/PersonController.php index ff5517c..41f7122 100644 --- a/application/modules/user/controllers/PersonController.php +++ b/application/modules/user/controllers/PersonController.php @@ -46,9 +46,9 @@ class user_PersonController extends Zend_Controller_Action public function indexAction() { - if(!Pbs_Acl::checkRight('psod')) { - $this->_redirect('/user'); - } + #if(!Pbs_Acl::checkRight('psod')) { + # $this->_redirect('/user'); + #} $this->view->person = $this->person; // Pagination $pagination = new Pbs_Pagination(); @@ -60,7 +60,8 @@ class user_PersonController extends Zend_Controller_Action $this->view->groups = $pagination->getElements(); $this->view->pagination = $pagination->pagination($pageurl); $this->view->page = $pagination->getRequestPage(); - $this->view->groupRequestRight = Pbs_Acl::checkRight('grm'); + // This should be activated in case the person has no membership and no rights. + $this->view->groupRequestRight = true; $this->view->editRight = Pbs_Acl::checkRight('peoa'); $this->view->leaveRight = Pbs_Acl::checkRight('gl'); $this->view->userIDsNamespace = Zend_Session::namespaceGet('userIDs'); @@ -129,9 +130,9 @@ class user_PersonController extends Zend_Controller_Action public function requestAction() { - if(!Pbs_Acl::checkRight('grm')) { - $this->_redirect('/user'); - } + #if(!Pbs_Acl::checkRight('grm')) { + # $this->_redirect('/user'); + #} $this->view->person = $this->person; $allgroups = $this->groupMapper->fetchAll(); $groupRequests = $this->groupRequestMapper->findBy(array('personID' => $this->person->getID()),true); diff --git a/application/modules/user/views/scripts/person/index.phtml b/application/modules/user/views/scripts/person/index.phtml index 7c6fc8d..c285ece 100644 --- a/application/modules/user/views/scripts/person/index.phtml +++ b/application/modules/user/views/scripts/person/index.phtml @@ -47,11 +47,12 @@ $class= 'highlight checked'; </div> <?php endforeach ?></div> <?php echo $this->pagination; - if($this->groupRequestRight === true) echo $this->formButton('addtogroup', 'Add to additional + +} +if($this->groupRequestRight === true) echo $this->formButton('addtogroup', 'Add to additional Groups', array( 'onclick' => 'self.location="/user/person/request/"', 'class' => 'addbutton')); -} ?> <br /> <br /> |
