Index: admin/uploaduser.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/uploaduser.php,v
retrieving revision 1.68.2.15
diff -u -r1.68.2.15 uploaduser.php
--- admin/uploaduser.php        13 May 2009 05:35:38 -0000      1.68.2.15
+++ admin/uploaduser.php        8 Sep 2009 12:14:53 -0000
@@ -438,7 +441,7 @@
                     if ($column == 'password') {
                         if (!$updatepasswords or $updatetype == 3) {
                             continue;
-                        } else if (!empty($user->password)) {
+                        } else if (!empty($user->password) and ($user->auth == 'manual' || $user->auth == 'email') ) {
                             $upt->track('password', get_string('updated'));
                             if ($forcechangepassword) {
                                 set_user_preference('auth_forcepasswordchange', 1, $existinguser->id);
@@ -505,7 +508,7 @@
             $user->confirmed = 1;
             $user->timemodified = time();

-            if (!$createpasswords and empty($user->password)) {
+            if (!$createpasswords and empty($user->password) and ($user->auth == 'manual' || $user->auth == 'email') ){
                 $upt->track('password', get_string('missingfield', 'error', 'password'), 'error');
                 $upt->track('status', $strusernotaddederror, 'error');
                 $userserrors++;
@@ -540,13 +543,13 @@
                 $upt->track('status', $struseradded);
                 $upt->track('id', $user->id, 'normal', false);
                 $usersnew++;
-                if ($createpasswords and empty($user->password)) {
+                if ($createpasswords and empty($user->password) and ($user->auth == 'manual' || $user->auth == 'email') ) {
                     // passwords will be created and sent out on cron
                     set_user_preference('create_password', 1, $user->id);
                     set_user_preference('auth_forcepasswordchange', 1, $user->id);
                     $upt->track('password', get_string('new'));
                 }
-                if ($forcechangepassword) {
+                if ($forcechangepassword and ($user->auth == 'manual' || $user->auth == 'email') ) {
                     set_user_preference('auth_forcepasswordchange', 1, $user->id);
                 }
             } else {
Index: admin/uploaduser_form.php
===================================================================
RCS file: /cvsroot/moodle/moodle/admin/uploaduser_form.php,v
retrieving revision 1.4.2.7
diff -u -r1.4.2.7 uploaduser_form.php
--- admin/uploaduser_form.php   26 Mar 2008 02:46:48 -0000      1.4.2.7
+++ admin/uploaduser_form.php   8 Sep 2009 12:15:10 -0000
@@ -1,4 +1,4 @@
-<?php // $Id: uploaduser_form.php,v 1.4.2.7 2008/03/26 02:46:48 dongsheng Exp $
+<?php // $Id: uploaduser_form.php,v 1.4.2.7 2008-03-26 02:46:48 dongsheng Exp $
 require_once $CFG->libdir.'/formslib.php';

 class admin_uploaduser_form1 extends moodleform {
@@ -63,6 +63,7 @@
         $mform->addElement('select', 'uupasswordnew', get_string('uupasswordnew', 'admin'), $choices);
         $mform->setDefault('uupasswordnew', 0);
         $mform->disabledIf('uupasswordnew', 'uutype', 'eq', UU_UPDATE);
+        $mform->disabledIf('uupasswordnew', 'auth', 'neq', 'manual');

         $choices = array(0 => get_string('nochanges', 'admin'),
                          1 => get_string('uuupdatefromfile', 'admin'),
@@ -280,7 +281,7 @@
         $optype  = $data['uutype'];

         // detect if password column needed in file
-        if (!in_array('password', $columns)) {
+        if (!in_array('password', $columns) and ($data['auth'] == 'manual' || $data['auth'] == 'email') ) {
             switch ($optype) {
                 case UU_UPDATE:
                     if (!empty($data['uupasswordold'])) {
