Doing a query on nearly every single init is a performance concern. It's not testing if user is logged in also.
Patch adds a variable check to suppress the query.

CommentFileSizeAuthor
expire_password.patch1.82 KBhefox

Comments

jaypan’s picture

That patch looks good. I'll play with it a bit next week and if everything looks good, I'll add it in to the module. Thank you for the patch.

jaypan’s picture

Status: Active » Needs review
jaypan’s picture

I've added this to version 3.1. I made a couple small changes though:
1) I set the default for 'enable password expiration' to 'TRUE' so as not to break the functionality on sites where people have password expiration set. If the default were FALSE, and someone updated to the newest version of code without checking their settings, their passwords would no longer expire and they may not realize.
2) I added the variable_set() code to the settings page submit function. You had added it to the form, but it wasn't saved anywhere. I am not returning system_settings_form() on the settings page (because of some calculations that need to be made in the submit function), so this had to be explicitly added.

Thank you for the patch, and for coming up with a way to slim down the code/footprint a little.

jaypan’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.