Skip to content

Commit

Permalink
Merge branch 'MDL-29895' of https://github.com/enovation/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Oct 9, 2018
2 parents 25fe592 + 458453c commit 609c73b
Show file tree
Hide file tree
Showing 46 changed files with 2 additions and 93 deletions.
4 changes: 0 additions & 4 deletions admin/filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
$action = optional_param('action', '', PARAM_ALPHA);
$filterpath = optional_param('filterpath', '', PARAM_PLUGIN);

require_login();
$systemcontext = context_system::instance();
require_capability('moodle/site:config', $systemcontext);

admin_externalpage_setup('managefilters');

// Clean up bogus filter states first.
Expand Down
3 changes: 0 additions & 3 deletions admin/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
// This is an admin page
admin_externalpage_setup('managemessageoutputs');

// Require site configuration capability
require_capability('moodle/site:config', context_system::instance());

// Get the submitted params
$disable = optional_param('disable', 0, PARAM_INT);
$enable = optional_param('enable', 0, PARAM_INT);
Expand Down
2 changes: 0 additions & 2 deletions admin/mnet/access_control.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
$perpage = optional_param('perpage', 30, PARAM_INT);
$action = trim(strtolower(optional_param('action', '', PARAM_ALPHA)));

require_login();

admin_externalpage_setup('ssoaccesscontrol');

if (!extension_loaded('openssl')) {
Expand Down
2 changes: 0 additions & 2 deletions admin/mnet/delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@
$hostid = required_param('hostid', PARAM_INT);


require_login();

$context = context_system::instance();
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");

$mnet = get_mnet_environment();

Expand Down
2 changes: 0 additions & 2 deletions admin/mnet/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');

require_login();
admin_externalpage_setup('net');

$context = context_system::instance();

require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");

$site = get_site();
$mnet = get_mnet_environment();
Expand Down
4 changes: 0 additions & 4 deletions admin/mnet/peers.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
require_once($CFG->dirroot.'/mnet/lib.php');
require_once($CFG->dirroot.'/'.$CFG->admin.'/mnet/peer_forms.php');

require_login();

$context = context_system::instance();
require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');

/// Initialize variables.
$hostid = optional_param('hostid', 0, PARAM_INT);
Expand Down
4 changes: 0 additions & 4 deletions admin/mnet/profilefields.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@
require_once($CFG->dirroot . '/' . $CFG->admin .'/mnet/profilefields_form.php');
$mnet = get_mnet_environment();

require_login();
$hostid = required_param('hostid', PARAM_INT);
$mnet_peer = new mnet_peer();
$mnet_peer->set_id($hostid);

$context = context_system::instance();

require_capability('moodle/site:config', $context, $USER->id, true, 'nopermissions');
admin_externalpage_setup('mnetpeers');
$form = new mnet_profile_form(null, array('hostid' => $hostid));

Expand Down
3 changes: 0 additions & 3 deletions admin/mnet/services.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@
require_once($CFG->dirroot . '/' . $CFG->admin . '/mnet/services_form.php');
$mnet = get_mnet_environment();

require_login();
admin_externalpage_setup('mnetpeers');

$context = context_system::instance();
require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");

$hostid = required_param('hostid', PARAM_INT);

Expand Down
4 changes: 0 additions & 4 deletions admin/mnet/testclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,8 @@
print_error('mnetdisabled', 'mnet');
}

require_login();
admin_externalpage_setup('mnettestclient');

$context = context_system::instance();
require_capability('moodle/site:config', $context);

error_reporting(DEBUG_ALL);

echo $OUTPUT->header();
Expand Down
4 changes: 0 additions & 4 deletions admin/mnet/trustedhosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
require_once($CFG->libdir.'/adminlib.php');
include_once($CFG->dirroot.'/mnet/lib.php');

require_login();
admin_externalpage_setup('trustedhosts');

$context = context_system::instance();

require_capability('moodle/site:config', $context, $USER->id, true, "nopermissions");

if (!extension_loaded('openssl')) {
echo $OUTPUT->header();
Expand Down
2 changes: 0 additions & 2 deletions admin/portfolio.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@

admin_externalpage_setup($pagename);

require_capability('moodle/site:config', context_system::instance());

$baseurl = "$CFG->wwwroot/$CFG->admin/portfolio.php";
$sesskeyurl = "$CFG->wwwroot/$CFG->admin/portfolio.php?sesskey=" . sesskey();
$configstr = get_string('manageportfolios', 'portfolio');
Expand Down
1 change: 0 additions & 1 deletion admin/qtypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
require_once($CFG->libdir . '/tablelib.php');

// Check permissions.
require_login();
$systemcontext = context_system::instance();
require_capability('moodle/question:config', $systemcontext);
$canviewreports = has_capability('report/questioninstances:view', $systemcontext);
Expand Down
1 change: 0 additions & 1 deletion admin/repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
$visible = false;
}

