diff options
| author | cash <cash.costello@gmail.com> | 2011-10-04 22:35:56 -0400 | 
|---|---|---|
| committer | cash <cash.costello@gmail.com> | 2011-10-04 22:35:56 -0400 | 
| commit | 183bdea42db704a6c1b25b8f03059302b0a3fb02 (patch) | |
| tree | dbce79eab6d153e932f2076fa45ecef4070fd056 | |
| parent | b4e997377b0d571eb7565fe75b7bd26aa28a33e9 (diff) | |
| download | elgg-183bdea42db704a6c1b25b8f03059302b0a3fb02.tar.gz elgg-183bdea42db704a6c1b25b8f03059302b0a3fb02.tar.bz2 | |
Fixes #3841 not displaying leave group button to group owners
| -rw-r--r-- | mod/groups/lib/groups.php | 10 | 
1 files changed, 6 insertions, 4 deletions
| diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php index 460eab656..4e2b045a6 100644 --- a/mod/groups/lib/groups.php +++ b/mod/groups/lib/groups.php @@ -431,10 +431,12 @@ function groups_register_profile_buttons($group) {  	// group members  	if ($group->isMember($user)) { -		// leave -		$url = elgg_get_site_url() . "action/groups/leave?group_guid={$group->getGUID()}"; -		$url = elgg_add_action_tokens_to_url($url); -		$actions[$url] = 'groups:leave'; +		if ($group->getOwnerGUID() != elgg_get_logged_in_user_guid()) { +			// leave +			$url = elgg_get_site_url() . "action/groups/leave?group_guid={$group->getGUID()}"; +			$url = elgg_add_action_tokens_to_url($url); +			$actions[$url] = 'groups:leave'; +		}  	} elseif (elgg_is_logged_in()) {  		// join - admins can always join.  		$url = elgg_get_site_url() . "action/groups/join?group_guid={$group->getGUID()}"; | 
