diff options
author | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-17 13:34:19 +0000 |
---|---|---|
committer | marcus <marcus@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2009-02-17 13:34:19 +0000 |
commit | a017e1c400c70df49dd694c5f15194360160aed7 (patch) | |
tree | 4985340d18121681b2f3852134b66e9e870ed52a | |
parent | e6d744cc49f5cce8665de5cea9df6674ad47abb2 (diff) | |
download | elgg-a017e1c400c70df49dd694c5f15194360160aed7.tar.gz elgg-a017e1c400c70df49dd694c5f15194360160aed7.tar.bz2 |
Closes #786: Only basic profile information provided to non-joined users of closed groups.
git-svn-id: https://code.elgg.org/elgg/trunk@2780 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r-- | mod/groups/groupprofile.php | 27 | ||||
-rw-r--r-- | mod/groups/languages/en.php | 1 | ||||
-rw-r--r-- | mod/groups/views/default/groups/closedmembership.php | 15 |
3 files changed, 38 insertions, 5 deletions
diff --git a/mod/groups/groupprofile.php b/mod/groups/groupprofile.php index 431afb235..437685313 100644 --- a/mod/groups/groupprofile.php +++ b/mod/groups/groupprofile.php @@ -19,14 +19,31 @@ $title = $group->name;
+ // Hide some items from closed groups when the user is not logged in.
+ $view_all = true;
+
+ if (
+ ((!isloggedin()) && (!$group->isPublicMembership())) ||
+ ((!$group->isMember(get_loggedin_user()) && (!$group->isPublicMembership())))
+ )
+ $view_all = false;
+
+
$area2 = elgg_view_title($title);
$area2 .= elgg_view('group/group', array('entity' => $group, 'user' => $_SESSION['user'], 'full' => true));
- //group profile 'items' - these are not real widgets, just contents to display
- $area2 .= elgg_view('groups/profileitems',array('entity' => $group));
-
- //group members
- $area3 = elgg_view('groups/members',array('entity' => $group));
+ if ($view_all) {
+ //group profile 'items' - these are not real widgets, just contents to display
+ $area2 .= elgg_view('groups/profileitems',array('entity' => $group));
+
+ //group members
+ $area3 = elgg_view('groups/members',array('entity' => $group));
+ }
+ else
+ {
+ $area2 .= elgg_view('groups/closedmembership', array('entity' => $group, 'user' => $_SESSION['user'], 'full' => true));
+
+ }
$body = elgg_view_layout('two_column_left_sidebar', $area1, $area2, $area3);
} else { diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php index 3b678b16a..880dfcc66 100644 --- a/mod/groups/languages/en.php +++ b/mod/groups/languages/en.php @@ -64,6 +64,7 @@ 'groups:access:private' => 'Closed - Users must be invited',
'groups:access:public' => 'Open - Any user may join',
+ 'groups:closedgroup' => 'This group has a closed membership, please request to join.',
/*
Group tools
*/
diff --git a/mod/groups/views/default/groups/closedmembership.php b/mod/groups/views/default/groups/closedmembership.php new file mode 100644 index 000000000..129e20805 --- /dev/null +++ b/mod/groups/views/default/groups/closedmembership.php @@ -0,0 +1,15 @@ +<?php + /** + * Elgg groups plugin full profile view (for a closed group you haven't joined). + * + * @package ElggGroups + * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html GNU Public License version 2 + * @author Curverider + * @copyright Curverider Ltd 2008-2009 + * @link http://elgg.com/ + */ + +?> +<div id="groups_closed_membership"> + <p><?php echo elgg_echo('groups:closedgroup'); ?></p> +</div>
\ No newline at end of file |