moodle-an-hochschulen / moodle-theme_boost_union

Theme Boost Union is an enhanced child theme of Boost which is intended, on the one hand, to make Boost simply more configurable and, on the other hand, to provide helpful additional features for the daily Moodle operation of admins, teachers and students.
GNU General Public License v3.0
55 stars 49 forks source link

Bug: The Option footersuppresslogininfo removes the reset of the failed login attempts #658

Open NJahreis opened 1 month ago

NJahreis commented 1 month ago

Describe the bug If _theme_boostunion | footersuppresslogininfo is set to true the function user_count_login_failures($user, $reset = true) (https://github.com/moodle/moodle/blob/462d5f04a8fea5e2aaa7911cc700f90d54b8a73b/user/lib.php#L699-L714) is never called with the reset flag set to true. If additionally the core option core | displayloginfailures is turned on the displayed number of login failures in the header is always shown on all pages.

To Reproduce Steps to reproduce the behavior:

  1. Set both _theme_boostunion | footersuppresslogininfo and core | displayloginfailures to true
  2. Log out of moodle.
  3. Try to login unsucessfully one or multiple times.
  4. Log in sucessfully.
  5. You will see a notice of failed login attempts next to the user menu.
  6. Reload the page or navigate somewhere else.
  7. The failed login attempts are not reset and are still displayed.

Expected behavior The number of failed login attempts should only be displayed on the first page visited after login.

Screenshots Screenshot of the displayed message. image

Additional context The only function call reseting the number of failed login attempts in moodle core using user_count_login_failures is in the function core_renderer::login_info (https://github.com/moodle/moodle/blob/main/lib/outputrenderers.php#L1126-L1226) which as far as I can tell is normally only called in the footer.mustache files. Thus deactivating the login info in the footer removes the reset.

whuml commented 1 week ago

Hallo @NJahreis

Thank you for your report. We are aware of that bug now, should be fixed quite in time. However, perhaps you find some time to send pull request for that finding? Would be happy for your contribution.

Thanks for your help, feedback and contribution ;-)

LG Wolfgang