From: poltawski Date: Wed, 23 Jan 2008 13:27:47 +0000 (+0000) Subject: MDL-13107 - clean up data cvs import capability checks X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=ab496ca8e56b855c6f5757a37eedc40ab4c46000;p=moodle.git MDL-13107 - clean up data cvs import capability checks Removed bad check 'mod/data:uploadentries' (which doesn't exist), replaced it with mod/data:manageentries which is what is used to display the form for this page. Also removed the empty database redirect and editing entries checks as there no way to get to this point in the UI and capability check is covered by the manageentries requirecap (+ later sesskey check). merged from MOODLE_19_STABLE --- diff --git a/mod/data/import.php b/mod/data/import.php index c3ac8c73e0..f66faa9a52 100755 --- a/mod/data/import.php +++ b/mod/data/import.php @@ -60,20 +60,7 @@ require_login($course, false, $cm); $context = get_context_instance(CONTEXT_MODULE, $cm->id); - require_capability('mod/data:uploadentries', $context); - - if (has_capability('mod/data:managetemplates', $context)) { - if (!count_records('data_fields','dataid',$data->id)) { // Brand new database! - redirect($CFG->wwwroot.'/mod/data/field.php?d='.$data->id); // Redirect to field entry - } - } - - if ($rid){ //editting a record, do you have access to edit this? - if (!has_capability('mod/data:manageentries', $context) or !data_isowner($rid) or !confirm_sesskey()){ - error (get_string('noaccess','data')); - } - } - + require_capability('mod/data:manageentries', $context); /// Print the page header $strdata = get_string('modulenameplural','data');