Directory not being deleted when deleting user

Please post here if you have problems in using Wing FTP Server.

Directory not being deleted when deleting user

Postby epal » Mon Jul 23, 2012 6:16 am

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
epal
 
posts 14
 
joined Wed Jun 30, 2010 7:59 am

Re: Directory not being deleted when deleting user

Postby FTP » Mon Jul 23, 2012 7:14 am

Of course it won't delete the directory when deleting the user account, because it is physical directory.
FTP
Site Admin
 
posts 1236
 
joined Tue Sep 29, 2009 6:09 am

Re: Directory not being deleted when deleting user

Postby epal » Mon Jul 23, 2012 11:46 pm

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.
epal
 
posts 14
 
joined Wed Jun 30, 2010 7:59 am

Re: Directory not being deleted when deleting user

Postby FTP » Tue Jul 24, 2012 2:44 am

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
FTP
Site Admin
 
posts 1236
 
joined Tue Sep 29, 2009 6:09 am


Return to Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron