wiki.techinc.nl/includes/api
Brad Jorsch 96bd79b4a3 Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames
Importing revisions in MediaWiki has long been weird: if the username on
the imported revision exists locally it's automatically attributed to
the local user, while if the name does not exist locally we wind up with
revision table rows with rev_user = 0 and rev_user_text being a valid
name that someone might later create. "Global" blocks too create rows
with ipb_by = 0 an ipb_by_text being a valid name.

The upcoming actor table change, as things currently stand, would
regularize that a bit by automatically attributing those imported
revisions to the newly-created user. But that's not necessarily what we
actually want to happen. And it would certainly confuse CentralAuth's
attempt to detect its own global blocks.

Thus, this patch introduces "interwiki" usernames that aren't valid for
local use, of the format "iw>Example".[1] Linker will interpret these
names and generate an appropriate interwiki link in history pages and
the like, as if from wikitext like `[[iw:User:Example]]`.

Imports for non-existant local users (and optionally for existing local
users too) will credit the edit to such an interwiki name. There is also
a new hook, 'ImportHandleUnknownUser', to allow extension such as
CentralAuth to create local users as their edits are imported.

Block will no longer accept usable-but-nonexistent names for 'byText' or
->setBlocker(). CentralAuth's global blocks will be submitted with an
interwiki username (see Ieae5d24f9).

Wikis that have imported edits or CentralAuth global blocks should run
the new maintenance/cleanupUsersWithNoId.php maintenance script. This
isn't done by update.php because (1) it needs an interwiki prefix to use
and (2) the updater can't know whether to pass the `--assign` flag.

[1]: '>' was used instead of the more usual ':' because WMF wikis have
many existing usernames containing colons.

