Skip to content

Commit

Permalink
MDL-17758 fixed hardcoded /admin/ links
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Jan 1, 2009
1 parent 31f4ca3 commit 3eb24a6
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion admin/index.php
Expand Up @@ -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


Expand Down
8 changes: 4 additions & 4 deletions admin/mnet/access_control.php
Expand Up @@ -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) {
Expand All @@ -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)) {
Expand All @@ -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");
}
}

Expand All @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion admin/mnet/adminlib.php
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions admin/mnet/delete.html
@@ -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'));
?>
Expand Down
2 changes: 1 addition & 1 deletion admin/mnet/enr_courses.php
Expand Up @@ -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>"
Expand Down
2 changes: 1 addition & 1 deletion admin/mnet/enr_hosts.php
Expand Up @@ -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 = '?';
Expand Down
10 changes: 5 additions & 5 deletions admin/settings/mnet.php
Expand Up @@ -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'));
?>
2 changes: 1 addition & 1 deletion backup/backup_scheduled.php
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion blocks/admin_tree/block_admin_tree.php
Expand Up @@ -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>'.
Expand Down

0 comments on commit 3eb24a6

Please sign in to comment.