Commit graph

879 commits

Author SHA1 Message Date
jenkins-bot
e36e7e352f Merge "Pass the search term into the SpecialSearchResultsAppend hook" 2015-10-07 10:37:50 +00:00
Gergő Tisza
4d7e8b44fb Add UserMailerTransformX and UserMailerSplitTo hooks
UserMailerTransformContent allows extensions to change the body of
an email sent via UserMailer::send(). This is applied before
low-level transformations such as multipart or content encoding.

UserMailerTransformMessage is similar but it is run after those
transformations.

UserMailerSplitTo allows extensions to request that a certain
user should always be emailed separately (so when UserMailer::send()
is called with an array of target addresses, that user will be split
out into a separate call). This is intended for content
transformations which need to be different per user, such as
encryption.

A side effect is that while before a call to UserMailer::send() was
either fully succeeded or fully failed, now the message might be
delivered to some targets but not others. send() will return a failed
Status object in those cases.

Bug: T12453
Change-Id: I4c3a018110173c3b5d52a753fdcbec397b590ced
2015-10-06 13:31:13 -07:00
Marius Hoch
ffe2a44af7 Pass the search term into the SpecialSearchResultsAppend hook
Very useful to do things that need to know the actual search
term (eg. to show further things related to that).

The old hook supported that as well, as documented on
https://www.mediawiki.org/wiki/Manual:Hooks/SpecialSearchResultsAppend

That hook has been re-introduced with e7551f16

Change-Id: I7ac6ad95b29f9da0802eb3340e27b8683bf9f76d
2015-10-04 22:47:01 +02:00
jenkins-bot
f484b8c44e Merge "Fix hook doc for SkinTemplateBuildNavUrlsNav_urlsAfterPermalink" 2015-09-25 19:47:08 +00:00
jenkins-bot
b2c0705b81 Merge "Fix hooks documentation for ArticleProtect/ArticleProtectComplete" 2015-09-25 19:47:04 +00:00
jenkins-bot
ed2d25eb0e Merge "Fix hook documentation for PageHistoryLineEnding" 2015-09-25 19:46:57 +00:00
jenkins-bot
e0663428d8 Merge "Fix hook documentation for ImagePageFileHistoryLine" 2015-09-25 19:37:58 +00:00
umherirrender
74c061b358 Fix hook doc for SkinTemplateBuildNavUrlsNav_urlsAfterPermalink
The last two parameter were not in documentation.

Follows 3c8c735c56 (r11803)
Follows 06be63aa1c (r28125)

Change-Id: I4fe91a6ad714ef06a187f7cd873fda5237103d2c
2015-09-23 21:29:27 +02:00
umherirrender
2fb7de8f48 Fix hooks documentation for ArticleProtect/ArticleProtectComplete
The last parameter is not in code, so remove it from documentation.

Was removed with a35fcb0bed (r12207)

Change-Id: I5625f621342c2b71c56df3b3167479ec3884acf8
2015-09-23 21:04:22 +02:00
umherirrender
b23488d983 Fix hook documentation for PageHistoryLineEnding
The first parameter was not in documentation

Follows 446f2d6cab (r20682)

Change-Id: Idd18aafe4e61ae9762db2648a641bf5ac00150a5
2015-09-23 20:58:40 +02:00
umherirrender
25f07b45ab Fix hook documentation for ImagePageFileHistoryLine
The first parameter was not in documentation.

Follows 4bb299cbce (r34948)

Change-Id: I8b406fae2483725e18b6f7065ee0fa8f164df1f2
2015-09-23 20:54:04 +02:00
jenkins-bot
70e760ee4e Merge "Add hook to allow lazy loading of import sources" 2015-09-23 16:30:36 +00:00
jenkins-bot
a09d063de3 Merge "Fix hook documentation for PageRenderingHash" 2015-09-23 08:05:33 +00:00
jenkins-bot
82a26e81b4 Merge "Fix hook documentation for UploadFormSourceDescriptors" 2015-09-23 07:56:34 +00:00
This, that and the other
d3b85592ea Add hook to allow lazy loading of import sources
Currently import sources have to be set into $wgImportSources as part of
wiki startup. This is not practical for the WMF cluster, where we need some
reasonably complex logic to set up the import source structure.

