--- /var/www/twiki/lib/TWiki/User/HtPasswdUser.pm	2004-12-22 20:04:29.000000000 -0800
+++ HtPasswdUser.pm	2005-04-07 09:45:32.000000000 -0700
@@ -213,6 +213,30 @@
     return "1";
 }
 
+#==========================
+=pod
+
+---+++ OverwriteUserPassword( $user, $newUserPassword ) => $success
+| Description: | user to overwrite the existing user password with another one |
+| Parameter: =$user= | the username we are replacing |
+| Parameter: =$newUserPassword= | unencrypted password |
+| Return: =$success= | "1" if success |
+
+=cut
+# TODO: same as UpdateUserPassword (see upwards)
+sub OverwriteUserPassword
+{
+    my ($self,$user,$newUserPassword) = @_;
+
+    my $newUserEntry = _htpasswdGeneratePasswd($user,$newUserPassword, 0);
+
+    my $text = &TWiki::Store::readFile($TWiki::htpasswdFilename);
+    $text =~ s/$user:.*$/$user:$newUserEntry/m;
+    &TWiki::Store::saveFile($TWiki::htpasswdFilename, $text);
+
+    return "1";
+}
+
 #===========================
 =pod
 
