-
Notifications
You must be signed in to change notification settings - Fork 172
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make the number of days since last login before making a user inactive a config #8416
Make the number of days since last login before making a user inactive a config #8416
Conversation
@@ -356,7 +361,8 @@ class SinglePointLogin | |||
} | |||
|
|||
if ($row['Active'] == 'N' | |||
|| $this->disabledDueToInactivity($username, 365) | |||
|| ($maxDaysInactive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because of the not-so-predictable behaviour of intval(), I would instead do a more explicit check like (!empty($maxDaysInactive) && is_numeric($maxDaysInactive))
intval:
Return Values ¶
The integer value of value on success, or 0 on failure. Empty arrays return 0, non-empty arrays return 1.
The maximum value depends on the system. 32 bit systems have a maximum signed integer range of -2147483648 to 2147483647. So for example on such a system, intval('1000000000000') will return 2147483647. The maximum signed integer value for 64 bit systems is 9223372036854775807.
Strings will most likely return 0 although this depends on the leftmost characters of the string. The common rules of integer casting apply
@ridz1208 Thanks for the quick review! Your comments should be addressed and I added a note to the roadmap call to discuss whether it is OK to have |
@cmadjar needs rebase, conflicts. |
add default value to config fix phrasing of the config to something hopefully clearer modify RB to add the new config
6549aef
to
4368970
Compare
@cmadjar seems like there's a problem with the tests on this PR, can you look into it when you get a chance? |
@driusan this passes the tests now. |
Brief summary of changes
This adds a new Config in the config module to allow projects to configure the number of days since a user last logged in before making their account inactive.
Testing instructions
SQL/New_patches/2023-02-28_create_max_days_inactive_config_for_users.sql
UPDATE user_login_history SET Login_timestamp='2020-02-28 19:28:35' WHERE userID=<new user id>