This change allows the import source list to be populated from a new
"ImportSources" hook. This hook is only called when the list of import
sources is actually needed (namely, when a user with relevant permissions
loads Special:Import).

Bug: T17583
Change-Id: Ice9a19cb6dfe53ae72aa71353d0553ee9338f233
2015-09-23 17:54:31 +10:00
umherirrender
f99c4a0690 Fix hook documentation for PageRenderingHash
The last parameter was not in documentation.

Follows Ieecb27216c39b7e6e354b4a1904fbff06506307d

Change-Id: I1eaf0e98a97f804f6b402517e45fcad54ee65ac0
2015-09-23 07:47:24 +00:00
Kunal Mehta
bdf3f3e2d7 Add the performer to the UserRightsChanged hook
This allows extensions (e.g. Echo) to detect who made the change without
relying upon $wgUser. It also allows for differentiation between
autopromotion entries which will pass in `false` as the performer.

Change-Id: Idebd78b54dcea1bdc84c83f402e87b240ab4ade1
2015-09-22 10:58:20 -07:00
jenkins-bot
e491904eef Merge "Add new authentication-related hooks (and remove one) replacing some AuthPlugin methods" 2015-09-22 07:32:03 +00:00
jenkins-bot
989588978f Merge "Update documentation for EmailUser hooks" 2015-09-21 11:31:59 +00:00
umherirrender
20318ecd87 Update documentation for EmailUser hooks
Document the missing $error parameter of the EmailUser hook.
Clarify the type of the address parameter
Also add an comment, why a variable is used twice

Follows 38c7c8f895 (r64903)

Change-Id: I1c5636dc378667ef2798c69659b43f70734f4144
2015-09-20 18:04:30 +00:00
umherirrender
3d251d0761 Fix hook documentation for UploadFormSourceDescriptors
The second and third parameter were not in documentation.

Follows 91e4d80448 (r57868)

Change-Id: Ife98beab4e231d1a4236ec6bfb627afa4f818a6f
2015-09-20 17:49:23 +00:00
umherirrender
ef51d243ab Fix hook documentation for ArticleRevisionVisibilitySet
The last parameter was not in documentation.

Follows I6a14c7b95041fdd44d7962af6dc139bcc29f7223

Change-Id: I5e5d8948d6a1f4dc2db09028c77cfb79fb4ed5d0
2015-09-20 17:38:31 +00:00
Brad Jorsch
37062a0c0d Add new authentication-related hooks (and remove one) replacing some AuthPlugin methods
* LocalUserCreated: Replaces AuthPlugin::initUser()
* UserGroupsChanged: Replaces AuthPlugin::updateExternalDBGroups()
** The similar UserRights hook is deprecated, mainly to get rid of the
   passing of $user by reference.
* UserIsHidden: Replaces AuthPluginUser::isHidden()
* UserIsLocked: Replaces AuthPluginUser::isLocked()
* UserLoggedIn: Replaces AuthPlugin::updateUser()

Also, AuthPlugin::updateExternalDB() is deprecated in favor of the
existing UserSaveSettings hook.

Also, 'ResetSessionID' has been removed. Nothing uses it, I don't know
why I even added it in the first place.

Also, replacing the User object passed to AuthPlugin::initUser() and
AuthPlugin::updateUser() will now raise a warning.

Change-Id: If7474cfb26a29b11c2e78147069419ca3b1cba95
2015-09-18 10:46:13 -04:00
daniel
ef1f4af079 Allow Linker::formatComment to link to another wiki per default.
This also adds tests against injection to LinkerTest.

Bug: T111676
Change-Id: I757f2b91f3b50d789d04e530049c34b4628253e3
2015-09-15 18:10:33 +02:00
Bartosz Dziewoński
2f30ff7a86 Introduce mediawiki.ForeignApi
mw.ForeignApi is an extension of mw.Api, automatically handling
everything required to communicate with another MediaWiki wiki via
cross-origin requests (CORS).

