]> git.mjollnir.org Git - moodle.git/commitdiff
*** empty log message ***
authorjgutierr25 <jgutierr25>
Mon, 23 Jul 2007 11:37:21 +0000 (11:37 +0000)
committerjgutierr25 <jgutierr25>
Mon, 23 Jul 2007 11:37:21 +0000 (11:37 +0000)
auth/cas/auth.php

index b61d369ba37b868806e558f952a5c89cb52c4710..5188d3f5322c112d02b33d08a00ae0891d2ef9ee 100644 (file)
@@ -57,7 +57,7 @@ class auth_plugin_cas extends auth_plugin_base {
      * @return bool Authentication success or failure.
      */
     function user_login ($username, $password) {
-               $this->connectCAS();            
+               $this->connectCAS();    
         return phpCAS::isAuthenticated();
     }
     /**
@@ -84,16 +84,20 @@ class auth_plugin_cas extends auth_plugin_base {
      */
     function loginpage_hook() {
       global $frm;
-      global $test;
       global $CFG;
+         global $SESSION;
+
       $site = get_site();
       $CASform = get_string("CASform","auth");
       $username = optional_param("username");
+
       if (!empty($username)) {
-          return;
+                 if (strstr($SESSION->wantsurl,'ticket') || strstr($SESSION->wantsurl,'NOCAS'))
+                         unset($SESSION->wantsurl);
+          return;                
         }
-       
-         // Test si cas activé et paramêtres non remplis
+
+               // Test si cas activé et paramêtres non remplis
          if (empty($this->config->hostname)) {
                  return;
                  }
@@ -104,8 +108,8 @@ class auth_plugin_cas extends auth_plugin_base {
          // Gestion de la connection CAS si accès direct d'un ent ou autre      
         if (phpCAS::checkAuthentication()) {
                $frm->username=phpCAS::getUser();
-               if (phpCAS::getUser()=='esup9992')
-                       $frm->username='erhar0062';
+//             if (phpCAS::getUser()=='esup9992')
+//                     $frm->username='erhar0062';
                $frm->password="passwdCas";               
                return;
         }