require_capability('moodle/site:config', context_system::instance());
admin_externalpage_setup($pagename);

$sesskeyurl = $CFG->wwwroot.'/'.$CFG->admin.'/repository.php?sesskey=' . sesskey();
Expand Down
1 change: 0 additions & 1 deletion admin/repositoryinstance.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
}

admin_externalpage_setup($pagename, '', null, new moodle_url('/admin/repositoryinstance.php'));
require_capability('moodle/site:config', $context);

$baseurl = new moodle_url("/$CFG->admin/repositoryinstance.php", array('sesskey'=>sesskey()));

Expand Down
1 change: 0 additions & 1 deletion admin/roles/define.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@

// Check access permissions.
$systemcontext = context_system::instance();
require_login();
require_capability('moodle/role:manage', $systemcontext);
admin_externalpage_setup('defineroles', '', array('action' => $action, 'roleid' => $roleid), new moodle_url('/admin/roles/define.php'));

Expand Down
1 change: 0 additions & 1 deletion admin/roles/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@

// Check access permissions.
$systemcontext = context_system::instance();
require_login();
require_capability('moodle/role:manage', $systemcontext);
admin_externalpage_setup('defineroles');

Expand Down
1 change: 0 additions & 1 deletion admin/tool/dbtransfer/dbexport.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
require_once('locallib.php');
require_once('database_export_form.php');

require_login();
admin_externalpage_setup('tooldbexport');

// Create form.
Expand Down
1 change: 0 additions & 1 deletion admin/tool/dbtransfer/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
require_once('locallib.php');
require_once('database_transfer_form.php');

require_login();
admin_externalpage_setup('tooldbtransfer');

// Create the form.
Expand Down
3 changes: 0 additions & 3 deletions admin/tool/health/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@

$solution = optional_param('solution', 0, PARAM_PLUGIN);

require_login();
require_capability('moodle/site:config', context_system::instance());

$site = get_site();

echo $OUTPUT->header();
Expand Down
3 changes: 0 additions & 3 deletions admin/tool/httpsreplace/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@

$context = context_system::instance();

require_login();
require_capability('moodle/site:config', $context);

$PAGE->set_context($context);
$PAGE->set_url(new moodle_url('/admin/tool/httpsreplace/index.php'));
$PAGE->set_title(get_string('pageheader', 'tool_httpsreplace'));
Expand Down
3 changes: 0 additions & 3 deletions admin/tool/httpsreplace/tool.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@

$context = context_system::instance();

require_login();
require_capability('moodle/site:config', $context);

$PAGE->set_context($context);
$PAGE->set_url(new moodle_url('/admin/tool/httpsreplace/index.php'));
$PAGE->set_title(get_string('pageheader', 'tool_httpsreplace'));
Expand Down
2 changes: 0 additions & 2 deletions admin/tool/innodb/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@

$confirm = optional_param('confirm', 0, PARAM_BOOL);

require_login();
require_capability('moodle/site:config', context_system::instance());

echo $OUTPUT->header();
echo $OUTPUT->heading('Convert all MySQL tables from MYISAM to InnoDB');
Expand Down
3 changes: 0 additions & 3 deletions admin/tool/log/store/database/test_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
require_once('../../../../../config.php');
require_once($CFG->dirroot . '/lib/adminlib.php');

require_login();
$context = context_system::instance();
require_capability('moodle/site:config', $context);
require_sesskey();

navigation_node::override_active_url(new moodle_url('/admin/settings.php', array('section' => 'logsettingdatabase')));
Expand Down
1 change: 0 additions & 1 deletion admin/tool/monitor/managerules.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@

