Permalink
Browse files

MDL-17758 fixed hardcoded /admin/ links

  • Loading branch information...
1 parent 31f4ca3 commit 3eb24a6e690dfe7c521458f0db66106247a27898 skodak committed Jan 1, 2009
View
@@ -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
@@ -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');
View
@@ -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);
}
View
@@ -1,7 +1,7 @@
<?php
print_header("$site->shortname: $strmnetsettings", "$site->fullname",
- '<a href="'.$CFG->wwwroot.'/admin/index.php">'.$stradministration.'</a> -> '.
- '<a href="'.$CFG->wwwroot.'/admin/mnet/index.php">'.get_string('mnetsettings', 'mnet').'</a> -> Delete host');
+ '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/index.php">'.$stradministration.'</a> -> '.
+ '<a href="'.$CFG->wwwroot.'/'.$CFG->admin.'/mnet/index.php">'.get_string('mnetsettings', 'mnet').'</a> -> Delete host');
print_heading(get_string('mnetsettings', 'mnet'));
?>
@@ -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}&amp;courseid={$course->id}&amp;sesskey={$USER->sesskey}";
echo '<tr>'
. "<td>$icon</td>"
View
@@ -38,7 +38,7 @@
. '</tr>';
$hosts = $enrolment->list_remote_servers();
foreach ($hosts as $host) {
- $coursesurl = "{$CFG->wwwroot}/admin/mnet/enr_courses.php?host={$host->id}&amp;sesskey={$USER->sesskey}";
+ $coursesurl = "{$CFG->wwwroot}/$CFG->admin/mnet/enr_courses.php?host={$host->id}&amp;sesskey={$USER->sesskey}";
$coursecount = get_field_sql("SELECT count(id) FROM {$CFG->prefix}mnet_enrol_course WHERE hostid={$host->id}");
if (empty($coursecount)) {
$coursecount = '?';
View
@@ -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'));
?>
@@ -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;
@@ -196,7 +196,7 @@ function get_content() {
$searchcontent = isset($CFG->adminsearchquery) ? $CFG->adminsearchquery : '';
$this->content->footer = '<div class="adminsearchform">'.
- '<form action="'.$CFG->wwwroot.'/admin/search.php" method="get"><div>'.
+ '<form action="'.$CFG->wwwroot.'/'.$CFG->admin.'/search.php" method="get"><div>'.
'<label for="query" class="accesshide">'.get_string('searchinsettings', 'admin').'</label>'.
'<input type="text" name="query" id="query" size="8" value="'.s($searchcontent).'" />'.
'<input type="submit" value="'.get_string('search').'" /></div>'.

0 comments on commit 3eb24a6

Please sign in to comment.