Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The following line of code in _autologout_get_user_timeout() will ALWAYS resolve to FALSE:
if (!variable_get('autologout_user_' . $userid, $default_timeout)) {
...
}
In the case that a user does have a user-specific timeout set of 60, then this will be if(!60){ which is FLASE. If the user does not have a user-specific timeout set, (and we assume default_timeout is 1800) then this will be if(!1800){ which is also false. This codes should be:
if (!variable_get('autologout_user_' . $userid, 0)) {
...
}
The attached patch solves this issue and fixes a few more coding standards issues
Comment | File | Size | Author |
---|---|---|---|
#1 | autologout-timeout.patch | 2.2 KB | bleen |
autologout-timeout.patch | 2.12 KB | bleen | |
Comments
Comment #1
bleen CreditAttribution: bleen commentedNow that we are actually getting into that if statement, we need to make sure that we bail out of the _autologout_get_user_timeout function for anon users otherwise you can get error when you are automatically logged out.
This patch adds that bailout
Comment #2
johnennew CreditAttribution: johnennew commentedHi all,
This has been fixed by:
http://drupal.org/node/1700706
Marking this as a duplicate