VirtualMailManager/handler.py
branchv0.7.x
changeset 727 695426b49de0
parent 711 2a75058fc064
child 736 66a5f9a405da
equal deleted inserted replaced
726:46b37d7c848a 727:695426b49de0
   752         Returns a dict (address, uid and gid) if a user could be found."""
   752         Returns a dict (address, uid and gid) if a user could be found."""
   753         from VirtualMailManager.account import get_account_by_uid
   753         from VirtualMailManager.account import get_account_by_uid
   754         self._db_connect()
   754         self._db_connect()
   755         return get_account_by_uid(uid, self._dbh)
   755         return get_account_by_uid(uid, self._dbh)
   756 
   756 
   757     def user_password(self, emailaddress, password):
   757     def user_password(self, emailaddress, password, scheme=None):
   758         """Wrapper for Account.modify('password' ...)."""
   758         """Wrapper for Account.update_password(...)."""
   759         if not isinstance(password, str) or not password:
   759         if not isinstance(password, str) or not password:
   760             raise VMMError(_("Could not accept password: '%s'") % password,
   760             raise VMMError(_("Could not accept password: '%s'") % password,
   761                            INVALID_ARGUMENT)
   761                            INVALID_ARGUMENT)
   762         acc = self._get_account(emailaddress)
   762         acc = self._get_account(emailaddress)
   763         if not acc:
   763         if not acc:
   764             raise VMMError(_("The account '%s' does not exist.") %
   764             raise VMMError(_("The account '%s' does not exist.") %
   765                            acc.address, NO_SUCH_ACCOUNT)
   765                            acc.address, NO_SUCH_ACCOUNT)
   766         acc.modify('password', password)
   766         acc.update_password(password, scheme)
   767 
   767 
   768     def user_name(self, emailaddress, name):
   768     def user_name(self, emailaddress, name):
   769         """Wrapper for Account.modify('name', ...)."""
   769         """Wrapper for Account.modify('name', ...)."""
   770         acc = self._get_account(emailaddress)
   770         acc = self._get_account(emailaddress)
   771         if not acc:
   771         if not acc: