]> git.mjollnir.org Git - moodle.git/commitdiff
A new configuration setting - "forcelogin".
authormoodler <moodler>
Wed, 14 Jan 2004 08:27:18 +0000 (08:27 +0000)
committermoodler <moodler>
Wed, 14 Jan 2004 08:27:18 +0000 (08:27 +0000)
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.

admin/config.html
index.php
lang/en/moodle.php
lib/defaults.php
login/index.php

index 68667b328cb562bffa4763d976baab45e174abdc..5f17921703b1ed5a0a50574eef368bb7f2b2cbb6 100644 (file)
     <?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>
index 863396cf81e7304b7b79ad8dfee79ca6d36f7ceb..0346844ed58c036e79db4de53982d89bd3e60635 100644 (file)
--- a/index.php
+++ b/index.php
         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");
index 163a3cd84169e0440418a4ef2b1450fbfc6d99c9..3c879416d9c6f316dc4e7ddcc67e702699ca5686 100644 (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.';
index e80bf99d349162a5dff69efb9b66225e56c69d35..968b552e8836c604533805ada8ff80647daaefd9 100644 (file)
@@ -9,6 +9,7 @@
        "changepassword"   =>  true,
        "country"          => "",
        "debug"            =>  7,
+       "forcelogin"       =>  false,
        "fullnamedisplay"  => "firstname lastname",
        "framename"        => "_top",
        "frontpage"        =>  0,
index 58517f459b2fe41ddcb9fd674705ccfac8d3735a..0b2747fc95defbfe6dfdae5cbe9b202b45a173af 100644 (file)
 
     $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();