Authentication-related MediaWiki extensions may extend it further to
ensure that the user authenticated on the current wiki will be
automatically authenticated on the foreign one. A CentralAuth
implementation is provided in I0fd05ef8b9c9db0fdb59c6cb248f364259f80456.

Bug: T66636
Change-Id: Ic20b9682d28633baa87d22e6e9fb71ce507da58d
2015-08-21 17:00:01 +00:00
Kaldari
b672916864 Adding documentation for new RandomPageQuery hook to hooks.txt
Hook added in I91cd231d1

Change-Id: I448e0227b00e0e5b9390b144b9de360b8453f9ff
2015-08-12 23:44:53 -07:00
Ricordisamoa
2281d1342d Fix name of the 'PageViewUpdates' hook in docs
Added with commit 12c370c68b

Change-Id: I53e90c2185841da1b4e2245f96748a1830003967
2015-07-18 16:18:13 +00:00
csteipp
6a69a4eb73 Add "purpose" to password validity check
Allow callers to specify why they are checking a passwords validity, so
some checks can be modified. Only check the default policy on creation,
since the account doesn't exist it's not a member of any groups.

Bug: T104615
Change-Id: I56b66002562aaa1493d94a90309bc8e4ae3841c8
2015-07-14 20:04:23 +00:00
Matthias Mullie
dc3ddcc4a2 Allow hooks to abort lines in EnhancedRC
Bug: T104564
Change-Id: I4a2f97d83f38071984d571773a6b09b6b6643d6d
2015-07-03 10:18:58 +02:00
Matthias Mullie
94f153db6a Add hook EnhancedChangesListModifyBlockLineData
Introduce a new hook to allow (single) block-level entries.
Very similar to EnhancedChangesListModifyLineData.

Bug: T104399
Change-Id: I6b4715277d44e5f09d7a230b33e956676aeab1c2
2015-07-03 10:16:52 +02:00
Ori Livneh
7740122de8 Add a scary, all-caps warning to the docs for RejectParserCacheValue
Follows I660679a4.

Change-Id: I65bde4f0f6939c9a1e3e06dcbdbf9856e4416df9
2015-06-26 17:46:34 -07:00
Stephane Bisson
28f2fe8a22 Add 'EnhancedChangesListModifyLineData' hook
Gives extensions a chance to modify the data used to
build each enhanced recent change 'inner' lines
(as opposed to the header lines).

Bug: T102021
Change-Id: Ia8a796fb9621db14d6574e66a4572e1fdf3bad03
2015-06-26 12:51:55 -07:00
Ori Livneh
207dfd2adf Add RejectParserCacheValue hook
Add a new hook, 'RejectParserCacheValue', which allows extensions to reject an
otherwise-successful parser cache lookup. The intent is to allow extensions to
manage the eviction of archaic HTML output from the cache.

Change-Id: I660679a48c46608f859bd52b31d6a888aabcc9ac
2015-06-23 11:23:57 -07:00
James Earl Douglas
e7551f1621 Add a SpecialSearchResultsAppend hook
This allows additional HTML to be included below search results.  This
will be used to optionally include a feedback link fter search results.

Bug: T101783
Change-Id: I5c4bab12ed0b022c84aa6b50ab72635e9dd0bd0c
2015-06-15 12:59:36 -07:00
csteipp
1a20dc9362 Password validity by policy per group
Make password policies defined in a configurable policy, which is
defined by group. A user's password policy will be the maximum of
each group policy that the user belongs to.

Bug: T94774
Change-Id: Iad8e49ffcffed38df6293db0ef31a227d3962003
2015-06-10 10:34:17 -07:00
Bryan Davis
4111fb7003 Normalize hooks.txt formatting
* Line wrap at 80 columns
* Added missing '$' for pass by reference parameters
* "$param_name: ..." for all params
* Parameter descriptions that wrap have a 2 space hanging indent
* "DEPRECATED! Use ..." immediately follows hook name
* Indent code examples with tabs per MW coding standards
* Move "hanging" information into description headers
* Fix some really out-of-order alphabetizations

