Commit 0a45ffe3 authored by moodler's avatar moodler
Browse files

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.
parent f309f624
......@@ -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>
......
......@@ -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");
......
......@@ -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.';
......
......@@ -9,6 +9,7 @@
"changepassword" => true,
"country" => "",
"debug" => 7,
"forcelogin" => false,
"fullnamedisplay" => "firstname lastname",
"framename" => "_top",
"frontpage" => 0,
......
......@@ -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();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment