Hi
Would it be possible to add events/triggers at a user rather than a domain level? Maybe have another tab under edit user, which would allow you to add one of more event rules, maybe even allow one rule to be spread over multiple events (upload by ftp,http,ssh - fire rule 1.....)
Chris
Event management at a user level
-
- Site Admin
- Posts: 2084
- Joined: Tue Sep 29, 2009 6:09 am
Re: Event management at a user level
If you want to handle some complex event, you can write Lua script like this:
Code: Select all
if "%Name" == "aa" then
c_SendMail("aa@gmail.com","a file has been uploaded","%Name uploaded %PathName","","SMTP_CONFIG")
elseif "%Name" == "bb" then
c_SendMail("bb@gmail.com","a file has been uploaded","%Name uploaded %PathName","","SMTP_CONFIG")
end
-
- Posts: 20
- Joined: Fri Dec 11, 2009 10:34 pm
Re: Event management at a user level
Hi
I know you could that, but that approach will get unwieldly in time when you have lots of users etc.
Chris
I know you could that, but that approach will get unwieldly in time when you have lots of users etc.
Chris
-
- Site Admin
- Posts: 2084
- Joined: Tue Sep 29, 2009 6:09 am
Re: Event management at a user level
Currently WingFTP only can do such thing, what's your detailed requirement?
-
- Posts: 20
- Joined: Fri Dec 11, 2009 10:34 pm
Re: Event management at a user level
Hi
I was just thinking about how dealing with these rules could be improved. At the moment you have to open each of the events you want script seperately and put conditional statements in for each user.
It would make sense to control event scripting etc by each user - so you could just look at an event managment tab on the user window and say add an event like email me a message and be able to select one or more event listeners - like ftp file uploads and http file uploads. It then makes it clearer to audit the events attached to each user (rather than unpicking http upload event lua code for multiple users then doing the same for ftp upload lua code etc.
Thanks
Chris
I was just thinking about how dealing with these rules could be improved. At the moment you have to open each of the events you want script seperately and put conditional statements in for each user.
It would make sense to control event scripting etc by each user - so you could just look at an event managment tab on the user window and say add an event like email me a message and be able to select one or more event listeners - like ftp file uploads and http file uploads. It then makes it clearer to audit the events attached to each user (rather than unpicking http upload event lua code for multiple users then doing the same for ftp upload lua code etc.
Thanks
Chris
-
- Site Admin
- Posts: 2084
- Joined: Tue Sep 29, 2009 6:09 am
Re: Event management at a user level
Yes, I know event for each account can be managed easily, but we have no plan to add such feature for the current version, and for your requirement, I will provide you another good solution:
1. Put the email address into "User -> Notes -> Email address" for the user account who want to be notified.
2. Add the following Lua script into the event "OnFileUploaded":
1. Put the email address into "User -> Notes -> Email address" for the user account who want to be notified.
2. Add the following Lua script into the event "OnFileUploaded":
Code: Select all
local user = c_GetUser("%Domain","%Name")
local user_email = user.note_email
if user_email ~= nil and user_email ~= "" then
c_SendMail(user_email,"a file has been uploaded","%Name uploaded into %PathName","","SMTP_CONFIG")
end
-
- Posts: 20
- Joined: Fri Dec 11, 2009 10:34 pm
Re: Event management at a user level
Hi
A bit late in the day I know, but thanks for the code - very useful.
Cheers
Chris
A bit late in the day I know, but thanks for the code - very useful.
Cheers
Chris
-
- Posts: 1
- Joined: Wed May 29, 2013 12:32 pm
Re: Event management at a user level
Hey,FTP wrote:Yes, I know event for each account can be managed easily, but we have no plan to add such feature for the current version, and for your requirement, I will provide you another good solution:
1. Put the email address into "User -> Notes -> Email address" for the user account who want to be notified.
2. Add the following Lua script into the event "OnFileUploaded":
Code: Select all
local user = c_GetUser("%Domain","%Name") local user_email = user.note_email if user_email ~= nil and user_email ~= "" then c_SendMail(user_email,"a file has been uploaded","%Name uploaded into %PathName","","SMTP_CONFIG") end
can you give me an complete example? I don`t know what you mean with ~ or nil ..
Sorry, today is my first day with Wing FTP.
I tried out, but it does`t work
Code: Select all
local user = c_GetUser("%Domain","%Name")
local user_email = user.note_email
if user_email ~= nil and user_email ~= "" then
c_SendMail(user_email,"a file has been uploaded","%Name uploaded into %PathName","","FTP-Server")
end
-
- Site Admin
- Posts: 2084
- Joined: Tue Sep 29, 2009 6:09 am
Re: Event management at a user level
What you need to do is just replace this string "SMTP_CONFIG" into your own SMTP configuration name.
-
- Posts: 31
- Joined: Tue Nov 07, 2017 7:31 pm
Re: Event management at a user level
it would be really helpful to get event management per user going.FTP wrote:Yes, I know event for each account can be managed easily, but we have no plan to add such feature for the current version, {...}