// Validate course id.
if (empty($courseid)) {
require_login();
$context = context_system::instance();
$coursename = format_string($SITE->fullname, true, array('context' => $context));
$PAGE->set_context($context);
Expand Down
1 change: 0 additions & 1 deletion admin/tool/spamcleaner/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
$reset = optional_param('reset', '', PARAM_RAW);
$id = optional_param('id', '', PARAM_INT);

require_login();
admin_externalpage_setup('toolspamcleaner');

// Delete one user
Expand Down
2 changes: 0 additions & 2 deletions admin/tool/unsuproles/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@

$action = optional_param('action', '', PARAM_ALPHANUMEXT);

$syscontext = context_system::instance();

require_login();
admin_externalpage_setup('toolunsuproles'); // checks permissions specified in settings.php

if ($action === 'delete') {
Expand Down
1 change: 0 additions & 1 deletion admin/tool/uploaduser/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
core_php_time_limit::raise(60*60); // 1 hour should be enough
raise_memory_limit(MEMORY_HUGE);

require_login();
admin_externalpage_setup('tooluploaduser');
require_capability('moodle/site:uploadusers', context_system::instance());

Expand Down
2 changes: 0 additions & 2 deletions admin/tool/uploaduser/picture.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@

admin_externalpage_setup('tooluploaduserpictures');

require_login();

require_capability('tool/uploaduser:uploaduserpictures', context_system::instance());

$site = get_site();
Expand Down
2 changes: 0 additions & 2 deletions admin/tool/xmldb/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@
// Some previous checks
$site = get_site();

require_login();
require_capability('moodle/site:config', context_system::instance());

// Body of the script, based on action, we delegate the work
$action = optional_param ('action', 'main_view', PARAM_ALPHAEXT);
Expand Down
1 change: 0 additions & 1 deletion admin/user/user_bulk_confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

$confirm = optional_param('confirm', 0, PARAM_BOOL);

require_login();
admin_externalpage_setup('userbulk');
require_capability('moodle/user:update', context_system::instance());

Expand Down
1 change: 0 additions & 1 deletion admin/user/user_bulk_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

$confirm = optional_param('confirm', 0, PARAM_BOOL);

require_login();
admin_externalpage_setup('userbulk');
require_capability('moodle/user:delete', context_system::instance());

Expand Down
1 change: 0 additions & 1 deletion admin/user/user_bulk_download.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

$dataformat = optional_param('dataformat', '', PARAM_ALPHA);

require_login();
admin_externalpage_setup('userbulk');
require_capability('moodle/user:update', context_system::instance());

Expand Down
1 change: 0 additions & 1 deletion admin/user/user_bulk_forcepasswordchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

$confirm = optional_param('confirm', 0, PARAM_BOOL);

require_login();
admin_externalpage_setup('userbulk');
require_capability('moodle/user:update', context_system::instance());

Expand Down
1 change: 0 additions & 1 deletion admin/user/user_bulk_message.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
$msg = optional_param('msg', '', PARAM_CLEANHTML);
$confirm = optional_param('confirm', 0, PARAM_BOOL);

require_login();
admin_externalpage_setup('userbulk');
require_capability('moodle/site:manageallmessaging', context_system::instance());

Expand Down
1 change: 0 additions & 1 deletion admin/webservice/tokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
$newnode->make_active();
}

require_capability('moodle/site:config', context_system::instance());

$tokenlisturl = new moodle_url("/" . $CFG->admin . "/settings.php", array('section' => 'webservicetokens'));

Expand Down
3 changes: 0 additions & 3 deletions auth/test_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
$auth = '';
}

require_login();
require_capability('moodle/site:config', context_system::instance());

navigation_node::override_active_url(new moodle_url('/admin/settings.php', array('section'=>'manageauths')));
admin_externalpage_setup('authtestsettings');

Expand Down
1 change: 0 additions & 1 deletion comment/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
require_once($CFG->libdir.'/adminlib.php');
require_once($CFG->dirroot.'/comment/locallib.php');

require_login();
admin_externalpage_setup('comments', '', null, '', array('pagelayout'=>'report'));

$context = context_system::instance();
Expand Down
3 changes: 0 additions & 3 deletions course/pending.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
require_once($CFG->dirroot . '/course/lib.php');
require_once($CFG->dirroot . '/course/request_form.php');

require_login();
require_capability('moodle/site:approvecourse', context_system::instance());

$approve = optional_param('approve', 0, PARAM_INT);
$reject = optional_param('reject', 0, PARAM_INT);

Expand Down
3 changes: 0 additions & 3 deletions enrol/test_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
$enrol = '';
}

require_login();
require_capability('moodle/site:config', context_system::instance());

navigation_node::override_active_url(new moodle_url('/admin/settings.php', array('section'=>'manageenrols')));
admin_externalpage_setup('enroltestsettings');

Expand Down
1 change: 0 additions & 1 deletion grade/edit/letter/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
$editparam = null;
if ($context->contextlevel == CONTEXT_SYSTEM or $context->contextlevel == CONTEXT_COURSECAT) {
require_once $CFG->libdir.'/adminlib.php';
require_login();

admin_externalpage_setup('letters');

Expand Down
3 changes: 0 additions & 3 deletions message/defaultoutputs.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
// This is an admin page
admin_externalpage_setup('defaultmessageoutputs');

// Require site configuration capability
require_capability('moodle/site:config', context_system::instance());

// Fetch processors
$processors = get_message_processors(true);
// Fetch message providers
Expand Down
2 changes: 0 additions & 2 deletions my/indexsys.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@

$resetall = optional_param('resetall', null, PARAM_BOOL);

require_login();

$header = "$SITE->shortname: ".get_string('myhome')." (".get_string('mypage', 'admin').")";

$PAGE->set_blocks_editing_capability('moodle/my:configsyspages');
Expand Down
Loading

0 comments on commit 609c73b

Please sign in to comment.