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.
This commit is contained in:
moodler
2004-01-14 08:27:18 +00:00
parent f309f624ea
commit 0a45ffe301
5 changed files with 22 additions and 1 deletions
+15
View File
@@ -353,6 +353,21 @@
<?php print_string("configfullnamedisplay") ?>
</td>
</tr>
<tr valign=top>
<td align=right><p>forcelogin:</td>
<td>
<?php
unset($options);
$options[0] = get_string('no');
$options[1] = get_string('yes');
choose_from_menu ($options, "forcelogin", $config->forcelogin, "", "", "");
?>
</td>
<td>
<?php print_string("configforcelogin") ?>
</td>
</tr>
<tr>
<td colspan=3 align=center>
+4
View File
@@ -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");
+1
View File
@@ -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.';
+1
View File
@@ -9,6 +9,7 @@
"changepassword" => true,
"country" => "",
"debug" => 7,
"forcelogin" => false,
"fullnamedisplay" => "firstname lastname",
"framename" => "_top",
"frontpage" => 0,
+1 -1
View File
@@ -129,7 +129,7 @@
$loginsite = get_string("loginsite");
print_header("$site->fullname: $loginsite", "$loginsite", get_string("login"), $focus, "", true, "<div align=right>$langmenu</div>");
print_header("$site->fullname: $loginsite", "$site->fullname", $loginsite, $focus, "", true, "<div align=right>$langmenu</div>");
include("index_form.html");
print_footer();