Closed GitRms closed 8 years ago
Hello, thanks for reporting the issue. This issue is partially resolved in the "develop" branch. I should be able to release an update today. Cheers,
Issue fixed in develop. You can test if you wish. I will release tomorrow.
Hello, It logs all login attempts now but sends email for successfull logins only. The setting "Select what to audit" is set to "Failures and successes".
Hello, I release the update. For email on failure, I didn't implement it yet. I promise to do it quickly!
I added the possibility to get emails for login failures. It's in the 'develop' branch at the moment. Please give me your feedback if you test it. Cheers,
Hello, It returns the following:
RAILS_ENV=production bundle exec rake redmine:plugins:migrate
/usr/local/rvm/gems/ruby-2.2.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot"
rake aborted!
NoMethodError: undefined method `empty?' for nil:NilClass
/home/XXXXX/public_html/3.2.1/plugins/redmine_login_audit/init.rb:42:in `block in <top (required)>'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:446:in `instance_exec'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:446:in `block in make_lambda'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:192:in `call'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:192:in `block in simple'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:504:in `call'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:504:in `block in call'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:504:in `each'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:504:in `call'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:92:in `__run_callbacks__'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:778:in `_run_prepare_callbacks'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/local/rvm/gems/ruby-2.2.0/gems/actionpack-4.2.5.2/lib/action_dispatch/middleware/reloader.rb:83:in `prepare!'
/usr/local/rvm/gems/ruby-2.2.0/gems/actionpack-4.2.5.2/lib/action_dispatch/middleware/reloader.rb:55:in `prepare!'
/usr/local/rvm/gems/ruby-2.2.0/gems/railties-4.2.5.2/lib/rails/application/finisher.rb:50:in `block in <module:Finisher>'
/usr/local/rvm/gems/ruby-2.2.0/gems/railties-4.2.5.2/lib/rails/initializable.rb:30:in `instance_exec'
/usr/local/rvm/gems/ruby-2.2.0/gems/railties-4.2.5.2/lib/rails/initializable.rb:30:in `run'
/usr/local/rvm/gems/ruby-2.2.0/gems/railties-4.2.5.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/local/rvm/gems/ruby-2.2.0/gems/railties-4.2.5.2/lib/rails/initializable.rb:54:in `run_initializers'
/usr/local/rvm/gems/ruby-2.2.0/gems/railties-4.2.5.2/lib/rails/application.rb:352:in `initialize!'
/home/XXXXX/public_html/3.2.1/config/environment.rb:14:in `<top (required)>'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:274:in `block in require'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:240:in `load_dependency'
/usr/local/rvm/gems/ruby-2.2.0/gems/activesupport-4.2.5.2/lib/active_support/dependencies.rb:274:in `require'
/usr/local/rvm/gems/ruby-2.2.0/gems/railties-4.2.5.2/lib/rails/application.rb:328:in `require_environment!'
/usr/local/rvm/gems/ruby-2.2.0/gems/railties-4.2.5.2/lib/rails/application.rb:457:in `block in run_tasks_blocks'
/usr/local/rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `eval'
/usr/local/rvm/gems/ruby-2.2.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => redmine:plugins:migrate => environment
(See full trace by running task with --trace)
That's fixed. I updated the develop branch. Thank you for your testing!
It's working now. I found one small bug in the subject of successful email:
Subject: [web Login Failure] 'admin' - XXX.XXX.XXX.XXX
Thank you very much for the testing! I changed the mail subject. Why is it a bug or what do you think the subject should be?
I think the subject should be: [web Login Success] 'admin' - XXX.XXX.XXX.XXX on success and [web Login Failure] 'admin' - XXX.XXX.XXX.XXX on failure. Thank you.
Thank you again for your testing. I fixed that and released version 0.3.0.
I'm getting the following error in production.log:
LoginAudit: Failed to save login audit for User:'admin', id: 1, Login succeed: true, Error: undefined local variable or method `flash' for #<LoginAudit:0x007f61c97ae018
Failed logins are logged fine. How to fix? Thank you.
Redmine version: 3.2.1.stable Ruby version: 2.2.0 Rails version: 4.2.5.2