VirtualMailManager/Handler.py
branchv0.6.x
changeset 255 d2ddd4a6528d
parent 254 8aecc83a0d32
child 256 ae80282301a3
equal deleted inserted replaced
254:8aecc83a0d32 255:d2ddd4a6528d
   395         """
   395         """
   396         ret_val = self.__warnings[:]
   396         ret_val = self.__warnings[:]
   397         del self.__warnings[:]
   397         del self.__warnings[:]
   398         return ret_val
   398         return ret_val
   399 
   399 
   400     def cfgDget(self, option):
   400     def cfg_dget(self, option):
       
   401         """Get the configured value of the *option* (section.option).
       
   402         When the option was not configured its default value will be
       
   403         returned."""
   401         return self._Cfg.dget(option)
   404         return self._Cfg.dget(option)
   402 
   405 
   403     def cfgPget(self, option):
   406     def cfg_pget(self, option):
       
   407         """Get the configured value of the *option* (section.option)."""
   404         return self._Cfg.pget(option)
   408         return self._Cfg.pget(option)
   405 
   409 
   406     def domainAdd(self, domainname, transport=None):
   410     def domainAdd(self, domainname, transport=None):
   407         dom = self.__getDomain(domainname)
   411         dom = self.__getDomain(domainname)
   408         if transport is None:
   412         if transport is None:
   630                 return info
   634                 return info
   631         if details in ('aliases', 'full'):
   635         if details in ('aliases', 'full'):
   632             return (info, acc.getAliases())
   636             return (info, acc.getAliases())
   633         return info
   637         return info
   634 
   638 
   635     def userByID(self, uid):
   639     def user_by_uid(self, uid):
   636         from VirtualMailManager.Account import getAccountByID
   640         """Search for an Account by its *uid*.
       
   641         Returns a dict (address, uid and gid) if a user could be found."""
       
   642         from VirtualMailManager.Account import get_account_by_uid
   637         self.__dbConnect()
   643         self.__dbConnect()
   638         return getAccountByID(uid, self._dbh)
   644         return get_account_by_uid(uid, self._dbh)
   639 
   645 
   640     def userPassword(self, emailaddress, password):
   646     def userPassword(self, emailaddress, password):
   641         if password is None or (isinstance(password, basestring) and
   647         if password is None or (isinstance(password, basestring) and
   642                                 not len(password)):
   648                                 not len(password)):
   643             raise ValueError('could not accept password: %r' % password)
   649             raise ValueError('could not accept password: %r' % password)