Directory not being deleted when deleting user

Please post here if you have problems in using Wing FTP Server.
Post Reply
epal
Posts: 14
Joined: Wed Jun 30, 2010 7:59 am

Directory not being deleted when deleting user

Post by epal »

Hi,

I'm sure that when i've deleted users from the web ui before, the associated directory is deleted as well.

This is no longer happening. When I delete a user now, the directory is being left behind.

How do I get it to delete the users directory as well?

Thanks,
Eugene
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Directory not being deleted when deleting user

Post by FTP »

Of course it won't delete the directory when deleting the user account, because it is physical directory.
epal
Posts: 14
Joined: Wed Jun 30, 2010 7:59 am

Re: Directory not being deleted when deleting user

Post by epal »

Shouldn't you then provide a method to delete the physical directory or an option when deleting a user to delete the directory as well?

You create the Admin UI with the intention of us to use it for managing the server, which includes creating the physical directories but expect us to provide our own method to deleting the directory separately from deleting the user.

Can you please add a function in to allow the deletion of physical directories.
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Directory not being deleted when deleting user

Post by FTP »

Though it is your personal requirement, and we do not recommend you do such thing, but if you really need such function, then you can modify the file "webadmin/admin_delete_user.html", insert the following script before the line "c_DeleteUser(domain, username)":

Code: Select all

local user = c_GetUser(domain,username)
if type(user.directories) == "table" then
	for _,directory in pairs(user.directories) do
		if c_IsDir(directory.dir) then
			c_RemoveFileDir(directory.dir)
		end
	end
end
Post Reply