Administratoren Problem mit Test und Datenbankmodul

Re: Administratoren Problem mit Test und Datenbankmodul

von Jürg Hoerner -
Anzahl Antworten: 0
Nutzerbild von Speziell hilfreiche Moodler
Liebe KollegInnen

Ich habe das Problem mit einem einfügen von wenigen Programmzeilen genial gelöst.

Es ist ein tolles Gefühl, wenn alles wieder läuft, vor allem, wenn an gewissen Tagen über 180 Zugriffe zu verzeichnen sind.

http://tracker.moodle.org/browse/MDL-5374

with this
Wen Hao Chuang added a comment - 12/Feb/10 06:38 AM - edited Here at SFSU we are using Moodle clustering. We have one load balancer running squid, and then 3 application servers behind it. So this https is important to us for squid server. Our solution is actually pretty simple - adding a site setting under the "Site policies" for "Force https" as a checkbox, and it would be up to system administrators to check (or uncheck) this checkbox for the Moodle instance. This has been working fine for us. Here is what you need to do:

(1)
In /admin/settings/security.php

At around line 63 (above // "httpsecurity" settingpage

Add the following line:

$temp->add(new admin_setting_configcheckbox('forcehttps', 'Force https', 'Force the application to always use https://linkext7.gif. If not enabled, the default will be http://linkext7.gif. This is commonly used with Squid server or SSL accelerator', 0));

(2)
In /lib/weblib.php

At around line 297 at the bottom of the function qualified_me(), add:

//squid hack to make it work
if (isset($CFG->forcehttps) && $CFG->forcehttps == true) { $protocol = 'https://'; }
else { $protocol = 'http://'; }

$url_prefix = $protocol.$hostname;
return $url_prefix . me();
}


I think this would be a helpful site setting for larger sites who really need to force the site to use https. Martin do you think this could be added to core? Hope this helps..