Skip to content

Commit

Permalink
MDL-24064 disabling bulk enrol for now, it needs to be rewritten a bi…
Browse files Browse the repository at this point in the history
…t; fixing incorrect sue of PARAM_CLEAN
  • Loading branch information
skodak committed Sep 2, 2010
1 parent 7e4341f commit ceb6547
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion admin/user/user_bulk.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
case 3: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_delete.php');
case 4: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_display.php');
case 5: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_download.php');
case 6: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_enrol.php');
//case 6: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_enrol.php'); //TODO: MDL-24064
case 7: redirect($CFG->wwwroot.'/'.$CFG->admin.'/user/user_bulk_forcepasswordchange.php');
}
}
Expand Down
9 changes: 6 additions & 3 deletions admin/user/user_bulk_enrol.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
/**
* script for bulk user multy enrol operations
*/

die('this needs to be rewritten to use new enrol framework, sorry'); //TODO: MDL-24064

require_once('../../config.php');
require_once($CFG->libdir.'/adminlib.php');
$processed = optional_param('processed', '', PARAM_CLEAN);
Expand Down Expand Up @@ -75,7 +78,7 @@ function sort_compare($a, $b) {
for ( $i = 0; $i < $total; $i++ )
{
$param = "selected".$i;
$info = optional_param($param, '', PARAM_CLEAN);
$info = optional_param($param, '', PARAM_SEQUENCE);
/**
* user id: ids[0]
* course id: ids[1]
Expand All @@ -84,7 +87,7 @@ function sort_compare($a, $b) {
$ids = explode(',', $info);
if(!empty($ids[2])) {
$context = get_context_instance(CONTEXT_COURSE, $ids[1]);
role_assign(5, $ids[0], $context->id);
role_assign(5, $ids[0], $context->id); //TODO: horrible!!
} else {
if( empty($ids[1] ) ) {
continue;
Expand All @@ -93,7 +96,7 @@ function sort_compare($a, $b) {
role_unassign(5, $ids[0], $context->id);
}
}
redirect($return, get_string('changessaved'));
redirect($return, get_string('changessaved')); //TODO: horrible!!
}

//Form beginning
Expand Down
5 changes: 3 additions & 2 deletions admin/user/user_bulk_forms.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ function definition() {
if (has_capability('moodle/user:update', $syscontext)) {
$actions[5] = get_string('download', 'admin');
}
if (has_capability('moodle/role:assign', $syscontext)){ //TODO: use some enrol cap
$actions[6] = get_string('enrolmultipleusers', 'admin');
if (has_capability('moodle/role:assign', $syscontext)){
//TODO: MDL-24064
//$actions[6] = get_string('enrolmultipleusers', 'admin');
}
if (has_capability('moodle/user:update', $syscontext)) {
$actions[7] = get_string('forcepasswordchange');
Expand Down

0 comments on commit ceb6547

Please sign in to comment.