aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/actions/groups/edit.php
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-04 02:03:33 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2011-03-04 02:03:33 +0000
commitb83ab22d23d5c5d5e46ce64f1e1aea3056bfabc0 (patch)
tree546c0611f428bb5370ea1105858ce306c0fb71aa /mod/groups/actions/groups/edit.php
parent4bb42e5e8e425aae0ba0e668a06e752431fb1c35 (diff)
downloadelgg-b83ab22d23d5c5d5e46ce64f1e1aea3056bfabc0.tar.gz
elgg-b83ab22d23d5c5d5e46ce64f1e1aea3056bfabc0.tar.bz2
trying to make support for invisible groups a little saner
git-svn-id: http://code.elgg.org/elgg/trunk@8575 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/groups/actions/groups/edit.php')
-rw-r--r--mod/groups/actions/groups/edit.php43
1 files changed, 25 insertions, 18 deletions
diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php
index b3c39c461..331c80be0 100644
--- a/mod/groups/actions/groups/edit.php
+++ b/mod/groups/actions/groups/edit.php
@@ -60,23 +60,6 @@ if (!$group->name) {
forward(REFERER);
}
-// Group membership - should these be treated with same constants as access permissions?
-switch (get_input('membership')) {
- case ACCESS_PUBLIC:
- $group->membership = ACCESS_PUBLIC;
- break;
- default:
- $group->membership = ACCESS_PRIVATE;
-}
-
-// Set access - all groups are public from elgg's point of view, unless the override is in place
-if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
- $visibility = (int)get_input('vis', '', false);
-
- $group->access_id = $visibility;
-} else {
- $group->access_id = ACCESS_PUBLIC;
-}
// Set group tool options
if (isset($CONFIG->group_tool_options)) {
@@ -89,7 +72,20 @@ if (isset($CONFIG->group_tool_options)) {
}
$group->$group_option_toggle_name = get_input($group_option_toggle_name, $group_option_default_value);
}
-}
+}
+
+// Group membership - should these be treated with same constants as access permissions?
+switch (get_input('membership')) {
+ case ACCESS_PUBLIC:
+ $group->membership = ACCESS_PUBLIC;
+ break;
+ default:
+ $group->membership = ACCESS_PRIVATE;
+}
+
+if ($new_group_flag) {
+ $group->access_id = ACCESS_PUBLIC;
+}
$group->save();
@@ -100,7 +96,18 @@ if ($new_group_flag) {
add_to_river('river/group/create', 'create', $user->guid, $group->guid);
}
+// Invisible group support
+if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
+ $visibility = (int)get_input('vis', '', false);
+ if ($visibility != ACCESS_PUBLIC || $visibility != ACCESS_LOGGED_IN) {
+ $visibility = $group->group_acl;
+ }
+ if ($group->access_id != $visibility) {
+ $group->access_id = $visibility;
+ $group->save();
+ }
+}
// Now see if we have a file icon
if ((isset($_FILES['icon'])) && (substr_count($_FILES['icon']['type'],'image/'))) {