VMM/{cli,}/handler: Adjusted Handler.user_password.
Use Account.update_password instead of Account.modify.
--- a/VirtualMailManager/cli/handler.py Sat Feb 15 17:39:24 2014 +0000
+++ b/VirtualMailManager/cli/handler.py Sat Feb 15 18:07:00 2014 +0000
@@ -87,7 +87,7 @@
self._make_account_dirs(acc)
return (None, password)[rand_pass]
- def user_password(self, emailaddress, password=None):
+ def user_password(self, emailaddress, password=None, scheme=None):
"""Override the parent user_password() - add the interactive
password dialog."""
acc = self._get_account(emailaddress)
@@ -96,6 +96,6 @@
acc.address, NO_SUCH_ACCOUNT)
if not isinstance(password, str) or not password:
password = read_pass()
- acc.modify('password', password)
+ acc.update_password(password, scheme)
del _
--- a/VirtualMailManager/handler.py Sat Feb 15 17:39:24 2014 +0000
+++ b/VirtualMailManager/handler.py Sat Feb 15 18:07:00 2014 +0000
@@ -754,8 +754,8 @@
self._db_connect()
return get_account_by_uid(uid, self._dbh)
- def user_password(self, emailaddress, password):
- """Wrapper for Account.modify('password' ...)."""
+ def user_password(self, emailaddress, password, scheme=None):
+ """Wrapper for Account.update_password(...)."""
if not isinstance(password, str) or not password:
raise VMMError(_("Could not accept password: '%s'") % password,
INVALID_ARGUMENT)
@@ -763,7 +763,7 @@
if not acc:
raise VMMError(_("The account '%s' does not exist.") %
acc.address, NO_SUCH_ACCOUNT)
- acc.modify('password', password)
+ acc.update_password(password, scheme)
def user_name(self, emailaddress, name):
"""Wrapper for Account.modify('name', ...)."""