Bug: T9240
Bug: T20209
Bug: T111605
Change-Id: I5401941c06102e8faa813910519d55482dff36cb
Depends-On: Ieae5d24f9098c1977447c50a8d4e2cab58a24d9f
2017-11-30 13:12:44 +11:00
..
i18n Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames 2017-11-30 13:12:44 +11:00
ApiAMCreateAccount.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiAuthManagerHelper.php Use correct variable name in @param documentation 2017-08-11 19:27:19 +02:00
ApiBase.php Merge "Add string length limits" 2017-11-21 15:21:26 +00:00
ApiBlock.php
ApiChangeAuthenticationData.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiCheckToken.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiClearHasMsg.php
ApiClientLogin.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiComparePages.php Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
ApiContinuationManager.php
ApiCSPReport.php Improve some parameter docs 2017-09-10 20:32:31 +02:00
ApiDelete.php Add missing & to @param documentation to match functon call 2017-08-11 18:47:46 +02:00
ApiDisabled.php API: Split description messages into summary + additional text 2017-06-15 13:46:55 -04:00
ApiEditPage.php EditPage: Don't allow clients that mangle unicode to edit 2017-09-20 19:57:51 -07:00
ApiEmailUser.php Allow users to restrict who can send them direct emails via Special:EmailUser 2017-09-13 11:28:12 -06:00
ApiErrorFormatter.php Revert Message dependency from DB exception classes 2017-09-27 09:18:15 +02:00
ApiExpandTemplates.php API: Pass revid when parsing text 2017-09-18 14:33:47 -04:00
ApiFeedContributions.php Fix action=feedcontributions date filtering parameters 2017-06-06 10:41:40 -04:00
ApiFeedRecentChanges.php API: Fix capitalization of SpecialRecentChanges* classes 2017-06-23 12:23:55 -07:00
ApiFeedWatchlist.php ApiFeedWatchlist: Fix copy-paste error 2017-09-14 15:53:22 -04:00
ApiFileRevert.php
ApiFormatBase.php Replace MimeMagic::singleton() calls 2017-11-27 02:13:51 +00:00
ApiFormatFeedWrapper.php Improve some parameter docs 2017-09-10 20:32:31 +02:00
ApiFormatJson.php
ApiFormatNone.php
ApiFormatPhp.php
ApiFormatRaw.php SECURITY: API: Avoid some silliness with browser-guessed filenames 2017-11-15 00:58:44 +00:00
ApiFormatXml.php
ApiHelp.php Merge "Add string length limits" 2017-11-21 15:21:26 +00:00
ApiHelpParamValueMessage.php Merge "Remove "@author Bryan Davis" and "Brad Jorsch" annotations" 2017-06-27 06:02:23 +00:00
ApiImageRotate.php
ApiImport.php Avoid DB rows with usable names but ID = 0 by introducing "interwiki" usernames 2017-11-30 13:12:44 +11:00
ApiLinkAccount.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiLogin.php SECURITY: Add throttling for BotPasswords authentication attempts 2017-11-15 00:58:44 +00:00
ApiLogout.php
ApiMain.php Remove @codingStandardsIgnore from long lines 2017-10-22 16:44:04 +02:00
ApiManageTags.php
ApiMergeHistory.php
ApiMessage.php Update documentation for IApiMessage interface 2017-09-25 12:14:55 -04:00
ApiModuleManager.php Remove empty lines at begin of function, if, foreach, switch 2017-07-01 11:34:16 +00:00
ApiMove.php Avoid using deprecated Title::canTalk() 2017-08-29 12:36:33 -07:00
ApiOpenSearch.php Merge "Remove "@author Bryan Davis" and "Brad Jorsch" annotations" 2017-06-27 06:02:23 +00:00
ApiOptions.php
ApiPageSet.php build: Update mediawiki/mediawiki-codesniffer to 0.10.1 2017-07-22 18:24:09 -07:00
ApiParamInfo.php Add string length limits 2017-11-21 10:24:11 +00:00
ApiParse.php API: Include setupSkinUserCss in prop=modules for useskin mode 2017-10-25 02:16:01 +01:00
ApiPatrol.php
ApiProtect.php
ApiPurge.php Add action/user tracking to link refresh jobs 2017-10-23 11:06:16 -07:00
ApiQuery.php SECURITY: API: Avoid some silliness with browser-guessed filenames 2017-11-15 00:58:44 +00:00
ApiQueryAllCategories.php
ApiQueryAllDeletedRevisions.php Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
ApiQueryAllImages.php Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
ApiQueryAllLinks.php
ApiQueryAllMessages.php
ApiQueryAllPages.php
ApiQueryAllRevisions.php Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
ApiQueryAllUsers.php Add comment table and code to start using it 2017-08-30 15:05:00 +10:00
ApiQueryAuthManagerInfo.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiQueryBacklinks.php Always put type information before variable name for @var tags 2017-09-04 11:06:51 -07:00
ApiQueryBacklinksprop.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiQueryBase.php ApiQuery: Fix type docs for $groups in ApiQueryBase::selectNamedDB() call chain 2017-09-11 17:46:24 +00:00
ApiQueryBlocks.php Add comment table and code to start using it 2017-08-30 15:05:00 +10:00
ApiQueryCategories.php API: Handle pltitles/tltemplates/clcategories/imimages with only invalid titles 2017-10-12 15:48:15 +00:00
ApiQueryCategoryInfo.php Always put type information before variable name for @var tags 2017-09-04 11:06:51 -07:00
ApiQueryCategoryMembers.php
ApiQueryContributors.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiQueryDeletedRevisions.php Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
ApiQueryDeletedrevs.php Add comment table and code to start using it 2017-08-30 15:05:00 +10:00
ApiQueryDisabled.php API: Split description messages into summary + additional text 2017-06-15 13:46:55 -04:00
ApiQueryDuplicateFiles.php Always put type information before variable name for @var tags 2017-09-04 11:06:51 -07:00
ApiQueryExternalLinks.php
ApiQueryExtLinksUsage.php
ApiQueryFilearchive.php Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
ApiQueryFileRepoInfo.php
ApiQueryGeneratorBase.php Improve some parameter docs 2017-09-10 20:32:31 +02:00
ApiQueryImageInfo.php Always put type information before variable name for @var tags 2017-09-04 11:06:51 -07:00
ApiQueryImages.php API: Handle pltitles/tltemplates/clcategories/imimages with only invalid titles 2017-10-12 15:48:15 +00:00
ApiQueryInfo.php Always put type information before variable name for @var tags 2017-09-04 11:06:51 -07:00
ApiQueryIWBacklinks.php
ApiQueryIWLinks.php
ApiQueryLangBacklinks.php
ApiQueryLangLinks.php
ApiQueryLinks.php ApiQueryLinks: Avoid MySQL order-by bug 2017-10-13 00:27:01 +00:00
ApiQueryLogEvents.php Add comment table and code to start using it 2017-08-30 15:05:00 +10:00
ApiQueryMyStashedFiles.php
ApiQueryPagePropNames.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiQueryPageProps.php
ApiQueryPagesWithProp.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiQueryPrefixSearch.php build: Prepare for mediawiki/mediawiki-codesniffer to 0.9.0 2017-06-26 17:14:31 +00:00
ApiQueryProtectedTitles.php Add comment table and code to start using it 2017-08-30 15:05:00 +10:00
ApiQueryQueryPage.php Always put type information before variable name for @var tags 2017-09-04 11:06:51 -07:00
ApiQueryRandom.php API: Have generator=random set a non-continuation value 2017-06-06 10:15:49 -04:00
ApiQueryRecentChanges.php ApiQueryRecentChanges: Fetch comment fields if rctoken is used 2017-09-07 16:58:57 -04:00
ApiQueryRevisions.php Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
ApiQueryRevisionsBase.php API: Deprecate diff and parse parameters in ApiQueryRevisionsBase 2017-06-16 12:01:44 -04:00
ApiQuerySearch.php Add page id to the API representation of pages in search results 2017-08-09 21:54:44 +00:00
ApiQuerySiteinfo.php API:Siteinfo: Include wgCategoryCollation in Siteinfo response 2017-11-27 01:24:49 +00:00
ApiQueryStashImageInfo.php
ApiQueryTags.php ApiQueryTags: Use cached statistics instead of querying hit counts ourselves 2017-05-04 18:04:58 -07:00
ApiQueryTokens.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiQueryUserContributions.php Add comment table and code to start using it 2017-08-30 15:05:00 +10:00
ApiQueryUserInfo.php API: Add the ability to flag parameter values as deprecated 2017-06-20 11:41:26 -04:00
ApiQueryUsers.php Replace selectFields() methods with getQueryInfo() 2017-10-30 22:57:33 +00:00
ApiQueryWatchlist.php ApiQueryWatchlist: Document type of $commentStore property 2017-09-11 14:24:09 +00:00
ApiQueryWatchlistRaw.php
ApiRemoveAuthenticationData.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiResetPassword.php Merge "Remove "@author Bryan Davis" and "Brad Jorsch" annotations" 2017-06-27 06:02:23 +00:00
ApiResult.php build: Update mediawiki/mediawiki-codesniffer to 0.10.1 2017-07-22 18:24:09 -07:00
ApiRevisionDelete.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiRollback.php
ApiRsd.php
ApiSerializable.php Remove "@author Bryan Davis" and "Brad Jorsch" annotations 2017-06-26 15:25:46 -06:00
ApiSetNotificationTimestamp.php Always put type information before variable name for @var tags 2017-09-04 11:06:51 -07:00
ApiSetPageLanguage.php Remove execute bits from non-executable files 2017-06-22 11:28:39 -04:00
ApiStashEdit.php Avoid blocking locks during API edit stash generation 2017-11-21 19:23:41 +00:00
ApiTag.php
ApiTokens.php
ApiUnblock.php
ApiUndelete.php
ApiUpload.php Always put type information before variable name for @var tags 2017-09-04 11:06:51 -07:00
ApiUsageException.php Fix inability of fetching message object 2017-10-04 15:24:42 +02:00
ApiUserrights.php Remove $wgDisableUserGroupExpiry feature flag 2017-05-06 20:50:42 +10:00
ApiValidatePassword.php
ApiWatch.php
SearchApi.php update mediawiki-codesniffer to 0.11.0 and fix issues 2017-08-11 22:27:51 +02:00