Index: enrol_imsenterprise.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/enrol_imsenterprise.php,v
retrieving revision 1.6
diff -u -r1.6 enrol_imsenterprise.php
--- enrol_imsenterprise.php	9 Feb 2007 07:47:16 -0000	1.6
+++ enrol_imsenterprise.php	31 Jul 2008 16:18:21 -0000
@@ -12,6 +12,7 @@
 $string['cronfrequency'] = 'Frequency of processing';
 $string['deleteusers'] = 'Delete user accounts when specified in IMS data';
 $string['description'] = 'This method will repeatedly check for and process a specially-formatted text file in the location that you specify.  The file must follow the <a href=\'../help.php?module=enrol/imsenterprise&amp;file=formatoverview.html\'>IMS Enterprise specifications</a> containing person, group, and membership XML elements.';
+$string['defaultauth'] = 'Authentication method for new users';
 $string['doitnow'] = 'perform an IMS Enterprise import right now';
 $string['enrolname'] = 'IMS Enterprise file';
 $string['filelockedmail'] = 'The text file you are using for IMS-file-based enrolments ($a) can not be deleted by the cron process.  This usually means the permissions are wrong on it.  Please fix the permissions so that Moodle can delete the file, otherwise it might be processed repeatedly.';
Index: config.html
===================================================================
RCS file: /cvsroot/moodle/moodle/enrol/imsenterprise/config.html,v
retrieving revision 1.8.2.1
diff -u -r1.8.2.1 config.html
--- config.html	2 May 2008 04:07:31 -0000	1.8.2.1
+++ config.html	31 Jul 2008 16:18:25 -0000
@@ -81,6 +81,22 @@
     <?php helpbutton('sourceddidfallback', 'More detail about this option', 'enrol/imsenterprise'); ?>    
     </td>
 </tr>
+
+<tr valign="top">
+    <td align="right"><?php print_string('defaultauth', 'enrol_imsenterprise'); ?>:</td>
+	<td colspan="2">
+<?php
+
+    $authplugins = get_list_of_plugins('auth');
+    $authoptions = array();
+    foreach ($authplugins as $plugin) {
+            $authoptions[$plugin] = get_string("auth_$plugin"."title", "auth");
+    }
+    choose_from_menu($authoptions, 'enrol_imse_defaultauth', 
+                     strlen($frm->enrol_imse_defaultauth) ? $frm->enrol_imse_defaultauth : '');
+?>
+    </td>
+</tr>
 <!--
 Photo processing is deactivated until we hear from Moodle dev forum about modification to gdlib.

Index: enrol.php
===================================================================
RCS file: /cvsroot/moodle/moodle/enrol/imsenterprise/enrol.php,v
retrieving revision 1.13.2.3
diff -u -r1.13.2.3 enrol.php
--- enrol.php	8 Jun 2008 15:29:58 -0000	1.13.2.3
+++ enrol.php	31 Jul 2008 16:58:11 -0000
@@ -191,6 +191,10 @@
     }
     set_config('enrol_imsrestricttarget', $config->enrol_imsrestricttarget);
 
+    if (!isset($config->enrol_imse_defaultauth)) {
+        $config->enrol_imse_defaultauth = 'manual';
+    }
+    set_config('enrol_imse_defaultauth', $config->enrol_imse_defaultauth);
 
 
     foreach($this->imsroles as $imsrolenum=>$imsrolename){
@@ -651,6 +655,6 @@
 
             // If they don't exist and they have a defined username, and $CFG->enrol_createnewusers == true, we create them.
             $person->lang = 'manual'; //TODO: this needs more work due tu multiauth changes
-            $person->auth = $CFG->auth;
+            if (!isset($person->auth)) $person->auth = $CFG->enrol_imse_defaultauth;
             $person->confirmed = 1;
             $person->timemodified = time();
             $person->mnethostid = $CFG->mnet_localhost_id;