Change-Id: Ic5453c90fb9b58e9fc137d8f45dcd255957bf76d
2015-06-03 15:38:57 -04:00
Gergő Tisza
d0d539e6ba Add a hook for reporting exceptions
Bug: T100141
Change-Id: I893f8b93e09f9ef70beef46922d304fdb3600b78
2015-06-03 05:09:41 +00:00
daniel
d39e1e24d1 Introduce ParserCacheSaveComplete hook.
Rationale: give extensions a way to track which "renderings"
of a page exist in the cache. This is particularly relevant
for multi-lingual wikis that splpit the parser cache by user
language on some pages. In that case, hooking into
ParserAfterParse or LinksUpdateComplete is insufficient to
track all language specific renderings.

Bug: T99511
Change-Id: Iebf526098ca837a7df637c650097119495000c81
2015-05-25 13:35:23 +00:00
jenkins-bot
d864012f33 Merge "Remove unused 'XMPGetInfo' and 'XMPGetResults' hooks" 2015-05-23 21:15:02 +00:00
Kunal Mehta
4feb2ac7f2 Remove unused 'XMPGetInfo' and 'XMPGetResults' hooks
These hooks are unused in all extensions in Gerrit. We need to remove
them so we can move these classes into a separate library.

Change-Id: I66406c642168adc703361b75deb95c830c1ddab1
2015-05-23 23:05:10 +02:00
jenkins-bot
35073a9d89 Merge "SpecialStatsAddExtra: Format column label with msg" 2015-05-23 13:23:52 +00:00
Mark A. Hershberger
0f19ee9d85 SpecialStatsAddExtra: Format column label with msg
This allows the user of the SpecialStatsAddExtra hook to provide
formatting for the row label using an i18n message key.  If given, the
message is given the row key as a parameter.  To maintain backward
compatibility, the key is used as-is as was done previously if a message
key is not provided.

Bug: T97623
Change-Id: I43c522b24372e115ed78adf69848bf50cbab8295
2015-05-23 15:05:07 +02:00
Jackmcbarn
62c3fe221f Allow running code during unstrip
When adding strip markers, allow closures to be passed in place of text.
The closure is then called during unstrip. Also, add a hook that runs
after unstripGeneral. This is needed for Extension:Cite's I0e136f952.

Change-Id: If83b0623671fd67e5ccc9deaaaab456a6679af8f
2015-05-13 02:44:20 +00:00
Brad Jorsch
dc15ea106a ApiHelp: Make 'toc' parameter work
Bug: T98378
Change-Id: I0219689f621e325fc22f0eab6e4c000e1b2fa06f
2015-05-06 13:37:41 -04:00
Mark A. Hershberger
12c370c68b Create PageViewUpdates hook
Bug: T97622
Change-Id: I0f2dedf84a540b6f87623792c7b4f8b8ad8f8059
2015-04-30 09:17:33 -04:00
daniel
a7f26eb3b7 Introduce PageHistoryPager::doBatchLookups hook.
The intention of the new hook is to allow extensions to prefetch
any information that may be needed for displaying history rows.

In particular, this is needed by Wikibase to allow us to inject
localized entity labels into the edit summaries.

Bug: T95672
Change-Id: Ie10ef99154da35713a4f583e2de2162fba28eef2
2015-04-16 16:02:13 +00:00
daniel
c95ec07359 New hook: OpportunisticLinksUpdate
Change-Id: I8b9238cd6b0010ad91fae24d4eb1e7cd0c201931
2015-04-01 11:17:57 +00:00
Matthias Mullie
62a5454aad Let extensions add entries to Special:DeletedContributions
Bug: T90973
Change-Id: I0cb5340311262084a3120fdb0314fd26193c07a3
2015-03-25 13:42:28 +01:00
jenkins-bot
cbed702308 Merge "Update code examples in docs/hooks.txt" 2015-03-14 08:02:51 +00:00
umherirrender
a0f14b1487 Update code examples in docs/hooks.txt
Adjust for code convention and wfRunHooks -> Hooks::run

Bug: T85588
Change-Id: I0297e389eb761822b0b5b9ea7a0a0a7990790677
2015-03-14 08:41:09 +01:00