From: moodler Date: Wed, 14 Jan 2004 08:27:18 +0000 (+0000) Subject: A new configuration setting - "forcelogin". X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=0a45ffe301e01072267b01a1fa39e8c54eb1e1dc;p=moodle.git A new configuration setting - "forcelogin". Default is false, everything is as it is now. If turned on, then users are forced to log in before being able to see the front page or the course listings. --- diff --git a/admin/config.html b/admin/config.html index 68667b328c..5f17921703 100644 --- a/admin/config.html +++ b/admin/config.html @@ -353,6 +353,21 @@ + +

forcelogin: + + forcelogin, "", "", ""); + ?> + + + + + diff --git a/index.php b/index.php index 863396cf81..0346844ed5 100644 --- a/index.php +++ b/index.php @@ -10,6 +10,10 @@ redirect("$CFG->wwwroot/$CFG->admin/index.php"); } + if ($CFG->forcelogin) { + require_login(); + } + if (isadmin()) { if (moodle_needs_upgrading()) { redirect("$CFG->wwwroot/$CFG->admin/index.php"); diff --git a/lang/en/moodle.php b/lang/en/moodle.php index 163a3cd841..3c879416d9 100644 --- a/lang/en/moodle.php +++ b/lang/en/moodle.php @@ -121,6 +121,7 @@ $string['configallowunenroll'] = 'If this is set \'Yes\', then students are allo $string['configcountry'] = 'If you set a country here, then this country will be selected by default on new user accounts. To force users to choose a country, just leave this unset.'; $string['configdebug'] = 'If you turn this on, then PHP\'s error_reporting will be increased so that more warnings are printed. This is only useful for developers.'; $string['configerrorlevel'] = 'Choose the amount of PHP warnings that you want to be displayed. Normal is usually the best choice.'; +$string['configforcelogin'] = 'Normally, the front page of the site and the course listings (but not courses) can be read by people without logging in to the site. If you want to force people to log in before they do ANYTHING on the site, then you should enable this setting.'; $string['configframename'] = 'If you are embedding Moodle within a web frame, then put the name of this frame here. Otherwise this value should remain as \'_top\''; $string['configfullnamedisplay'] = 'This defines how names are shown when they are displayed in full. For most mono-lingual sites the most efficient setting is the default \"Given names + Surname\", but you may choose to hide surnames altogether, or to leave it up to the current language pack to decide (some languages have different conventions).'; $string['configgdversion'] = 'Indicate the version of GD that is installed. The version shown by default is the one that has been auto-detected. Don\'t change this unless you really know what you\'re doing.'; diff --git a/lib/defaults.php b/lib/defaults.php index e80bf99d34..968b552e88 100644 --- a/lib/defaults.php +++ b/lib/defaults.php @@ -9,6 +9,7 @@ "changepassword" => true, "country" => "", "debug" => 7, + "forcelogin" => false, "fullnamedisplay" => "firstname lastname", "framename" => "_top", "frontpage" => 0, diff --git a/login/index.php b/login/index.php index 58517f459b..0b2747fc95 100644 --- a/login/index.php +++ b/login/index.php @@ -129,7 +129,7 @@ $loginsite = get_string("loginsite"); - print_header("$site->fullname: $loginsite", "$loginsite", get_string("login"), $focus, "", true, "

$langmenu
"); + print_header("$site->fullname: $loginsite", "$site->fullname", $loginsite, $focus, "", true, "
$langmenu
"); include("index_form.html"); print_footer();