Event management at a user level

Post here if you have some suggestions or you want to request a new feature.

Event management at a user level

Postby webturtles » Fri Sep 07, 2012 12:02 pm

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
webturtles
 
posts 20
 
joined Fri Dec 11, 2009 10:34 pm

Re: Event management at a user level

Postby FTP » Sun Sep 09, 2012 4:51 pm

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

Re: Event management at a user level

Postby webturtles » Wed Sep 12, 2012 11:24 am

Hi

I know you could that, but that approach will get unwieldly in time when you have lots of users etc.

Chris
webturtles
 
posts 20
 
joined Fri Dec 11, 2009 10:34 pm

Re: Event management at a user level

Postby FTP » Thu Sep 13, 2012 2:43 pm

Currently WingFTP only can do such thing, what's your detailed requirement?
FTP
Site Admin
 
posts 1225
 
joined Tue Sep 29, 2009 6:09 am

Re: Event management at a user level

Postby webturtles » Wed Sep 19, 2012 3:12 pm

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
webturtles
 
posts 20
 
joined Fri Dec 11, 2009 10:34 pm

Re: Event management at a user level

Postby FTP » Sat Sep 22, 2012 6:37 am

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

Re: Event management at a user level

Postby webturtles » Tue Oct 23, 2012 2:40 pm

Hi

A bit late in the day I know, but thanks for the code - very useful.

Cheers
Chris
webturtles
 
posts 20
 
joined Fri Dec 11, 2009 10:34 pm

Re: Event management at a user level

Postby SpiderMike » Wed May 29, 2013 1:41 pm

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


Hey,

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


Thanks
SpiderMike
 
posts 1
 
joined Wed May 29, 2013 12:32 pm

Re: Event management at a user level

Postby FTP » Sat Jun 01, 2013 2:53 am

What you need to do is just replace this string "SMTP_CONFIG" into your own SMTP configuration name.
FTP
Site Admin
 
posts 1225
 
joined Tue Sep 29, 2009 6:09 am


Return to Suggestions & Wishlist

Who is online

Users browsing this forum: No registered users and 2 guests