TTO has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/350116 )
Change subject: Expire the cache of a User object when a group membership is
set to expire
......................................................................
Expire the cache of a User object when a group membership is set to expire
To avoid user permissions persisting for up to 1 hour beyond their expiry
time.
Bug: T163691
Change-Id: I85b578e6b7816639c3d0101d66efb1efedb17af6
---
M includes/user/User.php
1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/16/350116/1
diff --git a/includes/user/User.php b/includes/user/User.php
index b8a36b8..3edd49f 100644
--- a/includes/user/User.php
+++ b/includes/user/User.php
@@ -509,6 +509,17 @@
$ttl = $cache->adaptiveTTL( wfTimestamp(
TS_UNIX, $this->mTouched ), $ttl );
+ // if a user group membership is about to
expire, the cache needs to
+ // expire at that time (T163691)
+ foreach ( $this->mGroupMemberships as $ugm ) {
+ if ( $ugm->getExpiry() ) {
+ $secondsUntilExpiry =
wfTimestamp( TS_UNIX, $ugm->getExpiry() ) - time();
+ if ( $secondsUntilExpiry > 0 &&
$secondsUntilExpiry < $ttl ) {
+ $ttl =
$secondsUntilExpiry;
+ }
+ }
+ }
+
return $data;
},
--
To view, visit https://gerrit.wikimedia.org/r/350116
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I85b578e6b7816639c3d0101d66efb1efedb17af6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TTO <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits