Skip to content

Commit

Permalink
Only api_is_allowed_to_edit() users can create groups see BT#10948
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Mar 18, 2016
1 parent b1a5c91 commit ade8665
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main/group/group_creation.php
Expand Up @@ -10,6 +10,11 @@

// Notice for unauthorized people.
api_protect_course_script(true);

if (!api_is_allowed_to_edit(false, true)) {
api_not_allowed(true);
}

$currentUrl = api_get_path(WEB_CODE_PATH).'group/group.php?'.api_get_cidreq();

/* Create the groups */
Expand Down Expand Up @@ -73,10 +78,6 @@
$interbreadcrumb[] = array ('url' => 'group.php', 'name' => get_lang('Groups'));
Display :: display_header($nameTools, 'Group');

if (!api_is_allowed_to_edit(false, true)) {
api_not_allowed();
}

if (isset($_POST['number_of_groups'])) {
if (!is_numeric($_POST['number_of_groups']) || intval($_POST['number_of_groups']) < 1) {
Display :: display_error_message(
Expand Down

0 comments on commit ade8665

Please sign in to comment.