mirror of
https://github.com/moodle/moodle.git
synced 2025-06-02 06:05:31 +02:00
MDL-29895 core: removed require_login() when not needed
This commit is contained in:
parent
6e2e63457e
commit
458453cee0
@ -28,10 +28,6 @@ require_once($CFG->libdir . '/adminlib.php');
|
||||
$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.
|
||||
|
@ -28,9 +28,6 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
// 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);
|
||||
|
@ -12,8 +12,6 @@ $page = optional_param('page', 0, PARAM_INT);
|
||||
$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')) {
|
||||
|
@ -34,10 +34,8 @@ $step = optional_param('step', 'verify', PARAM_ALPHA);
|
||||
$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();
|
||||
|
||||
|
@ -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();
|
||||
|
@ -32,10 +32,6 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
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);
|
||||
|
@ -29,14 +29,10 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
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));
|
||||
|
||||
|
@ -30,11 +30,8 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
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);
|
||||
|
||||
|
@ -21,12 +21,8 @@ if ($CFG->mnet_dispatcher_mode === 'off') {
|
||||
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();
|
||||
|
@ -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();
|
||||
|
@ -35,8 +35,6 @@ if ($action == 'newon') {
|
||||
|
||||
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');
|
||||
|
@ -31,7 +31,6 @@ require_once($CFG->libdir . '/adminlib.php');
|
||||
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);
|
||||
|
@ -47,7 +47,6 @@ if ($action == 'newon') {
|
||||
$visible = false;
|
||||
}
|
||||
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
admin_externalpage_setup($pagename);
|
||||
|
||||
$sesskeyurl = $CFG->wwwroot.'/'.$CFG->admin.'/repository.php?sesskey=' . sesskey();
|
||||
|
@ -42,7 +42,6 @@ if ($edit){
|
||||
}
|
||||
|
||||
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()));
|
||||
|
||||
|
@ -54,7 +54,6 @@ if ($return === 'manage') {
|
||||
|
||||
// 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'));
|
||||
|
||||
|
@ -48,7 +48,6 @@ $defineurl = $CFG->wwwroot . '/' . $CFG->admin . '/roles/define.php';
|
||||
|
||||
// Check access permissions.
|
||||
$systemcontext = context_system::instance();
|
||||
require_login();
|
||||
require_capability('moodle/role:manage', $systemcontext);
|
||||
admin_externalpage_setup('defineroles');
|
||||
|
||||
|
@ -28,7 +28,6 @@ require('../../../config.php');
|
||||
require_once('locallib.php');
|
||||
require_once('database_export_form.php');
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('tooldbexport');
|
||||
|
||||
// Create form.
|
||||
|
@ -28,7 +28,6 @@ require('../../../config.php');
|
||||
require_once('locallib.php');
|
||||
require_once('database_transfer_form.php');
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('tooldbtransfer');
|
||||
|
||||
// Create the form.
|
||||
|
@ -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();
|
||||
|
@ -29,9 +29,6 @@ admin_externalpage_setup('toolhttpsreplace');
|
||||
|
||||
$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'));
|
||||
|
@ -32,9 +32,6 @@ admin_externalpage_setup('toolhttpsreplace');
|
||||
|
||||
$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'));
|
||||
|
@ -32,8 +32,6 @@ admin_externalpage_setup('toolinnodb');
|
||||
|
||||
$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');
|
||||
|
@ -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')));
|
||||
|
@ -33,7 +33,6 @@ $status = optional_param('status', 0, PARAM_BOOL);
|
||||
|
||||
// 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);
|
||||
|
@ -41,7 +41,6 @@ $ignore = optional_param('ignore', '', PARAM_RAW);
|
||||
$reset = optional_param('reset', '', PARAM_RAW);
|
||||
$id = optional_param('id', '', PARAM_INT);
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('toolspamcleaner');
|
||||
|
||||
// Delete one user
|
||||
|
@ -29,9 +29,7 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$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') {
|
||||
|
@ -39,7 +39,6 @@ $previewrows = optional_param('previewrows', 10, PARAM_INT);
|
||||
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());
|
||||
|
||||
|
@ -36,8 +36,6 @@ define ('PIX_FILE_SKIPPED', 2);
|
||||
|
||||
admin_externalpage_setup('tooluploaduserpictures');
|
||||
|
||||
require_login();
|
||||
|
||||
require_capability('tool/uploaduser:uploaduserpictures', context_system::instance());
|
||||
|
||||
$site = get_site();
|
||||
|
@ -50,8 +50,6 @@ if (!isset($SESSION->xmldb)) {
|
||||
// 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);
|
||||
|
@ -8,7 +8,6 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('userbulk');
|
||||
require_capability('moodle/user:update', context_system::instance());
|
||||
|
||||
|
@ -8,7 +8,6 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('userbulk');
|
||||
require_capability('moodle/user:delete', context_system::instance());
|
||||
|
||||
|
@ -30,7 +30,6 @@ require_once($CFG->dirroot.'/user/profile/lib.php');
|
||||
|
||||
$dataformat = optional_param('dataformat', '', PARAM_ALPHA);
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('userbulk');
|
||||
require_capability('moodle/user:update', context_system::instance());
|
||||
|
||||
|
@ -9,7 +9,6 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$confirm = optional_param('confirm', 0, PARAM_BOOL);
|
||||
|
||||
require_login();
|
||||
admin_externalpage_setup('userbulk');
|
||||
require_capability('moodle/user:update', context_system::instance());
|
||||
|
||||
|
@ -7,7 +7,6 @@ require_once('user_message_form.php');
|
||||
$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());
|
||||
|
||||
|
@ -42,7 +42,6 @@ if ($node && $newnode) {
|
||||
$newnode->make_active();
|
||||
}
|
||||
|
||||
require_capability('moodle/site:config', context_system::instance());
|
||||
|
||||
$tokenlisturl = new moodle_url("/" . $CFG->admin . "/settings.php", array('section' => 'webservicetokens'));
|
||||
|
||||
|
@ -32,9 +32,6 @@ if (!core_component::is_valid_plugin_name('auth', $auth)) {
|
||||
$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');
|
||||
|
||||
|
@ -26,7 +26,6 @@ require_once('../config.php');
|
||||
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();
|
||||
|
@ -35,9 +35,6 @@ require_once($CFG->libdir . '/adminlib.php');
|
||||
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);
|
||||
|
||||
|
@ -32,9 +32,6 @@ if (!core_component::is_valid_plugin_name('enrol', $enrol)) {
|
||||
$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');
|
||||
|
||||
|
@ -48,7 +48,6 @@ $returnurl = null;
|
||||
$editparam = null;
|
||||
if ($context->contextlevel == CONTEXT_SYSTEM or $context->contextlevel == CONTEXT_COURSECAT) {
|
||||
require_once $CFG->libdir.'/adminlib.php';
|
||||
require_login();
|
||||
|
||||
admin_externalpage_setup('letters');
|
||||
|
||||
|
@ -28,9 +28,6 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
// 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
|
||||
|
@ -41,8 +41,6 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$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');
|
||||
|
@ -33,7 +33,7 @@ $page = optional_param('page', 0, PARAM_INT);
|
||||
$logreader = optional_param('logreader', '', PARAM_COMPONENT); // Reader which will be used for displaying logs.
|
||||
|
||||
if (empty($id)) {
|
||||
require_login();
|
||||
admin_externalpage_setup('reportloglive', '', null, '', array('pagelayout' => 'report'));
|
||||
$context = context_system::instance();
|
||||
$coursename = format_string($SITE->fullname, true, array('context' => $context));
|
||||
} else {
|
||||
@ -75,9 +75,7 @@ if ($page == 0 && !empty($logreader)) {
|
||||
$strlivelogs = get_string('livelogs', 'report_loglive');
|
||||
$strupdatesevery = get_string('updatesevery', 'moodle', $refresh);
|
||||
|
||||
if (empty($id)) {
|
||||
admin_externalpage_setup('reportloglive', '', null, '', array('pagelayout' => 'report'));
|
||||
}
|
||||
|
||||
$PAGE->set_url($url);
|
||||
$PAGE->set_context($context);
|
||||
$PAGE->set_title("$coursename: $strlivelogs ($strupdatesevery)");
|
||||
|
@ -28,7 +28,6 @@ require('../../config.php');
|
||||
require_once($CFG->dirroot.'/report/performance/locallib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
require_login();
|
||||
|
||||
// Show detailed info about one issue only.
|
||||
$issue = optional_param('issue', '', PARAM_ALPHANUMEXT);
|
||||
|
@ -29,7 +29,6 @@ require('../../config.php');
|
||||
require_once($CFG->dirroot.'/report/security/locallib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
require_login();
|
||||
|
||||
$issue = optional_param('issue', '', PARAM_ALPHANUMEXT); // show detailed info about one issue only
|
||||
|
||||
|
@ -33,7 +33,6 @@ require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$resetall = optional_param('resetall', null, PARAM_BOOL);
|
||||
|
||||
require_login();
|
||||
|
||||
$header = "$SITE->shortname: ".get_string('publicprofile')." (".get_string('myprofile', 'admin').")";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user