]> git.mjollnir.org Git - moodle.git/commitdiff
Merged username login form bug fix from stable
authorexe-cutor <exe-cutor>
Mon, 2 Apr 2007 14:13:59 +0000 (14:13 +0000)
committerexe-cutor <exe-cutor>
Mon, 2 Apr 2007 14:13:59 +0000 (14:13 +0000)
auth/shibboleth/README.txt
auth/shibboleth/auth.php
auth/shibboleth/index.php

index d23f0ce59518a61d51a881f85985cf2c91a6abd6..f64afa84ac35b54b765965653ec0a8a27603fec7 100644 (file)
@@ -144,24 +144,27 @@ Example file:
 <?PHP
 
     // Set the zip code and the adress
-    if ($_SERVER[$pluginconfig->field_map_address] != '')
+    if ($_SERVER[$this->config->field_map_address] != '')
     {
         // $address contains something like 'SWITCH$Limmatquai 138$CH-8021 Zurich'
-        // We want to split this up to get:
+        // We want to split this up to get: 
         // institution, street, zipcode, city and country
-        $address = $_SERVER[$pluginconfig->field_map_address];
+        $address = $_SERVER[$this->config->field_map_address];
         list($institution, $street, $zip_city) = split('\$', $address);
         ereg(' (.+)',$zip_city, $regs);
         $city = $regs[1];
-
+        
         ereg('(.+)-',$zip_city, $regs);
         $country = $regs[1];
-
+        
         $result["address"] = $street;
         $result["city"] = $city;
         $result["country"] = $country;
         $result["department"] = $institution;
+        $result["description"] = "I am a Shibboleth user";
+       
     }
+
 ?>
 --
 
index c12b7e4807efaf4d87a4b1bdbcad4c2cc6b5756e..4af09ac9874417166b512a51d13dc20740456d5f 100644 (file)
@@ -148,18 +148,11 @@ class auth_plugin_shibboleth extends auth_plugin_base {
 
     function loginpage_hook() {
         global $SESSION, $CFG;
+       
+       // Prevent username from being shown on login page after logout
+       $CFG->nolastloggedin = true;
 
-        //TODO: fix the code
         return;
-
-    //  See http://moodle.org/mod/forum/discuss.php?d=39918#187611
-    //    if ($CFG->auth == 'shibboleth') {
-    //        if (!empty($SESSION->shibboleth_checked) ) {  // Just come from there
-    //            unset($SESSION->shibboleth_checked);
-    //        } else if (empty($_POST)) {                   // No incoming data, so redirect
-    //            redirect($CFG->wwwroot.'/auth/shibboleth/index.php');
-    //        }
-    //    }
     }
 
     /**
index 2f329384c3ae2975d030ea3787cf0ec22958fd06..1750e00d51e3b08fb4e96ed733f794df88e7c1ec 100644 (file)
             $USER->site     = $CFG->wwwroot; // for added security, store the site in the 
             
             update_user_login_times();
-            set_moodle_cookie($USER->username);
+            
+            // Don't show username on login page
+            set_moodle_cookie('nobody');
+           
             set_login_session_preferences();
             
             unset($SESSION->lang);