jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/328662 )
Change subject: Make CentralAuth work with expiring user groups in core
......................................................................
Make CentralAuth work with expiring user groups in core
This doesn't give CentralAuth expiring user rights; it just keeps
everything working after the merge of
I93c955dc7a970f78e32aa503c01c67da30971d1a in core.
Change-Id: I86eb1d5619347ce54a5f33a591417742ebe5d6f8
---
M includes/CentralAuthGroupMembershipProxy.php
M includes/specials/SpecialGlobalGroupMembership.php
2 files changed, 24 insertions(+), 1 deletion(-)
Approvals:
jenkins-bot: Verified
Anomie: Looks good to me, approved
diff --git a/includes/CentralAuthGroupMembershipProxy.php
b/includes/CentralAuthGroupMembershipProxy.php
index 65d86d3..2123c76 100644
--- a/includes/CentralAuthGroupMembershipProxy.php
+++ b/includes/CentralAuthGroupMembershipProxy.php
@@ -92,12 +92,28 @@
}
/**
+ * Replaces User::getGroupMemberships()
+ * @return array Associative array of (group name =>
UserGroupMembership object)
+ */
+ function getGroupMemberships() {
+ $groups = $this->getGroups();
+ return array_combine( $groups, array_map( function( $group ) {
+ return new UserGroupMembership( $this->getId(), $group
);
+ }, $groups ) );
+ }
+
+ /**
* replaces addUserGroup
* @param string[]|string $group
+ * @param string|null $expiry
*
* @return bool
*/
- function addGroup( $group ) {
+ function addGroup( $group, $expiry = null ) {
+ if ( $expiry !== null ) {
+ throw new InvalidArgumentException( __METHOD__ . '
cannot process expiries' );
+ }
+
$this->mGlobalUser->addToGlobalGroups( $group );
return true;
}
diff --git a/includes/specials/SpecialGlobalGroupMembership.php
b/includes/specials/SpecialGlobalGroupMembership.php
index e173abd..4ac4c20 100644
--- a/includes/specials/SpecialGlobalGroupMembership.php
+++ b/includes/specials/SpecialGlobalGroupMembership.php
@@ -25,6 +25,13 @@
}
/**
+ * @return bool
+ */
+ public function canProcessExpiries() {
+ return false;
+ }
+
+ /**
* Output a form to allow searching for a user
*/
function switchForm() {
--
To view, visit https://gerrit.wikimedia.org/r/328662
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I86eb1d5619347ce54a5f33a591417742ebe5d6f8
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: TTO <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Legoktm <[email protected]>
Gerrit-Reviewer: MarcoAurelio <[email protected]>
Gerrit-Reviewer: TTO <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits