Page 1 of 1

Current Folder size for user

Posted: Tue Mar 30, 2010 9:58 am
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

Re: Current Folder size for user

Posted: Tue Mar 30, 2010 10:39 am
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.

Re: Current Folder size for user

Posted: Tue Mar 30, 2010 10:49 am
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.

Re: Current Folder size for user

Posted: Tue Mar 30, 2010 11:07 am
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.

Re: Current Folder size for user

Posted: Tue Mar 30, 2010 1:18 pm
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

Re: Current Folder size for user

Posted: Tue Mar 30, 2010 1:36 pm
by mellul
I found it :)

Thanks

Re: Current Folder size for user

Posted: Mon Apr 26, 2010 3:05 pm
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

Re: Current Folder size for user

Posted: Mon Apr 26, 2010 4:20 pm
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