Project

General

Profile

Email notification on user log in

Added by Krzysztof Dryja over 10 years ago

Hi,

Is there a plugin or patch that enables option, that Administrator gets email notifications everytime any user is logging in?

I imagine this would increase security and could be used for statistics, etc.


Replies (7)

RE: Email notification on user log in - Added by Martin Denizet (redmine.org team member) over 10 years ago

It is simple to implement this using the ":controller_account_success_authentication_after" hook.
Tell me if you need help to implement.

Cheers,

Martin

RE: Email notification on user log in - Added by Krzysztof Dryja over 10 years ago

Martin Liu I'm not Ruby expert, just PHP so I would be grateful if you could help me with this. I'm using Redmine 2.1.4.stable.

RE: Email notification on user log in - Added by Martin Denizet (redmine.org team member) over 10 years ago

Dryja,
You can try that plugin I made on Github
Files are in the develop branch. I didn't make a release yet, I could use some feedback.
You can configure the email address in the settings of the plugin and you can view the recent login in the "Login Audit" page in the Administration menu.
If you have change requests, please post on Github.

RE: Email notification on user log in - Added by Krzysztof Dryja over 10 years ago

Martin,
Great work!
I've just fixed a typo in login_audit.rb.

validates :user_id, presence: true

I replaced with

validates :user_id, :presence => true

Not sure if this fix is made properly but it works now.

However I cannot push changes. I'm getting:

Username for 'https://github.com': cih997
Password for 'https://cih997@github.com': 
error: The requested URL returned error: 403 while accessing https://github.com/martin-denizet/redmine_login_audit.git/info/refs
fatal: HTTP request failed

RE: Email notification on user log in - Added by Krzysztof Dryja over 10 years ago

SSH Key was missing on my machine. Now I'm getting:

ERROR: Permission to martin-denizet/redmine_login_audit.git denied to cih997.

You could add me into this repository or just update this typo by yourself.

Thanks again!

RE: Email notification on user log in - Added by Martin Denizet (redmine.org team member) over 10 years ago

Krzysztof Dryja wrote:

SSH Key was missing on my machine. Now I'm getting:

[...]

You could add me into this repository or just update this typo by yourself.

Thanks again!

Good catch! But you cannot push directly to my Github repository. You need to fork my repository, commit to your repository and make a pull request. Don't bother, I'll implement it directly in the release.
I'll also implement a "purge" to delete old records and improve the paging for the first release.
I should implement filtering but maybe not immediately, I'll wait to get more feedback.
If you could endorse me on Corderwall, that would be appreciated, thanks!

    (1-7/7)