diff -ru moodle_orig/auth/cas/auth.php moodle/auth/cas/auth.php
--- moodle_orig/auth/cas/auth.php	2009-11-24 01:02:46.000000000 +0100
+++ moodle/auth/cas/auth.php	2010-04-30 17:41:10.000000000 +0200
@@ -58,7 +58,11 @@
      */
     function user_login ($username, $password) {
 		$this->connectCAS();
-		return phpCAS::isAuthenticated() && (trim(moodle_strtolower(phpCAS::getUser())) == $username);
+		if (! (phpCAS::isAuthenticated() && (trim(moodle_strtolower(phpCAS::getUser())) == $username))) 
+			return false ;
+		if ( !$this->config->autosubscribe && !record_exists("user", "username", $username) )
+			return false;
+		return true;
     }
 
     function prevent_local_passwords() {
@@ -240,6 +244,8 @@
             $config->proxycas = '';
         if (!isset ($config->logoutcas))
             $config->logoutcas = '';
+        if (!isset ($config->autosubscribe))
+            $config->autosubscribe = '';
         if (!isset ($config->multiauth))
             $config->multiauth = '';
         // LDAP settings
@@ -283,6 +289,7 @@
         set_config('language',    $config->language,    'auth/cas');
         set_config('proxycas',     $config->proxycas,     'auth/cas');
         set_config('logoutcas',     $config->logoutcas,     'auth/cas');
+        set_config('autosubscribe', $config->autosubscribe, 'auth/cas');
         set_config('multiauth',     $config->multiauth,     'auth/cas');
         // save LDAP settings
         set_config('host_url', $config->host_url, 'auth/cas');
@@ -364,6 +371,8 @@
      * @return mixed array with no magic quotes or false on error
      */
     function get_userinfo($username) {
+        // this allows cas to work without LDAP configured
+        if (!$this->config->host_url) return false;
         $textlib = textlib_get_instance();
         $extusername = $textlib->convert(stripslashes($username), 'utf-8', $this->config->ldapencoding);
         $ldapconnection = $this->ldap_connect();
Seulement dans moodle/auth/cas: auth.php.orig
diff -ru moodle_orig/auth/cas/config.html moodle/auth/cas/config.html
--- moodle_orig/auth/cas/config.html	2010-01-22 01:02:31.000000000 +0100
+++ moodle/auth/cas/config.html	2010-04-30 17:26:11.000000000 +0200
@@ -44,6 +44,10 @@
 
         $config->logoutcas = '';
 
+    if (!isset ($config->autosubscribe)) 
+
+        $config->autosubscribe = '';
+
     if (!isset ($config->multiauth))
 
         $config->multiauth = '';
@@ -312,6 +316,30 @@
 
     <td><?php print_string('auth_cas_proxycas', 'auth') ?></td>
 
+
+
+</tr>
+
+<tr valign="top"  class="required">
+
+    <td align="right"><?php print_string('auth_cas_autosubscribe_key', 'auth') ?>:</td>
+
+    <td>
+
+        <?php
+
+        unset($options);
+
+        $options[1] = get_string('yes');
+
+        choose_from_menu ($options, 'autosubscribe', $config->autosubscribe, get_string('no'), '', '');
+
+        ?>
+
+    </td>
+
+    <td><?php print_string('auth_cas_autosubscribe', 'auth') ?></td>
+
 </tr>
 
 
diff -ru moodle_orig/lang/en_utf8/auth.php moodle/lang/en_utf8/auth.php
--- moodle_orig/lang/en_utf8/auth.php	2009-12-24 01:02:49.000000000 +0100
+++ moodle/lang/en_utf8/auth.php	2010-05-14 13:22:00.000000000 +0200
@@ -35,9 +35,11 @@
 // CAS plugin
 $string['auth_cas_proxycas_key'] = "Proxy mode";
 $string['auth_cas_logoutcas_key'] = "Logout CAS";
+$string['auth_cas_autosubscribe_key'] = "Allow autosubscribe";
 $string['auth_cas_multiauth_key'] = "Multi-authentication";
 $string['auth_cas_proxycas'] = "Turn this to 'yes'' if you use CASin proxy-mode";
 $string['auth_cas_logoutcas'] = "Turn this to 'yes'' if tou want to logout from CAS when you deconnect from Moodle";
+$string['auth_cas_autosubscribe'] = "Turn this to 'yes' if you want to allow CAS-authenticated users who are not in the local database to autosubscribe";
 $string['auth_cas_multiauth'] = "Turn this to 'yes'' if you want to have multi-authentication (CAS + other authentication)";
 $string['accesCAS'] = "CAS users";
 $string['accesNOCAS'] = "other users";
