--- source/IMS Enterprise/enrol.php	2008-09-04 10:51:58.000000000 +0200
+++ workspace/ce19/moodle/enrol/imsenterprise/enrol.php	2008-09-02 08:59:16.000000000 +0200
@@ -4,9 +4,11 @@
 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
 * @package enrol_imsenterprise
 */

 // The following flags are set in the configuration
 // $CFG->enrol_imsfilelocation:        where is the file we are looking for?
@@ -23,7 +25,15 @@ require_once($CFG->libdir.'/eventslib.ph
 // $CFG->enrol_createnewcategories:    should this script create a (hidden) category if Moodle doesn't have one by the same name as the desired one?
 // $CFG->enrol_imssourcedidfallback:   some systems don't output a <userid> element (contrary to the specifications). If this is the case, activating this setting will cause us to use the <sourcedid><id> element instead as the userid. This may or may not be desirable in your situation.
 // $CFG->enrol_includephoto:           Process IMS <photo> tag to create user photo. Be warned that this may add significant server load.

+// $CFG->enrol_imsuserauth			   Choose default auth for users

@@ -101,10 +109,10 @@ function determine_default_rolemapping($
 function config_form($frm) {
     global $CFG, $imsroles;

+ ,'enrol_imsuserauth'

@@ -194,7 +202,50 @@ function process_config($config) {
     }
     set_config('enrol_imsrestricttarget', $config->enrol_imsrestricttarget);

+
+    if (!isset($config->enrol_imsuserauth)) {
+                    $config->enrol_imsuserauth = $CFG->auth;
+    }
+    set_config('enrol_imsuserauth', $config->enrol_imsuserauth);


@@ -630,64 +710,96 @@ function process_person_tag($tagcontents
-            $person->auth = $CFG->auth;
+            $person->auth = $CFG->enrol_imsuserauth;



--- source/IMS Enterprise/config.html	2008-09-04 10:51:58.000000000 +0200
+++ workspace/ce19/moodle/enrol/imsenterprise/config.html	2008-09-02 08:59:16.000000000 +0200

 <tr valign="top">
    <td align="right"><?php  print_string('fixcasepersonalnames', 'enrol_imsenterprise') ?>:</td>
    <td>
        <input type="checkbox" value="1" name="enrol_fixcasepersonalnames" <?php if ($frm->enrol_fixcasepersonalnames) echo "checked=\"checked\"" ?> />
    </td>
    <td>

    </td>
 </tr>

+<tr valign="top">
+    <td align="right"><?php  print_string('userauth', 'enrol_imsenterprise') ?>:</td>
+    <td>
+    	<?php
+    		$modules = get_list_of_plugins('auth');
+        	$auth_options = array();
+        	foreach ($modules as $module) {
+        	    $auth_options[$module] = get_string("auth_$module"."title", "auth");
+        	}
+
+			choose_from_menu($auth_options, 'enrol_imsuserauth', $frm->enrol_imsuserauth, '');
+    	?>
+    </td>
+    <td>
+    <?php helpbutton('userauth', 'More detail about this option', 'enrol/imsenterprise'); ?>
+    </td>
+</tr>



--- source/IMS Enterprise/en_utf8.php	2008-09-04 10:51:58.000000000 +0200
+++ workspace/ce19/moodle/enrol/imsenterprise/en_utf8.php	2008-09-02 08:59:16.000000000 +0200

+ $string['userauth'] = 'Default user authentitacion';