aboutsummaryrefslogtreecommitdiff
path: root/mod/groups/lib/groups.php
diff options
context:
space:
mode:
authorSem <sembrestels@riseup.net>2012-07-08 12:21:19 +0200
committerSem <sembrestels@riseup.net>2012-07-08 12:21:19 +0200
commit8c0897d92395d897a8e40a2d1b97e5f838520296 (patch)
tree53f85cefb13bdc377bef6585144a812507c356d6 /mod/groups/lib/groups.php
parent7fd67bc8ac6882f1a73aa7f8f907cd6c2a694272 (diff)
downloadelgg-8c0897d92395d897a8e40a2d1b97e5f838520296.tar.gz
elgg-8c0897d92395d897a8e40a2d1b97e5f838520296.tar.bz2
Fixes #1792. Added pluggin setting in groups to set who can create groups, logged in users or only admins.
Diffstat (limited to 'mod/groups/lib/groups.php')
-rw-r--r--mod/groups/lib/groups.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/mod/groups/lib/groups.php b/mod/groups/lib/groups.php
index 51ae89a87..dfbb1154b 100644
--- a/mod/groups/lib/groups.php
+++ b/mod/groups/lib/groups.php
@@ -12,7 +12,9 @@ function groups_handle_all_page() {
elgg_pop_breadcrumb();
elgg_push_breadcrumb(elgg_echo('groups'));
- elgg_register_title_button();
+ if (elgg_get_plugin_setting('limited_groups', 'groups') != 'yes' || elgg_is_admin_logged_in()) {
+ elgg_register_title_button();
+ }
$selected_tab = get_input('filter', 'newest');
@@ -184,7 +186,11 @@ function groups_handle_edit_page($page, $guid = 0) {
elgg_set_page_owner_guid(elgg_get_logged_in_user_guid());
$title = elgg_echo('groups:add');
elgg_push_breadcrumb($title);
- $content = elgg_view('groups/edit');
+ if (elgg_get_plugin_setting('limited_groups', 'groups') != 'yes' || elgg_is_admin_logged_in()) {
+ $content = elgg_view('groups/edit');
+ } else {
+ $content = elgg_echo('groups:cantcreate');
+ }
} else {
$title = elgg_echo("groups:edit");
$group = get_entity($guid);