VirtualMailManager/Account.py
changeset 24 48ea255e8a85
parent 20 55146c78b3fb
child 32 ceb700bc4a80
equal deleted inserted replaced
23:d5ad5432e9eb 24:48ea255e8a85
    30         self._uid = 0
    30         self._uid = 0
    31         self._gid = 0
    31         self._gid = 0
    32         self._mid = 0
    32         self._mid = 0
    33         self._tid = 0
    33         self._tid = 0
    34         self._passwd = password
    34         self._passwd = password
    35         self._setAddr(address)
    35         self._setAddr()
    36         self._exists()
    36         self._exists()
    37         if self._isAlias():
    37         if self._isAlias():
    38             raise VMMAccountException(
    38             raise VMMAccountException(
    39             ('There is already an alias with address »%s«' % address,
    39             ('There is already an alias with address »%s«' % address,
    40                 ERR.ALIAS_EXISTS))
    40                 ERR.ALIAS_EXISTS))
    61         if gid is not None:
    61         if gid is not None:
    62             return True
    62             return True
    63         else:
    63         else:
    64             return False
    64             return False
    65 
    65 
    66     def _setAddr(self, address):
    66     def _setAddr(self):
    67         self._localpart, d = address.split('@')
    67         self._localpart, d = self._addr.split('@')
    68         dom = Domain(self._dbh, d)
    68         dom = Domain(self._dbh, d)
    69         self._gid = dom.getID()
    69         self._gid = dom.getID()
    70         if self._gid == 0:
    70         if self._gid == 0:
    71             raise VMMAccountException(("Domain »%s« doesn't exist." % d,
    71             raise VMMAccountException(("Domain »%s« doesn't exist." % d,
    72                 ERR.NO_SUCH_DOMAIN))
    72                 ERR.NO_SUCH_DOMAIN))