Current Folder size for user

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

Current Folder size for user

Postby mellul » Tue Mar 30, 2010 9:58 am

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
mellul
 
posts 77
 
joined Mon Nov 16, 2009 2:00 pm

Re: Current Folder size for user

Postby FTP » Tue Mar 30, 2010 10:39 am

Please check out this post:
viewtopic.php?f=6&t=178

It can help you change user password without changing other settings.
FTP
Site Admin
 
posts 1243
 
joined Tue Sep 29, 2009 6:09 am

Re: Current Folder size for user

Postby mellul » Tue Mar 30, 2010 10:49 am

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.
mellul
 
posts 77
 
joined Mon Nov 16, 2009 2:00 pm

Re: Current Folder size for user

Postby FTP » Tue Mar 30, 2010 11:07 am

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

Re: Current Folder size for user

Postby mellul » Tue Mar 30, 2010 1:18 pm

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

Postby mellul » Tue Mar 30, 2010 1:36 pm

I found it :)

Thanks
mellul
 
posts 77
 
joined Mon Nov 16, 2009 2:00 pm

Re: Current Folder size for user

Postby mellul » Mon Apr 26, 2010 3:05 pm

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
mellul
 
posts 77
 
joined Mon Nov 16, 2009 2:00 pm

Re: Current Folder size for user

Postby FTP » Mon Apr 26, 2010 4:20 pm

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


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 2 guests