go2null / redmine_account_policy

Password Expiry and other enhancements
GNU General Public License v3.0
4 stars 13 forks source link

Error on login #37

Closed ZleFox closed 3 years ago

ZleFox commented 8 years ago

Hello, We were trying to use only the account lock on wrong passwords feature (would be nice if by default all features are disabled btw). So we have put 0s to disable other policies. Then on login we got internal error:

NoMethodError (undefined method `to_date' for nil:NilClass
Did you mean?  to_a):
  plugins/redmine_account_policy/lib/redmine_account_policy/user_patch.rb:97:in `account_unused?'
  plugins/redmine_account_policy/lib/redmine_account_policy/account_controller_patch.rb:36:in `block in lock_unused_accounts!'
  plugins/redmine_account_policy/lib/redmine_account_policy/account_controller_patch.rb:35:in `lock_unused_accounts!'
  plugins/redmine_account_policy/lib/redmine_account_policy/account_controller_patch.rb:16:in `run_account_policy_daily_tasks'
  plugins/redmine_account_policy/lib/redmine_account_policy/controller_account_success_authentication_after_hook.rb:11:in `controller_account_success_authentication_after'
  lib/redmine/hook.rb:61:in `block (2 levels) in call_hook'
  lib/redmine/hook.rb:61:in `each'
  lib/redmine/hook.rb:61:in `block in call_hook'
  lib/redmine/hook.rb:58:in `tap'
  lib/redmine/hook.rb:58:in `call_hook'
  lib/redmine/hook.rb:91:in `call_hook'
  app/controllers/account_controller.rb:262:in `successful_authentication'
  plugins/redmine_account_policy/lib/redmine_account_policy/account_controller_patch.rb:233:in `successful_authentication_with_account_policy'
  app/controllers/account_controller.rb:203:in `password_authentication'
  plugins/redmine_account_policy/lib/redmine_account_policy/account_controller_patch.rb:163:in `password_authentication_with_account_policy'
  app/controllers/account_controller.rb:189:in `authenticate_user'
  app/controllers/account_controller.rb:40:in `login'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'
  plugins/redmine_dmsf/lib/redmine_dmsf/webdav/no_parse.rb:33:in `call'

Setting values on the options didn't fix the issue. Only removing the plugin allowed users to login again. Curiously, the plugin have worked correctly right after installation. Can you look into it? Thanks