VirtualMailManager/handler.py
branchv0.6.x
changeset 329 41789df75339
parent 327 bb9ff81928f1
child 330 3fe8d6cdbe3a
equal deleted inserted replaced
328:85972d3ba936 329:41789df75339
   260         os.chown(domain.directory, 0, domain.gid)
   260         os.chown(domain.directory, 0, domain.gid)
   261         os.chdir(cwd)
   261         os.chdir(cwd)
   262 
   262 
   263     def _make_home(self, account):
   263     def _make_home(self, account):
   264         """Create a home directory for the new Account *account*."""
   264         """Create a home directory for the new Account *account*."""
   265         domdir = account.domain_directory
   265         domdir = account.domain.directory
   266         if not lisdir(domdir):
   266         if not lisdir(domdir):
   267             raise VMMError(_(u"No such directory: %s") % domdir,
   267             raise VMMError(_(u"No such directory: %s") % domdir,
   268                            NO_SUCH_DIRECTORY)
   268                            NO_SUCH_DIRECTORY)
   269         os.umask(0007)
   269         os.umask(0007)
   270         uid = account.uid
   270         uid = account.uid
   277 
   277 
   278         Arguments:
   278         Arguments:
   279 
   279 
   280         `domdir` : basestring
   280         `domdir` : basestring
   281           The directory of the domain the user belongs to
   281           The directory of the domain the user belongs to
   282           (commonly AccountObj.domain_directory)
   282           (commonly AccountObj.domain.directory)
   283         `uid` : int/long
   283         `uid` : int/long
   284           The user's UID (commonly AccountObj.uid)
   284           The user's UID (commonly AccountObj.uid)
   285         `gid` : int/long
   285         `gid` : int/long
   286           The user's GID (commonly AccountObj.gid)
   286           The user's GID (commonly AccountObj.gid)
   287         """
   287         """
   540         if not acc:
   540         if not acc:
   541             raise VMMError(_(u"The account '%s' doesn't exist.") %
   541             raise VMMError(_(u"The account '%s' doesn't exist.") %
   542                            acc.address, NO_SUCH_ACCOUNT)
   542                            acc.address, NO_SUCH_ACCOUNT)
   543         uid = acc.uid
   543         uid = acc.uid
   544         gid = acc.gid
   544         gid = acc.gid
   545         dom_dir = acc.domain_directory
   545         dom_dir = acc.domain.directory
   546         acc_dir = acc.home
   546         acc_dir = acc.home
   547         acc.delete(bool(force))
   547         acc.delete(bool(force))
   548         if self._cfg.dget('account.delete_directory'):
   548         if self._cfg.dget('account.delete_directory'):
   549             try:
   549             try:
   550                 self._delete_home(dom_dir, uid, gid)
   550                 self._delete_home(dom_dir, uid, gid)