mirror of
https://github.com/moodle/moodle.git
synced 2025-02-24 03:53:49 +01:00
- required_param calls - added parameter type. - put 'require' first. - use @header, added charset. (Bug MDL-7380 "groups".)
27 lines
687 B
PHP
27 lines
687 B
PHP
<?php
|
|
/**********************************************
|
|
* Deletes a specified grouping
|
|
**********************************************/
|
|
|
|
require_once('../../config.php');
|
|
require_once('../lib/lib.php');
|
|
|
|
@header('Content-Type: text/xml; charset=utf-8');
|
|
echo '<?xml version="1.0" encoding="utf-8"?>';
|
|
echo '<groupsresponse>';
|
|
|
|
$groupingid = required_param('groupingid', PARAM_INT);
|
|
$courseid = required_param('courseid', PARAM_INT);
|
|
|
|
require_login($courseid);
|
|
|
|
if (confirm_sesskey() and isteacheredit($courseid)) {
|
|
$groupingremoved = groups_delete_grouping($groupingid);
|
|
if (!$groupingremoved) {
|
|
echo '<error>Failed to delete grouping</error>';
|
|
}
|
|
}
|
|
|
|
echo '</groupsresponse>';
|
|
?>
|