]> git.mjollnir.org Git - moodle.git/commitdiff
Logic fix
authormoodler <moodler>
Wed, 30 Jun 2004 12:43:05 +0000 (12:43 +0000)
committermoodler <moodler>
Wed, 30 Jun 2004 12:43:05 +0000 (12:43 +0000)
lib/moodlelib.php

index cfbda7171f3de93c9eb780f5efa6098438118ab1..db5ecb0eef55dea8462061b1b352f49d5e5904d7 100644 (file)
@@ -365,8 +365,9 @@ function require_login($courseid=0) {
             $SESSION->fromurl  = $_SERVER["HTTP_REFERER"];
         }
         $USER = NULL;
-        $loginguest = (isset($CFG->loginguests) and $CFG->autologinguests 
-            and $courseid and get_field('course','guest','id',$courseid)) ? '?loginguest=true' : '';
+        if (!empty($CFG->autologinguests)) {
+            $loginguest = ($courseid and get_field('course','guest','id',$courseid)) ? '?loginguest=true' : '';
+        }
         if (empty($CFG->loginhttps)) {
             redirect("$CFG->wwwroot/login/index.php$loginguest");
         } else {