Current Folder size for user

Please post here if you have problems in using Wing FTP Server.
Post Reply
mellul
Posts: 77
Joined: Mon Nov 16, 2009 2:00 pm

Current Folder size for user

Post by mellul »

Hi,

Is there a way I can retireve the current folder size for a specific user through the LUA inteface?

I need this as I have a script that changes user password and quota through a separate user inteface but whenever it is run, it resets the curent quota back to zero and not what it was before. It would be nice if this could be updated correctly so I do not have to update manually for each change that is made.

I believe if I can replace the current quota variable with the actual users file size, it would solve my problem.

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

Re: Current Folder size for user

Post by FTP »

Please check out this post:
http://www.wftpserver.com/bbs/viewtopic.php?f=6&t=178

It can help you change user password without changing other settings.
mellul
Posts: 77
Joined: Mon Nov 16, 2009 2:00 pm

Re: Current Folder size for user

Post by mellul »

Thanks but in this case I still need the option to change the maximum quota, if needed, within the same script. Thinking about it, I also need to know how to retrieve the maximum quota set for the user as well as the file size/current quota before the password is changed.
FTP
Site Admin
Posts: 2072
Joined: Tue Sep 29, 2009 6:09 am

Re: Current Folder size for user

Post by FTP »

Yes, like changing password, you can change every field for user structure.

Just replace this line:
tableUser.password = strNewPass
into:
tableUser.max_quota = nYourMaxQuota


BTW, you can find all the field names in the file "lua/ServerInterface.lua", from line 279.
mellul
Posts: 77
Joined: Mon Nov 16, 2009 2:00 pm

Re: Current Folder size for user

Post by mellul »

Thanks alot. That can be of a big help :)

Would you be able to direct me a little more on where I can find the list you mentioned?

Thanks again
mellul
Posts: 77
Joined: Mon Nov 16, 2009 2:00 pm

Re: Current Folder size for user

Post by mellul »

I found it :)

Thanks
mellul
Posts: 77
Joined: Mon Nov 16, 2009 2:00 pm

Re: Current Folder size for user

Post by mellul »

Hi,

I have finally had some time to play around with the script you gave me. I have changed it to asp and made it work partially.

Basically what I am trying to do is to give the option to the user to change either the password or the maximum quota or both together. Changing the password alone works but when I change the quota only, the quota changes but the password changes as well.

I am assuming that the table gives the password in md5 and when the table is given back to the AddUser command the password changes to its md5 equivalent. Hence changing only the maximum quota changes the password as well. Do you have any idea on how I can overcome this problem?

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

Re: Current Folder size for user

Post by FTP »

Please take a look on file "lua/ServerInterface.lua", from line 273.
If you don't want to change user password, just set its "oldpassword" field like this:
tableUser.oldpassword = tableUser.password
Post Reply