aboutsummaryrefslogtreecommitdiff
path: root/mod/groups
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-21 20:51:26 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-08-21 20:51:26 +0000
commit64aafb5ca73d329663a93f80ac9cf3e68a082866 (patch)
treef6462c3112d26aea2ad09cdb76b38abb74183757 /mod/groups
parentc3cbea030adb2201e29897915bfae19f1628c967 (diff)
downloadelgg-64aafb5ca73d329663a93f80ac9cf3e68a082866.tar.gz
elgg-64aafb5ca73d329663a93f80ac9cf3e68a082866.tar.bz2
Merged r6534-6559 from 1.7 branch to trunk
git-svn-id: http://code.elgg.org/elgg/trunk@6840 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups')
-rw-r--r--mod/groups/languages/en.php2
-rw-r--r--mod/groups/start.php22
-rw-r--r--mod/groups/views/default/groups/grouplisting.php2
3 files changed, 11 insertions, 15 deletions
diff --git a/mod/groups/languages/en.php b/mod/groups/languages/en.php
index 58a6c7f31..7ecd00f57 100644
--- a/mod/groups/languages/en.php
+++ b/mod/groups/languages/en.php
@@ -133,7 +133,7 @@ $english = array(
'grouptopic:error' => 'Your group topic could not be created. Please try again or contact a system administrator.',
'groups:forumpost:edited' => "You have successfully edited the forum post.",
'groups:forumpost:error' => "There was a problem editing the forum post.",
- 'groups:privategroup' => 'This group is private, requesting membership.',
+ 'groups:privategroup' => 'This group is closed. Requesting membership.',
'groups:notitle' => 'Groups must have a title',
'groups:cantjoin' => 'Can not join group',
'groups:cantleave' => 'Could not leave group',
diff --git a/mod/groups/start.php b/mod/groups/start.php
index 3278b6682..215311ef9 100644
--- a/mod/groups/start.php
+++ b/mod/groups/start.php
@@ -356,20 +356,18 @@
}
/**
- * Groups created, so add users to access lists.
+ * Groups created so create an access list for it
*/
function groups_create_event_listener($event, $object_type, $object)
{
- //if (($event == 'create') && ($object_type == 'group') && ($object instanceof ElggGroup))
- //{
- $group_id = create_access_collection(elgg_echo('groups:group') . ": " . $object->name);
- if ($group_id)
- {
- $object->group_acl = $group_id;
- }
- else
- return false;
- //}
+ $ac_name = elgg_echo('groups:group') . ": " . $object->name;
+ $group_id = create_access_collection($ac_name, $object->guid);
+ if ($group_id) {
+ $object->group_acl = $group_id;
+ } else {
+ // delete group if access creation fails
+ return false;
+ }
return true;
}
@@ -459,7 +457,6 @@
add_user_to_access_collection($user->guid, $acl);
return true;
-
}
/**
@@ -475,7 +472,6 @@
remove_user_from_access_collection($user->guid, $acl);
return true;
-
}
/**
diff --git a/mod/groups/views/default/groups/grouplisting.php b/mod/groups/views/default/groups/grouplisting.php
index 48a7b1ace..687aebfa0 100644
--- a/mod/groups/views/default/groups/grouplisting.php
+++ b/mod/groups/views/default/groups/grouplisting.php
@@ -19,7 +19,7 @@ $icon = elgg_view(
//get the membership type
$membership = $vars['entity']->membership;
-if($membership == 2) {
+if($membership == ACCESS_PUBLIC) {
$mem = elgg_echo("groups:open");
} else {
$mem = elgg_echo("groups:closed");