LUA Script OnFileUpload to exclude specific user account

You can share your Lua Scripts with everybody here.

LUA Script OnFileUpload to exclude specific user account

Postby diskonekted » Thu Nov 22, 2012 1:48 am

Hi all,

As the subject suggests, I've got a basic LUA script that executes when an OnFileUpload event occurs. The code simply takes a copy of the uploaded file and retains this as a backup for auditing purposes.

The problem I have is that I want this to exctue for all users, execpt one. From what I can tell there is no method through the WingFTP GUI to do this, so I was wondering about an exception within the script; something like:

if <current upload user> == "FTP-Test"

end

elseif

<do rest of calculation>

I can't seem to locate if there is any function to determine the current account that it is performing actions via LUA; maybe I'm just looking at it the wrong way......

Thanks in advance, need coffee.....
diskonekted
 
posts 2
 
joined Thu Nov 22, 2012 1:40 am

Re: LUA Script OnFileUpload to exclude specific user account

Postby diskonekted » Thu Nov 22, 2012 6:20 am

So after messing around for an hour or so, I realised that the parameter that I need is simply "%Name".

so the line reads now as:

if "%Name" == "FTP-test" then
<do something>
end

Hopefully someone else can save their time by using the above info.
diskonekted
 
posts 2
 
joined Thu Nov 22, 2012 1:40 am

Re: LUA Script OnFileUpload to exclude specific user account

Postby FTP » Thu Nov 22, 2012 4:36 pm

Yes, you are right, and if you have thousands of users, you can also mark some data fields for the specific user account, like this: viewtopic.php?f=4&t=2852
FTP
Site Admin
 
posts 1225
 
joined Tue Sep 29, 2009 6:09 am


Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 1 guest

cron