From a3fe05f88ef948366d58dbc47b3d55a8b4511df5 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 13 Apr 2011 12:59:17 +0200 Subject: Erster Teil der Rechte in Group Controller --- .../modules/user/views/scripts/group/index.phtml | 79 +++++++++++----------- .../modules/user/views/scripts/group/show.phtml | 60 ++++++++++------ 2 files changed, 81 insertions(+), 58 deletions(-) (limited to 'application/modules/user/views/scripts/group') diff --git a/application/modules/user/views/scripts/group/index.phtml b/application/modules/user/views/scripts/group/index.phtml index 2e376b3..e3b5082 100644 --- a/application/modules/user/views/scripts/group/index.phtml +++ b/application/modules/user/views/scripts/group/index.phtml @@ -6,31 +6,34 @@ ?>
-
Available searchfilter:
-
title
-
description
+
Available searchfilter:
+
title
+
description
-
+groupList)==0) -echo "There are no groups" ?> groupList as $k => $group): ?> +echo "There are no groups" ?> +groupList as $k => $group): ?> getID() == $this->userIDsNamespace['groupID']) $class= 'highlight checked'; ?> -
getID() != $this->userIDsNamespace['groupID']) { +
+ getID() != $this->userIDsNamespace['groupID']) { + ?> +
+
Group
+ +
+ -
-
Group
- -
- - +
+
+
-
getTitle(); ?>
- getDescription()) { - ?> -
getDescription(); ?>
- -
 
-
-
- - -pagination; ?> + pagination; ?> -formButton('linkgroups', 'Link Groups', array( + formButton('linkgroups', 'Link Groups', array( 'onclick' => 'self.location="/user/group/link"', 'class' => 'addbutton')) ?> diff --git a/application/modules/user/views/scripts/group/show.phtml b/application/modules/user/views/scripts/group/show.phtml index f1a14d1..18bc33a 100644 --- a/application/modules/user/views/scripts/group/show.phtml +++ b/application/modules/user/views/scripts/group/show.phtml @@ -1,31 +1,32 @@ -groupID) { - if(isset($this->userIDsNamespace['groupID'])) { - ?> -

Own Group

- formButton('deletegroup', 'Delete', array( +

Groupdetails

+usergroup == $this->requestgroup){ + echo $this->formButton('deletegroup', 'Delete', array( 'onclick' => 'self.location="/user/group/delete/"', 'class' => 'rightbutton')); - echo $this->formButton('editgroup', 'Edit', array( + echo $this->formButton('editgroup', 'Edit', array( 'onclick' => 'self.location="/user/group/edit/"', 'class' => 'rightbutton')); - } else { - ?> -

Group Details

- formButton('deletegroup', 'Delete', array( +} +else{ + echo $this->formButton('deletegroup', 'Delete', array( 'onclick' => 'self.location="/user/group/delete/groupID/' . $this->group->getID() .'"', 'class' => 'rightbutton')); - echo $this->formButton('editgroup', 'Edit', array( + echo $this->formButton('editgroup', 'Edit', array( 'onclick' => 'self.location="/user/group/edit/groupID/' . $this->group->getID() .'"', 'class' => 'rightbutton')); - } - ?> +} +?>
-
Your Group
+ usergroup == $this->requestgroup){ ?> +
Your Group
+ +
Group
+ group->getID(); ?> +
group->getTitle(); ?>
@@ -40,7 +41,7 @@ if($this->groupID) {
groupRequestList)){ @@ -55,12 +56,23 @@ if(isset($this->groupRequestList)){ ?>
+ usergroup == $this->requestgroup && (Pbs_Acl::checkRight('gam') || Pbs_Acl::checkRight('gdm'))){ + ?>
+
roleList); ?>
+ + + TODO +
+
getTitle(); ?> getFirstname(); ?> getName(); ?>
getCity(); ?>
@@ -69,12 +81,14 @@ if(isset($this->groupRequestList)){
- +
membersList)){ +if(isset($this->membersList) && Pbs_Acl::checkRight('gsmg')){ ?>

Members:

@@ -105,6 +119,9 @@ if(count($this->membersList)==0) ?>
+ usergroup == $this->requestgroup) || (Pbs_Acl::checkRight('gdmog') && $this->usergroup != $this->requestgroup)): + ?> Revoke Membership +
getFirstname(); ?> getName(); ?>
Role: getTitle(); ?>
-- cgit v1.2.3-55-g7522 From 85c7d1157407b132a9f0b71840f65d7ce0119abf Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 13 Apr 2011 14:10:26 +0200 Subject: Zweiter Teil der Rechte in Group Controller --- .../modules/user/controllers/GroupController.php | 41 ++++++++++++++-------- .../modules/user/views/scripts/group/show.phtml | 2 +- 2 files changed, 28 insertions(+), 15 deletions(-) (limited to 'application/modules/user/views/scripts/group') diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php index fb0d2a9..d9fd368 100644 --- a/application/modules/user/controllers/GroupController.php +++ b/application/modules/user/controllers/GroupController.php @@ -300,6 +300,10 @@ class User_GroupController extends Zend_Controller_Action public function deleteAction() { + // ACL delete a group + if(!Pbs_Acl::checkRight('gd')) + $this->_redirect('/user'); + $this->_helper->viewRenderer->setNoRender(); $groupID = $this->_request->getParam('groupID'); if(!isset($groupID)) { @@ -335,6 +339,10 @@ class User_GroupController extends Zend_Controller_Action public function grantpersonAction() { + // ACL grant a membership to request + if(!Pbs_Acl::checkRight('gam')) + $this->_redirect('/user'); + $this->_helper->viewRenderer->setNoRender(); if(isset($_POST['grouprequestID']) && isset($_POST['roleID'])) { $groupRequest = $this->groupRequestMapper->find($_POST['grouprequestID']); @@ -369,21 +377,26 @@ class User_GroupController extends Zend_Controller_Action public function revokepersonAction() { + $this->_helper->viewRenderer->setNoRender(); $membershipID = $this->_request->getParam('membershipID'); - if(isset($membershipID)) { - $membership = $this->membershipMapper->find($membershipID); - if(isset($membership)) { - try { - $this->membershipMapper->delete($membership); - } catch(Zend_Exception $e) - { - echo "Caught exception: " . get_class($e) . "
"; - echo "Message: " . $e->getMessage() . "
"; - return; + $rr = $this->membershipMapper->find($membershipID); + + if(($rr->getGroupID() == $this->membership->getGroupID && Pbs_Acl::checkRight('gdmo') ) || ( $rr->getGroupID() != $this->membership->getGroupID && Pbs_Acl::checkRight('gdmog'))){ + if(isset($membershipID)) { + $membership = $this->membershipMapper->find($membershipID); + if(isset($membership)) { + try { + $this->membershipMapper->delete($membership); + } catch(Zend_Exception $e) + { + echo "Caught exception: " . get_class($e) . "
"; + echo "Message: " . $e->getMessage() . "
"; + return; + } + $this->_redirect("/user/group/show/groupID/" . $membership->getGroupID()); } - $this->_redirect("/user/group/show/groupID/" . $membership->getGroupID()); - } - - } } + } + } + } } diff --git a/application/modules/user/views/scripts/group/show.phtml b/application/modules/user/views/scripts/group/show.phtml index 18bc33a..b2a85ac 100644 --- a/application/modules/user/views/scripts/group/show.phtml +++ b/application/modules/user/views/scripts/group/show.phtml @@ -1,4 +1,4 @@ -

Groupdetails

+

Groupdetails - group->getTitle();?>

usergroup == $this->requestgroup){ echo $this->formButton('deletegroup', 'Delete', array( -- cgit v1.2.3-55-g7522