]> git.mjollnir.org Git - moodle.git/commitdiff
Bug #5927 - extending enrollments doesn't; merged from MOODLE_16_STABLE
authorskodak <skodak>
Mon, 26 Jun 2006 21:58:35 +0000 (21:58 +0000)
committerskodak <skodak>
Mon, 26 Jun 2006 21:58:35 +0000 (21:58 +0000)
user/extendenrol.php

index 9064ff58f4dca1e9c0dcfb5c334c26e84fe0f7b2..56e9d400d431e3eb628f27d3098dc4b806fc2031 100644 (file)
@@ -1,8 +1,8 @@
-<?php
+<?php  // $Id$
 require_once("../config.php");
 
-$id         = required_param('id',     PARAM_INT);   // course id
-$users      = optional_param('userid', PARAM_RAW);   // array of user id
+$id    = required_param('id', PARAM_INT);              // course id
+$users = optional_param('userid', array(), PARAM_INT); // array of user id
 
 if (! $course = get_record('course', 'id', $id)) {
     error("Course ID is incorrect");
@@ -14,7 +14,7 @@ if (!isteacheredit($course->id)) {
     error("You must be an editing teacher in this course, or an admin");
 }
 
-if ($users && ($form = data_submitted() and confirm_sesskey())) {
+if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) {
     if (count($form->userid) != count($form->extendperiod)) {
         error('Parameters malformation', $CFG->wwwroot.'/user/index.php?id='.$id);
     }