Beispiel #1
0
    def purgeGroup(self):
        users = System.groupMember(Config.group)
        if users is None:
            return False

        ret = True
        for user in users:
            if user == Config.dav_user:
                continue

            Logger.debug("FileServer:: deleting user '%s'" % (user))

            u = User(user)
            u.clean()
            if u.existSomeWhere():
                Logger.error("FS: unable to del user %s" % (user))
                ret = False

        htgroup = HTGroup(Config.dav_group_file)
        htgroup.purge()

        try:
            groups = [
                g.gr_name for g in grp.getgrall()
                if g.gr_name.startswith("ovd_share_")
            ]
            for g in groups:
                System.groupDelete(g)
        except Exception:
            Logger.exception("Failed to purge groups")
            ret = False

        return ret
Beispiel #2
0
	def purgeGroup(self):
		users = System.groupMember(Config.group)
		if users is None:
			return False
		
		ret = True
		for user in users:
			if user == Config.dav_user:
				continue
			
			Logger.debug("FileServer:: deleting user '%s'"%(user))
			
			u = User(user)
			u.clean()
			if u.existSomeWhere():
				Logger.error("FS: unable to del user %s"%(user))
				ret =  False
		
		htgroup = HTGroup(Config.dav_group_file)
		htgroup.purge()
		
		try:
			groups = [g.gr_name for g in grp.getgrall() if g.gr_name.startswith("ovd_share_")]
			for g in groups:
				System.groupDelete(g)
                except Exception:
                        Logger.exception("Failed to purge groups")
           		ret = False
		
		return ret
Beispiel #3
0
    def purgeGroup(self):
        while True:
            users = System.groupMember(self.ovd_group_name)

            if users is None:
                return False

            if users == []:
                return True

            for user in users:
                # todo : check if the users is connected, if yes logoff his session
                if not System.userRemove(user):
                    return False

        return False
Beispiel #4
0
	def run(self):
		self.status = Role.STATUS_RUNNING
		while self.loop:
			time.sleep(2)
			if self.status == Role.STATUS_STOPPING:
				if len(self.get_enabled_usershares()) > 0:
					Logger.debug("FileServer:: Waiting for usershares removal")
					continue
				
				if len(System.groupMember(Config.group)) > 1:  # because www-data
					Logger.debug("FileServer:: Waiting for groups removal")
					continue
				
				break
				
		self.status = Role.STATUS_STOP
Beispiel #5
0
	def purgeGroup(self):
		while True:
			users = System.groupMember(self.ovd_group_name)
			
			if users is None:
				return False
			
			if users == []:
				return True
			
			for user in users:
				# todo : check if the users is connected, if yes logoff his session
				if not System.userRemove(user):
					return False
			
		return False
Beispiel #6
0
    def run(self):
        self.status = Role.STATUS_RUNNING
        while self.loop:
            time.sleep(2)
            if self.status == Role.STATUS_STOPPING:
                if len(self.get_enabled_usershares()) > 0:
                    Logger.debug("FileServer:: Waiting for usershares removal")
                    continue

                if len(System.groupMember(
                        Config.group)) > 1:  # because www-data
                    Logger.debug("FileServer:: Waiting for groups removal")
                    continue

                break

        self.status = Role.STATUS_STOP