aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/actions
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-08-04 01:50:01 +0200
committerSem <sembrestels@riseup.net>2012-08-04 01:50:01 +0200
commit18df06b9cd34c62dd8e9b1dfffd2f75e2815d859 (patch)
treee880bce8a7b10a6b3bc8c60168bc5ab35acf40f8 /mod/groups/actions
parent71edfd80a0baf95b86a29547252b01973511828f (diff)
parent4dd2ca9d54b64ebbf5eba3e3036f747cadb40825 (diff)
downloadelgg-18df06b9cd34c62dd8e9b1dfffd2f75e2815d859.tar.gz
elgg-18df06b9cd34c62dd8e9b1dfffd2f75e2815d859.tar.bz2
Merge branch 'translations-fallback-js' of git://github.com/sembrestels/Elgg into lorea-preprod
Conflicts: mod/developers/views/default/theme_preview/grid.php
Diffstat (limited to 'mod/groups/actions')
-rw-r--r--mod/groups/actions/groups/edit.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/mod/groups/actions/groups/edit.php b/mod/groups/actions/groups/edit.php
index b513a6098..df2464a65 100644
--- a/mod/groups/actions/groups/edit.php
+++ b/mod/groups/actions/groups/edit.php
@@ -15,6 +15,8 @@ function profile_array_decoder(&$v) {
$v = html_entity_decode($v, ENT_COMPAT, 'UTF-8');
}
+elgg_make_sticky_form('groups');
+
// Get group fields
$input = array();
foreach ($CONFIG->group as $shortname => $valuetype) {
@@ -39,10 +41,14 @@ $user = elgg_get_logged_in_user_entity();
$group_guid = (int)get_input('group_guid');
$new_group_flag = $group_guid == 0;
+if ($new_group_flag && elgg_get_plugin_setting('limited_groups', 'groups') == 'yes' && !elgg_is_admin_logged_in()) {
+ register_error(elgg_echo("groups:cantcreate"));
+ forward(REFERER);
+}
+
$group = new ElggGroup($group_guid); // load if present, if not create a new group
if (($group_guid) && (!$group->canEdit())) {
register_error(elgg_echo("groups:cantedit"));
-
forward(REFERER);
}
@@ -106,6 +112,9 @@ if (elgg_get_plugin_setting('hidden_groups', 'groups') == 'yes') {
$group->save();
+// group saved so clear sticky form
+elgg_clear_sticky_form('groups');
+
// group creator needs to be member of new group and river entry created
if ($new_group_flag) {
elgg_set_page_owner_guid($group->guid);