Skip to content

Commit

Permalink
Merge "Implement auto-account usurpation"
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnvanwezel authored and Gerrit Code Review committed Dec 14, 2021
2 parents 3cceda3 + 203d51d commit 852683a
Show file tree
Hide file tree
Showing 9 changed files with 426 additions and 51 deletions.
16 changes: 16 additions & 0 deletions WSOAuth.i18n.alias.php
@@ -0,0 +1,16 @@
<?php
/**
* Aliases for WSOAuth
*
* @file
* @ingroup Extensions
*/

$specialPageAliases = [];

/** English
* @author <your username>
*/
$specialPageAliases['en'] = [
'WSOAuthConnectRemote' => [ 'WSOAuthConnectRemote' ],
];
18 changes: 15 additions & 3 deletions extension.json
@@ -1,6 +1,6 @@
{
"name": "WSOAuth",
"version": "4.1",
"version": "5.0",
"namemsg": "wsoauth-extensionname",
"url": "https://www.mediawiki.org/wiki/Extension:WSOAuth",
"type": "other",
Expand All @@ -21,18 +21,23 @@
"i18n"
]
},
"ExtensionMessagesFiles": {
"WSOAuthAlias": "WSOAuth.i18n.alias.php"
},
"AutoloadClasses": {
"WSOAuth": "src/WSOAuth.php",
"AuthProviderFramework": "src/AuthProviderFramework.php",
"AuthProvider": "src/AuthProvider.php"
"AuthProvider": "src/AuthProvider.php",
"WSOAuthConnectRemoteSpecialPage": "src/WSOAuthConnectRemoteSpecialPage.php"
},
"AutoloadNamespaces": {
"AuthenticationProvider\\": "src/AuthenticationProvider/",
"Exception\\": "src/Exception/"
},
"Hooks": {
"PluggableAuthPopulateGroups": "WSOAuth::onPluggableAuthPopulateGroups",
"LoadExtensionSchemaUpdates": "WSOAuth::onLoadExtensionSchemaUpdates"
"LoadExtensionSchemaUpdates": "WSOAuth::onLoadExtensionSchemaUpdates",
"GetPreferences": "WSOAuth::onGetPreferences"
},
"config": {
"PluggableAuth_Class": {
Expand Down Expand Up @@ -74,8 +79,15 @@
"OAuthMigrateUsersByUsername": {
"value": false,
"descriptionmsg": "wsoauth-migrate-users-by-username-desc"
},
"OAuthDisallowRemoteOnlyAccounts": {
"value": false,
"descriptionmsg": "wsoauth-disallow-remote-only-accounts"
}
},
"SpecialPages": {
"WSOAuthConnectRemote": "WSOAuthConnectRemoteSpecialPage"
},
"load_composer_autoloader": true,
"manifest_version": 2
}
13 changes: 12 additions & 1 deletion i18n/en.json
Expand Up @@ -24,5 +24,16 @@
"wsoauth-initiate-login-failure": "Unable to initiate communication with OAuth provider.",
"wsoauth-migrate-users-by-username-desc": "Whether or not to allow usurpation of existing accounts by username.",
"wsoauth-user-already-exists-message": "The username \"$1\" is already taken.",
"wsoauth-not-configured-message": "Remote login has not been configured for this wiki. Please try a different authentication method."
"wsoauth-not-configured-message": "Remote login has not been configured for this wiki. Please try a different authentication method.",
"wsoauth-disallow-remote-only-accounts": "Whether or not to allow accounts to not have a local counterpart.",
"wsoauth-already-logged-in-through-remote": "You are already logged in through a remote or migrated account. You cannot connect a remote account to this account. If you want to log in using another remote, please log out and log in using the other account.",
"wsoauth-account-already-coupled": "You have already connected this local account to a remote account.",
"wsoauth-remote-only-accounts-disabled": "Remote-only login has been disabled on this wiki. A remote account must be connected to a local account.",
"wsoauth-remote-already-used": "The remote account \"$1\" is already connected to a (different) local account.",
"wsoauth-prefs-manage-remote": "Remote account:",
"wsoauth-connect-remote": "Connect a remote account",
"wsoauth-remote-connected": "Connected to remote account \"$1\"",
"wsoauth-connect-remote-special-page-header": "Enable remote sign-in",
"wsoauth-connect-remote-special-page-description": "You can activate remote sign-in by clicking the button below. After you have activated remote sign-in, you can use the remote service to sign in to this wiki. Your local credentials will remain valid.",
"wsoauth-connect-remote-special-page-wrapper-legend": "Enable remote sign-in"
}
13 changes: 12 additions & 1 deletion i18n/qqq.json
Expand Up @@ -25,5 +25,16 @@
"wsoauth-initiate-login-failure": "Message shown to the user when the communication to the OAuth-provider could not be initialised.",
"wsoauth-migrate-users-by-username-desc": "The description of the configuration parameter that defines whether ot not to allow account usurpation by username.",
"wsoauth-user-already-exists-message": "Message shown to the user if the username they are trying to register has already been taken and account usurpation is turned off.",
"wsoauth-not-configured-message": "Message shown to the user if the wiki is not configured for remote login."
"wsoauth-not-configured-message": "Message shown to the user if the wiki is not configured for remote login.",
"wsoauth-disallow-remote-only-accounts": "The description of the configuration parameter that defines whether or not to allow remote accounts without a local counterpart.",
"wsoauth-already-logged-in-through-remote": "Message shown to the user if they are already logged in through a remote or migrated account.",
"wsoauth-account-already-coupled": "Message shown to the user if they have already connected their local account to a remote account.",
"wsoauth-remote-only-accounts-disabled": "Message shown to the user if remote-only login has been disabled on this wiki.",
"wsoauth-remote-already-used": "Message shown to the user if their remote account has already been connected to a local account.",
"wsoauth-prefs-manage-remote": "Key shown on 'Basic information' section on Special:Preferences.",
"wsoauth-connect-remote": "Button text on Special:Preferences to connect their account to a remote.",
"wsoauth-remote-connected": "Text shown on Special:Preferences when the user has already connected a remote account.",
"wsoauth-connect-remote-special-page-header": "Title of the special page to connect your existing account to a remote account (Special:WSOAuthConnectRemote).",
"wsoauth-connect-remote-special-page-description": "Description shown on the remote sign-in form.",
"wsoauth-connect-remote-special-page-wrapper-legend": "Title shown on the form to connect your existing account to a remote account."
}
6 changes: 6 additions & 0 deletions sql/mysql/table_wsoauth_mappings.sql
@@ -0,0 +1,6 @@
CREATE TABLE /*_*/wsoauth_mappings (
wsoauth_user int unsigned NOT NULL UNIQUE,
wsoauth_remote_name varchar(512) NOT NULL,
PRIMARY KEY (wsoauth_remote_name),
FOREIGN KEY (wsoauth_user) REFERENCES /*_*/wsoauth_users(wsoauth_user)
) /*$wgDBTableOptions*/;
6 changes: 6 additions & 0 deletions sql/postgres/table_wsoauth_mappings.sql
@@ -0,0 +1,6 @@
CREATE TABLE /*_*/wsoauth_mappings (
wsoauth_user int unsigned NOT NULL UNIQUE,
wsoauth_remote_name varchar(512) NOT NULL,
PRIMARY KEY (wsoauth_remote_name),
FOREIGN KEY (wsoauth_user) REFERENCES /*_*/wsoauth_users(wsoauth_user)
) /*$wgDBTableOptions*/;
6 changes: 6 additions & 0 deletions sql/sqlite/table_wsoauth_mappings.sql
@@ -0,0 +1,6 @@
CREATE TABLE /*_*/wsoauth_mappings (
wsoauth_user int unsigned NOT NULL UNIQUE,
wsoauth_remote_name varchar(512) NOT NULL,
PRIMARY KEY (wsoauth_remote_name),
FOREIGN KEY (wsoauth_user) REFERENCES /*_*/wsoauth_users(wsoauth_user)
) /*$wgDBTableOptions*/;

0 comments on commit 852683a

Please sign in to comment.