Permalink
Browse files

Fixes:

  - required_param calls - added parameter type.
  - put 'require' first.
  - use @Header, added charset.
(Bug MDL-7380 "groups".)
  • Loading branch information...
nfreear
nfreear committed Nov 8, 2006
1 parent 1059371 commit 7fd4d8d0efa099c7e7ebd6b74e517272acafcab0
@@ -1,18 +1,22 @@
<?php
/**********************************************
* Adds an existing group to a grouping
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
/**
* Adds an existing group to a grouping.
*
* @copyright &copy; 2006 The Open University
* @author J.White AT open.ac.uk
* @license http://www.gnu.org/copyleft/gpl.html GNU Public License
* @package groups
*/
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>';
$courseid = required_param('courseid', PARAM_INT);
$groupingid = required_param('groupingid', PARAM_INT);
$groups = required_param('groups');
$courseid = required_param('courseid', PARAM_INT);
$groups = required_param('groups', PARAM_SEQUENCE); //TODO: check.
require_login($courseid);
@@ -2,17 +2,17 @@
/**********************************************
* Adds users to a group
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
require_once('../../config.php');
require_once('../lib/lib.php');
$groupid = required_param('groupid', PARAM_INT);
$users = required_param('users');
@header('Content-Type: text/xml; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<groupsresponse>';
$courseid = required_param('courseid', PARAM_INT);
$groupid = required_param('groupid', PARAM_INT);
$users = required_param('users', PARAM_SEQUENCE);
require_login($courseid);
@@ -3,30 +3,30 @@
* Sets up an automatic grouping
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
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>';
require_login($courseid);
groups_seed_random_number_generator();
$courseid = required_param('courseid', PARAM_INT);
$courseid = required_param('courseid', PARAM_INT);
$noofstudents = required_param('noofstudents', PARAM_INT);
$noofgroups = required_param('noofgroups', PARAM_INT);
$distribevenly = required_param('distribevenly');
$alphabetical = required_param('alphabetical');
$generationtype = required_param('generationtype');
$distribevenly = required_param('distribevenly', PARAM_INT); //TODO: PARAM_BOOL ?
$alphabetical = required_param('alphabetical', PARAM_INT);
$generationtype = required_param('generationtype', PARAM_ALPHA);
$groupingsettings->name =required_param('name');
$groupingsettings->description = required_param('description');
$groupingsettings->name = required_param('name', PARAM_ALPHANUM);
$groupingsettings->description = required_param('description', PARAM_ALPHANUM);
$groupingsettings->prefix = required_param('prefix');
$groupingsettings->defaultgroupdescription = required_param('defaultgroupdescription');
if (confirm_sesskey() and isteacheredit($courseid)) {
if ($generationtype == 'nogroups') {
@@ -1,20 +1,21 @@
<div id="creategroupform" class="popup">
<h3><?php print_string('creategroup', 'group'); ?> <span id="selectedgroupingforcreatinggroup"></span></h3>
<form action="">
<p><?php print_string('groupname', 'groups');?></p>
<p><label for="newgroupname"><?php print_string('groupname', 'group'); ?></label></p>
<p><input id="newgroupname" type="text" size="40" value="<?php print_string('defaultgroupname', 'group'); ?>" />
<p><?php print_string("groupingdescription", 'groups') ?><br />
<p><?php print_string('groupingdescription', 'group'); ?><br />
<?php helpbutton("text", get_string("helptext")) ?></p>
<p><?php print_textarea($usehtmleditor, 5, 45, 200, 400, "newgroupdescription");?></p>
<p><?php print_string('enrolmentkey', 'groups') ?></p>
<p><?php print_string('enrolmentkey', 'group'); ?></p>
<p><input type="text" id="newgroupenrolmentkey" size="25" /></p>
<?php if ($printuploadpicture) { ?>
<p><?php print_string('hidepicture', 'groups') ?></p>
<p><?php $options = NULL; $options[0] = get_string("no"); $options[1] = get_string("yes");
choose_from_menu ($options, "newgrouphidepicture", $group->hidepicture, "");?>
></p>
<p><?php print_string('hidepicture', 'group'); ?></p>
<p><?php $options = NULL; $options[0] = get_string("no");
$options[1] = get_string("yes");
$group->hidepicture = 1;
choose_from_menu ($options, "newgrouphidepicture", isset($group)? $group->hidepicture: 1, '');?></p>
<p><?php print_string("newpicture", 'groups') ?></p>
<p><?php print_string('newpicture', 'group'); ?></p>
<p><?php upload_print_form_fragment(1,array('newgroupicon'),null,false,null,0,0,false);
helpbutton("picture", get_string("helppicture"));
print_string("maxsize", "", display_size($maxbytes), 'group'); ?>
@@ -2,20 +2,22 @@
/**********************************************
* Adds a new group to a grouping
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
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>';
$courseid = required_param('courseid', PARAM_INT);
$groupingid = required_param('groupingid', PARAM_INT);
$groupsettings->name = required_param('groupname');
$courseid = required_param('courseid', PARAM_INT);
$groupsettings->description = required_param('description');
$groupsettings->enrolmentkey = required_param('enrolmentkey', PARAM_ALPHANUM);
$groupsettings->hidepicture = optional_param('hidepicture');
$groupsettings->name = required_param('groupname', PARAM_ALPHANUM);
$groupsettings->description = required_param('description', PARAM_ALPHANUM);
$groupsettings->enrolmentkey= required_param('enrolmentkey', PARAM_ALPHANUM);
$groupsettings->hidepicture = optional_param('hidepicture', PARAM_INT);
require_login($courseid);
@@ -2,18 +2,18 @@
/**********************************************
* Adds a new grouping
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
require_once('../../config.php');
require_once('../lib/lib.php');
$courseid= required_param('courseid', PARAM_INT);
@header('Content-Type: text/xml; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<groupsresponse>';
$courseid = required_param('courseid', PARAM_INT);
$groupingsettings->name =required_param('groupingname');
$groupingsettings->description = required_param('description');
$groupingsettings->name = required_param('groupingname', PARAM_ALPHANUM);
$groupingsettings->description= required_param('description', PARAM_ALPHANUM);
require_login($courseid);
@@ -2,14 +2,15 @@
/**********************************************
* Deletes a group
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
require_once('../../config.php');
require_once('../lib/lib.php');
$groupid = required_param('groupid', PARAM_INT);
@header('Content-Type: text/xml; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<groupsresponse>';
$groupid = required_param('groupid', PARAM_INT);
$courseid = required_param('courseid', PARAM_INT);
require_login($courseid);
@@ -3,15 +3,15 @@
* Deletes a specified grouping
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
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);
$courseid = required_param('courseid', PARAM_INT);
require_login($courseid);
@@ -2,22 +2,23 @@
/**********************************************
* Adds a new grouping
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
require_once('../../config.php');
require_once('../lib/lib.php');
$groupingid = required_param('groupingid');
$courseid = required_param('courseid', PARAM_INT);
$groupingsettings->viewowngroup = required_param('viewowngroup');
$groupingsettings->viewallgroupsmembers = required_param('viewallgroupsmembers');
$groupingsettings->viewallgroupsactivities = required_param('viewallgroupsactivities');
$groupingsettings->teachersgroupmark = required_param('teachersgroupmark');
$groupingsettings->teachersgroupview = required_param('teachersgroupview');
$groupingsettings->teachersoverride = required_param('teachersoverride');
@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);
$groupingsettings->viewowngroup = required_param('viewowngroup', PARAM_INT); //TODO: PARAM_BOOL ??
$groupingsettings->viewallgroupsmembers = required_param('viewallgroupsmembers', PARAM_INT);
$groupingsettings->viewallgroupsactivities = required_param('viewallgroupsactivities', PARAM_INT);
$groupingsettings->teachersgroupmark = required_param('teachersgroupmark', PARAM_INT);
$groupingsettings->teachersgroupview = required_param('teachersgroupview', PARAM_INT);
$groupingsettings->teachersoverride = required_param('teachersoverride', PARAM_INT);
require_login($courseid);
@@ -2,18 +2,19 @@
/**********************************************
* Adds a new grouping
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
require_once('../../config.php');
require_once('../lib/lib.php');
$groupingid = required_param('groupingid');
$courseid = required_param('courseid', PARAM_INT);
$groupingsettings->name =required_param('groupingname');
$groupingsettings->description = required_param('description');
@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);
$groupingsettings->name = required_param('groupingname', PARAM_ALPHANUM);
$groupingsettings->description= required_param('description', PARAM_ALPHANUM);
require_login($courseid);
@@ -3,18 +3,19 @@
* Adds a new grouping
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
require_once('../../config.php');
require_once('../lib/lib.php');
$groupid = required_param('groupid');
$groupname = required_param('groupname');
$description = required_param('description');
$enrolmentkey = required_param('enrolmentkey');
$hidepicture = required_param('hidepicture');
$courseid = required_param('courseid', PARAM_INT);
@header('Content-Type: text/xml; charset=utf-8');
echo '<?xml version="1.0" encoding="utf-8"?>';
echo '<groupsresponse>';
$groupid = required_param('groupid', PARAM_INT);
$groupname = required_param('groupname', PARAM_ALPHANUM);
$description = required_param('description', PARAM_ALPHANUM);
$enrolmentkey= required_param('enrolmentkey', PARAM_ALPHANUM);
$hidepicture = required_param('hidepicture', PARAM_INT); //TODO: PARAM_BOOL ??
$courseid = required_param('courseid', PARAM_INT);
require_login($courseid);
@@ -4,15 +4,14 @@
* them in an XML format
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
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>';
$courseid = required_param('courseid', PARAM_INT);
$courseid = required_param('courseid', PARAM_INT);
$groupingid = required_param('groupingid', PARAM_INT);
require_login($courseid);
@@ -4,12 +4,12 @@
* and returns them in an XML format
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
require_once('../../config.php');
require_once('../lib/lib.php');
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>';
$courseid = required_param('courseid', PARAM_INT);
@@ -3,16 +3,15 @@
* Fetches the settings of a grouping and returns
* them in an XML format
**********************************************/
header("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>";
echo '<groupsresponse>';
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>';
$courseid = required_param('courseid', PARAM_INT);
$courseid = required_param('courseid', PARAM_INT);
$groupingid = required_param('groupingid', PARAM_INT);
require_login($courseid);
Oops, something went wrong.

0 comments on commit 7fd4d8d

Please sign in to comment.