]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-9276 reverse proxy and normal access can not be mixed - it would valiate the...
authorskodak <skodak>
Tue, 6 Jan 2009 10:10:19 +0000 (10:10 +0000)
committerskodak <skodak>
Tue, 6 Jan 2009 10:10:19 +0000 (10:10 +0000)
lang/en_utf8/error.php
lib/setuplib.php

index 67f0f0b1c3115f93b1f4f9f9a733dc9decededf7..2fae06d5a406ab01fe70ed84a37a75df05a03017 100644 (file)
@@ -391,6 +391,7 @@ $string['remotedownloaderror'] = 'Download of component to your server failed, p
 $string['remotedownloadnotallowed'] = 'Download of components to your server isn\'t allowed (allow_url_fopen is disabled).<br /><br />You must download the <a href=\"$a->url\">$a->url</a> file manually, copy it to \"$a->dest\" in your server and unzip it there.';
 $string['restricteduser'] = 'Sorry, but your current account \"$a\" is restricted from doing that';
 $string['reportnotavailable'] = 'This type of report is only available for the site course';
+$string['reverseproxyabused'] = 'Reverse proxy enabled, server can not be accessed directly, sorry.<br />Please contact server administrator.';
 $string['rpcerror'] = 'RPC enrol/mnet/available_courses: ($a)';
 $string['scheduledbackupsdisabled'] = 'Scheduled backups have been disabled by the server admin';
 $string['sectionnotexist'] = 'This section does not exist';
index a13ac17c49059eff8035ff32f35ff5a29f5ff20a..62bb37e585fc2b84ead9a58594d554e3157ad6c0 100644 (file)
@@ -172,6 +172,11 @@ function initialise_fullme() {
         if (($rurl['host'] != $url['host']) or (!empty($url['port']) and $rurl['port'] != $url['port'])) {
             print_error('wwwrootmismatch', 'error', '', $CFG->wwwroot);
         }
+    } else {
+        if ($rurl['host'] == $url['host']) {
+            // hopefully this will stop all those "clever" admins trying to set up moodle with two different addresses in intranet and Internet
+            print_error('reverseproxyabused', 'error');
+        }
     }
 
     $FULLME     = $rurl['scheme'].'://'.$url['host'];