diff --git a/auth/db/auth.php b/auth/db/auth.php
index 4f875b5..bd5d0e8 100644
--- a/auth/db/auth.php
+++ b/auth/db/auth.php
@@ -186,7 +186,7 @@ class auth_plugin_db extends auth_plugin_base {
     }
 
     /**
-     * Change a user's password
+     * Change a userpassword in External Database
      *
      * @param  object  $user        User table object
      * @param  string  $newpassword Plaintext password
@@ -197,8 +197,48 @@ class auth_plugin_db extends auth_plugin_base {
         if ($this->is_internal()) {
             return update_internal_user_password($user, $newpassword);
         } else {
-            // we should have never been called!
-            return false;
+            $username = $user->username;
+
+            $textlib = textlib_get_instance();
+            $extusername = $textlib->convert($username, 'utf-8', $this->config->extencoding);
+            $extpassword = $textlib->convert($newpassword, 'utf-8', $this->config->extencoding);
+
+            switch ($this->config->passtype) {
+                case 'md5':
+                    $extpassword = md5($extpassword);
+                    break;
+                case 'sha1':
+                    $extpassword = sha1($extpassword);
+                    break;
+                case 'plaintext':
+                default:
+                    break; // plaintext
+            }
+
+            $authdb = $this->db_init();
+
+            $rs = $authdb->Execute("SELECT * FROM {$this->config->table}
+                                     WHERE {$this->config->fielduser} = '".$this->ext_addslashes($extusername)."'");
+
+            if (!$rs) {
+                $authdb->Close();
+                debugging(get_string('auth_dbcantconnect','auth_db'));
+                return false;
+            }
+
+            if (!$rs->EOF) {
+
+                $authdb->Execute("UPDATE {$this->config->table}
+                                     SET {$this->config->fieldpass} =  '".$this->ext_addslashes($extpassword)."'
+                                   WHERE {$this->config->fielduser} = '".$this->ext_addslashes($extusername)."'");
+                $rs->Close();
+                $authdb->Close();
+                return true;
+            } else {
+                $rs->Close();
+                $authdb->Close();
+                return false;
+            }
         }
     }
 
@@ -591,7 +631,7 @@ class auth_plugin_db extends auth_plugin_base {
      * @return bool
      */
     function can_change_password() {
-        return ($this->is_internal() or !empty($this->config->changepasswordurl));
+        return true;
     }
 
     /**
@@ -616,7 +656,7 @@ class auth_plugin_db extends auth_plugin_base {
      * @return bool
      */
     function can_reset_password() {
-        return $this->is_internal();
+        return true;
     }
 
     /**
