rejetto forum

Events and Unique Usernames

0 Members and 1 Guest are viewing this topic.

Offline fire2050

  • Occasional poster
  • *
    • Posts: 11
    • View Profile
Hello all,

So I have been looking into a method to notify me if a user logs into my server.

The best method to do this in my opinion would be to utilize the events triggers and output the username to a text file.

Then run a batch file that would email the info to myself.

Is this doable via the events log? If so I cant seem to find the triggers for the events window and then how could I output the unique username of who logged in to a text file? Perhaps a list to a text file?

Ex: larry,moe,curly,shemp,admin

Thanks for the help.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
problem is: currently there's no real login in HFS.
It relies on http authentication, that's different. There's no session. (next HFS version won't work this way)
But you can workaround this by using cookies.
You also have commands to set and get cookies in HFS.


Offline raybob

  • Tireless poster
  • ****
    • Posts: 454
    • View Profile
    • FileSplat.com
You could capture {.header|authorization.} under [request] with something like
 
Code: [Select]
{.if|{.header|authorization.}|{:{.save|user-{.time.}.txt|{.header|authorization.}.}:}.}
but the result would be encoded in base64 and would capture both passwords and usernames.
« Last Edit: February 10, 2012, 07:44:32 PM by raybob »


Offline fire2050

  • Occasional poster
  • *
    • Posts: 11
    • View Profile
Thanks for both of your input.

I guess I am not familiar enough with coding to know how to make what you gave as an example work. I tried what you have there and it seemed to do nothing.

Just a little more pushing in the right direction and it sounds like I should have something I can work with.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
currently there's login, everytime the password is sent.
so, it is "password" provided or not.
you can do something like

if (password provided) and (there's no cookie) {
  set the cookie
  notify about the user
}


another problem is: i think HFS currently will not let you know if the password is right or wrong. So if a user tries to enter with the wrong password, this method will let you think he logged in, while he didn't. I guess this is just too wrong.

HFS 3 will not have this problem.


Offline fire2050

  • Occasional poster
  • *
    • Posts: 11
    • View Profile
Ok I suppose I will just wait until HFS 3 comes out.

btw I love the simplicity and flexibility of your program.

Keep up the great work.


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
thanks, but don't hold your breath for version 3, it will probably arrive in a year or so.