Page 1 of 1

Directory not being deleted when deleting user

Posted: Mon Jul 23, 2012 6:16 am
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

Re: Directory not being deleted when deleting user

Posted: Mon Jul 23, 2012 7:14 am
by FTP
Of course it won't delete the directory when deleting the user account, because it is physical directory.

Re: Directory not being deleted when deleting user

Posted: Mon Jul 23, 2012 11:46 pm
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.

Re: Directory not being deleted when deleting user

Posted: Tue Jul 24, 2012 2:44 am
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