From 3eb24a6e690dfe7c521458f0db66106247a27898 Mon Sep 17 00:00:00 2001 From: skodak Date: Thu, 1 Jan 2009 14:36:49 +0000 Subject: [PATCH] MDL-17758 fixed hardcoded /admin/ links --- admin/index.php | 2 +- admin/mnet/access_control.php | 8 ++++---- admin/mnet/adminlib.php | 2 +- admin/mnet/delete.html | 4 ++-- admin/mnet/enr_courses.php | 2 +- admin/mnet/enr_hosts.php | 2 +- admin/settings/mnet.php | 10 +++++----- backup/backup_scheduled.php | 2 +- blocks/admin_tree/block_admin_tree.php | 2 +- 9 files changed, 17 insertions(+), 17 deletions(-) diff --git a/admin/index.php b/admin/index.php index 71df7d630b8f6..5afb4e0c7f36a 100644 --- a/admin/index.php +++ b/admin/index.php @@ -426,7 +426,7 @@ upgrade_local_db("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards /// Check for changes to RPC functions - require_once($CFG->dirroot.'/admin/mnet/adminlib.php'); + require_once("$CFG->dirroot/$CFG->admin/mnet/adminlib.php"); upgrade_RPC_functions("$CFG->wwwroot/$CFG->admin/index.php"); // Return here afterwards diff --git a/admin/mnet/access_control.php b/admin/mnet/access_control.php index 54f0c69c84997..1933e3e865e5c 100644 --- a/admin/mnet/access_control.php +++ b/admin/mnet/access_control.php @@ -47,7 +47,7 @@ // fetch the record in question $id = required_param('id', PARAM_INT); if (!$idrec = get_record('mnet_sso_access_control', 'id', $id)) { - error(get_string('recordnoexists','mnet'), '/admin/mnet/access_control.php'); + error(get_string('recordnoexists','mnet'), "/$CFG->admin/mnet/access_control.php"); } switch ($action) { @@ -62,7 +62,7 @@ // require the access parameter, and it must be 'allow' or 'deny' $accessctrl = trim(strtolower(required_param('accessctrl', PARAM_ALPHA))); if ($accessctrl != 'allow' and $accessctrl != 'deny') { - error(get_string('invalidaccessparam', 'mnet') , '/admin/mnet/access_control.php'); + error(get_string('invalidaccessparam', 'mnet') , "/$CFG->admin/mnet/access_control.php"); } if (mnet_update_sso_access_control($idrec->username, $idrec->mnet_host_id, $accessctrl)) { @@ -75,7 +75,7 @@ break; default: - print_error('invalidactionparam', 'mnet', '/admin/mnet/access_control.php'); + print_error('invalidactionparam', 'mnet', "/$CFG->admin/mnet/access_control.php"); } } @@ -86,7 +86,7 @@ // check permissions and verify form input if (!has_capability('moodle/user:delete', $sitecontext)) { - error(get_string('nomodifyacl','mnet'), '/admin/mnet/access_control.php'); + error(get_string('nomodifyacl','mnet'), "/$CFG->admin/mnet/access_control.php"); } if (empty($form->username)) { $formerror['username'] = get_string('enterausername','mnet'); diff --git a/admin/mnet/adminlib.php b/admin/mnet/adminlib.php index bd33b816f6f71..e4da39eca06b3 100644 --- a/admin/mnet/adminlib.php +++ b/admin/mnet/adminlib.php @@ -72,7 +72,7 @@ function mnet_get_functions($type, $parentname) { if (!file_exists($filename)) return false; if (extension_loaded('tokenizer')) { - include_once $CFG->dirroot.'/admin/mnet/MethodTable.php'; + include_once "$CFG->dirroot/$CFG->admin/mnet/MethodTable.php"; $functions = (array)MethodTable::create($filename,false); } diff --git a/admin/mnet/delete.html b/admin/mnet/delete.html index 4709362ba2498..df3ef16c2ee24 100644 --- a/admin/mnet/delete.html +++ b/admin/mnet/delete.html @@ -1,7 +1,7 @@ shortname: $strmnetsettings", "$site->fullname", - ''.$stradministration.' -> '. - ''.get_string('mnetsettings', 'mnet').' -> Delete host'); + ''.$stradministration.' -> '. + ''.get_string('mnetsettings', 'mnet').' -> Delete host'); print_heading(get_string('mnetsettings', 'mnet')); ?> diff --git a/admin/mnet/enr_courses.php b/admin/mnet/enr_courses.php index a0af7e86d0445..bdcffd18c7338 100644 --- a/admin/mnet/enr_courses.php +++ b/admin/mnet/enr_courses.php @@ -38,7 +38,7 @@ " class=\"icon\" alt=\"".get_string("course")."\" />"; foreach ($courses as $course) { - $link = $CFG->wwwroot . '/admin/mnet/enr_course_enrol.php?' + $link = "$CFG->wwwroot/$CFG->admin/mnet/enr_course_enrol.php?" . "host={$mnethost}&courseid={$course->id}&sesskey={$USER->sesskey}"; echo '' . "$icon" diff --git a/admin/mnet/enr_hosts.php b/admin/mnet/enr_hosts.php index 2f78fa556f21a..1764daf3ec9e9 100644 --- a/admin/mnet/enr_hosts.php +++ b/admin/mnet/enr_hosts.php @@ -38,7 +38,7 @@ . ''; $hosts = $enrolment->list_remote_servers(); foreach ($hosts as $host) { - $coursesurl = "{$CFG->wwwroot}/admin/mnet/enr_courses.php?host={$host->id}&sesskey={$USER->sesskey}"; + $coursesurl = "{$CFG->wwwroot}/$CFG->admin/mnet/enr_courses.php?host={$host->id}&sesskey={$USER->sesskey}"; $coursecount = get_field_sql("SELECT count(id) FROM {$CFG->prefix}mnet_enrol_course WHERE hostid={$host->id}"); if (empty($coursecount)) { $coursecount = '?'; diff --git a/admin/settings/mnet.php b/admin/settings/mnet.php index 1f5e8c7c41823..f6d425e375911 100644 --- a/admin/settings/mnet.php +++ b/admin/settings/mnet.php @@ -3,19 +3,19 @@ // This file defines settingpages and externalpages under the "mnet" category $ADMIN->add('mnet', new admin_externalpage('net', get_string('settings', 'mnet'), - $CFG->wwwroot . '/admin/mnet/index.php', + "$CFG->wwwroot/$CFG->admin/mnet/index.php", 'moodle/site:config')); $ADMIN->add('mnet', new admin_externalpage('mnetpeers', get_string('mnetpeers', 'mnet'), - $CFG->wwwroot . '/admin/mnet/peers.php', + "$CFG->wwwroot/$CFG->admin/mnet/peers.php", 'moodle/site:config')); $ADMIN->add('mnet', new admin_externalpage('ssoaccesscontrol', get_string('ssoaccesscontrol', 'mnet'), - $CFG->wwwroot . '/admin/mnet/access_control.php', + "$CFG->wwwroot/$CFG->admin/mnet/access_control.php", 'moodle/site:config')); $ADMIN->add('mnet', new admin_externalpage('mnetenrol', get_string('mnetenrol', 'mnet'), - $CFG->wwwroot . '/admin/mnet/enr_hosts.php', + "$CFG->wwwroot/$CFG->admin/mnet/enr_hosts.php", 'moodle/site:config')); $ADMIN->add('mnet', new admin_externalpage('trustedhosts', get_string('trustedhosts', 'mnet'), - $CFG->wwwroot . '/admin/mnet/trustedhosts.php', + "$CFG->wwwroot/$CFG->admin/mnet/trustedhosts.php", 'moodle/site:config')); ?> diff --git a/backup/backup_scheduled.php b/backup/backup_scheduled.php index ced1d6f5fef61..96b66df30256f 100644 --- a/backup/backup_scheduled.php +++ b/backup/backup_scheduled.php @@ -177,7 +177,7 @@ function schedule_backup_cron() { //Reference if ($count_error != 0 || $count_unfinished != 0) { $message .= " ".get_string('backupfailed')."\n\n"; - $dest_url = $CFG->wwwroot.'/admin/report/backups/index.php'; + $dest_url = "$CFG->wwwroot/$CFG->admin/report/backups/index.php"; $message .= " ".get_string('backuptakealook','',$dest_url)."\n\n"; //Set message priority $admin->priority = 1; diff --git a/blocks/admin_tree/block_admin_tree.php b/blocks/admin_tree/block_admin_tree.php index 834c3f4c14bd3..744118160ac70 100644 --- a/blocks/admin_tree/block_admin_tree.php +++ b/blocks/admin_tree/block_admin_tree.php @@ -196,7 +196,7 @@ function get_content() { $searchcontent = isset($CFG->adminsearchquery) ? $CFG->adminsearchquery : ''; $this->content->footer = '
'. - '
'. + '
'. ''. ''. '
'.