aboutsummaryrefslogtreecommitdiffstats
path: root/includes/Autopromote.php
Commit message (Collapse)AuthorAgeFilesLines
* Drop Autopromote class, deprecated since 1.35Petr Pchelko2021-04-191-70/+0
| | | | Change-Id: Iee9a3e43fc1689dde867ec7349f0347c741abc36
* Update a lot of unspecific "array" types in PHPDocsThiemo Kreuz2020-10-281-2/+2
| | | | | | | | | This includes fixing some mistakes, as well as removing redundant text that doesn't add new information, either because it literally repeats what the code already says, or is actually duplicated. Change-Id: I3a8dd8ce57192deda8916cc444c87d7ab1a36515
* Hard deprecate all methods in Autopromote classMartin Urbanec2020-09-181-2/+6
| | | | | | | Logic was moved to UserGroupManager, see T252621. All usages were in core, and are replaced. Change-Id: I6b0ff6834cded95dad0bc7dccbff0e0121580bb0
* Move autopromote groups logic into UserGroupManagerPetr Pchelko2020-06-111-166/+12
| | | | | Bug: T252621 Change-Id: Ic51119cd01771ab1b68294fa5dfacb8034e33b6b
* Hooks::run() call site migrationTim Starling2020-05-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Migrate all callers of Hooks::run() to use the new HookContainer/HookRunner system. General principles: * Use DI if it is already used. We're not changing the way state is managed in this patch. * HookContainer is always injected, not HookRunner. HookContainer is a service, it's a more generic interface, it is the only thing that provides isRegistered() which is needed in some cases, and a HookRunner can be efficiently constructed from it (confirmed by benchmark). Because HookContainer is needed for object construction, it is also needed by all factories. * "Ask your friendly local base class". Big hierarchies like SpecialPage and ApiBase have getHookContainer() and getHookRunner() methods in the base class, and classes that extend that base class are not expected to know or care where the base class gets its HookContainer from. * ProtectedHookAccessorTrait provides protected getHookContainer() and getHookRunner() methods, getting them from the global service container. The point of this is to ease migration to DI by ensuring that call sites ask their local friendly base class rather than getting a HookRunner from the service container directly. * Private $this->hookRunner. In some smaller classes where accessor methods did not seem warranted, there is a private HookRunner property which is accessed directly. Very rarely (two cases), there is a protected property, for consistency with code that conventionally assumes protected=private, but in cases where the class might actually be overridden, a protected accessor is preferred over a protected property. * The last resort: Hooks::runner(). Mostly for static, file-scope and global code. In a few cases it was used for objects with broken construction schemes, out of horror or laziness. Constructors with new required arguments: * AuthManager * BadFileLookup * BlockManager * ClassicInterwikiLookup * ContentHandlerFactory * ContentSecurityPolicy * DefaultOptionsManager * DerivedPageDataUpdater * FullSearchResultWidget * HtmlCacheUpdater * LanguageFactory * LanguageNameUtils * LinkRenderer * LinkRendererFactory * LocalisationCache * MagicWordFactory * MessageCache * NamespaceInfo * PageEditStash * PageHandlerFactory * PageUpdater * ParserFactory * PermissionManager * RevisionStore * RevisionStoreFactory * SearchEngineConfig * SearchEngineFactory * SearchFormWidget * SearchNearMatcher * SessionBackend * SpecialPageFactory * UserNameUtils * UserOptionsManager * WatchedItemQueryService * WatchedItemStore Constructors with new optional arguments: * DefaultPreferencesFactory * Language * LinkHolderArray * MovePage * Parser * ParserCache * PasswordReset * Router setHookContainer() now required after construction: * AuthenticationProvider * ResourceLoaderModule * SearchEngine Change-Id: Id442b0dbe43aba84bd5cf801d86dedc768b082c7
* Use namespaced IPUtils classKunal Mehta2020-01-011-1/+2
| | | | Change-Id: I047e099a93203a59093946d336a143d899d0271f
* docs: Avoid some scalar jugglingDaimona Eaytoy2019-09-191-2/+2
| | | | | | | | | Phan can treat scalar types as non-interchangeable with `scalar_implicit_cast` set to false. This patch fixes some of those issues (which are in total >1000), namely the ones with alphabetic order < includes/actions. Change-Id: Ib1c6573ab899088bc319b9da9ceaffc850da3dbe
* Remove deprecated User groups/permission static calls.Petr Pchelko2019-08-211-1/+5
| | | | | Bug: T220191 Change-Id: Ifa8afa90c432723b0bba0033a46b6a499c77e6fc
* Do not block autopromote on partial blocksDavid Barratt2019-07-181-2/+1
| | | | | | | | Currently, a partial block will block an autopromote, this should not be the case. Instead, autopromote will only be blocked by sitewide blocks. Bug: T228479 Change-Id: Id945b6ab374cb49c4a265b5ca149e13b68d4acac
* Use [...] instead of array(...) in PHP comments and documentationFomafix2019-06-171-4/+4
| | | | Change-Id: I0c83783051bf35fe785bc01644eeb2946902b6b2
* Deprecate User::isBlocked()David Barratt2019-04-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The method User::isBlocked() attempts to answer two questions: (1) Does the user have a block? (2) Is the user prevented from performing this action? The method can answer #1, but it cannot answer #2. Since User::getBlock() can also answer #1, this method is redundant. The method cannot answer #2 because there is not enough context in order to answer that question. If access is being checked against a Title object, all access checks can be performed with PermissionManager:userCan() which will also check the user's blocks. If performing all access checks is not desirable, using PermissionManager::isBlockedFrom() is also acceptable for only checking if the user is blocked. This method does *not* determine if the action is allowed, only that the user's block applies to that Title. If access is being checked without an existing Title, User::getBlock() can be used to get the user's block. Then Block::appliesToRight() can be used to determine if the block applies explicitly to a right (or returns null if it is unknown or false if explicitly allowed). If the user is creating a new Title, but the text of the title is not yet known (as in the case of Wikibase), access should be checked with Block::appliesToNamespace(). Bug: T209004 Change-Id: Ic0ad1b92e957797fee8dcd00bd1092fe69fa58f1
* In Autopromote skip edit count lookup if requirement is 0 or invalidTK-9992017-05-211-1/+7
| | | | | | | Autopromote makes a DB call to fetch user edit count when checking edit count requirements. We can skip this call if requirement is set to 0 or invalid (less than 0). Bug: T157718 Change-Id: I7bcfa6e7e4991fe7b48bef84ad24621564261abc
* Convert all array() syntax to []Kunal Mehta2016-02-171-7/+7
| | | | | | | | | | Per wikitech-l consensus: https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html Notes: * Disabled CallTimePassByReference due to false positives (T127163) Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
* Replace wfRunHooks calls with direct Hooks::run callsAaron Schulz2014-12-101-2/+2
| | | | | | * This avoids the overhead of an extra function call Change-Id: I8ee996f237fd111873ab51965bded3d91e61e4dd
* Fixed some @params documentation (includes/*)umherirrender2014-04-201-6/+6
| | | | | | | | | Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Also added some missing @param. Change-Id: I7f605aa9e117b5fd80d9b1440864fe526d2b14a5
* Try to make a dent in CodeSniffer reports on includes/ (1)Siebrand Mazeland2014-03-231-1/+2
| | | Change-Id: Iaf3120b4e32cc5835ef9ed86236d98679e2b87fa
* Fix spacing and break some linesumherirrender2013-08-241-1/+2
| | | | Change-Id: Ia57685d8858e02e399ad5c75ce64d12609d340ac
* Added space after switch/Removed spaces after unsetumherirrender2013-04-261-1/+1
| | | | | | While at it, added/removed some other spaces in the same files Change-Id: I84d8001aa123a008807ad5eb76f396aed7c899a4
* Spellchecked /includes directoryYuri Astrakhan2013-03-131-4/+3
| | | | | | | | | * Ran spell-checker over code comments in /includes/ * A few spellchecking fixes for wfDebug() calls Found one very strange (NOOP?) line in Linker.php - see "TODO: BUG?" Change-Id: Ibb86b51073b980eda9ecce2cf0b8dd33f058adbf
* Fixed @param tags to conform with Doxygen format.Tyler Anthony Romeo2013-03-111-2/+2
| | | | | | | | | | | Doxygen expects parameter types to come before the parameter name in @param tags. Used a quick regex to switch everything around where possible. This only fixes cases where a primitve variable (or a primitive followed by other types) is the variable type. Other cases will need to be fixed manually. Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
* Update docs for return and exception infoSiebrand Mazeland2012-10-091-0/+1
| | | | | | | * Removed some inline tabs in the process. * IDE fixed some incorrect leading spaces, too. Change-Id: Ic9303eff6db4424ac3f1fa2816839692b43e6190
* Added missing GPLv2 headers in some places.Alexandre Emsenhuber2012-05-221-1/+22
| | | | | | Also made file/class documentation more consistent. Change-Id: Ife63db5d36d833de4e0944f9b79ab0f80e7b84c5
* Fixing some of the "@return true" or "@return false", need to be "@return ↵Sam Reed2012-02-091-1/+1
| | | | | | | | | bool" and then the metadata can say true if foo, false if bar Other documentation improvements Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/111053
* Moved wfGetIP() to WebRequest::getIP():Alexandre Emsenhuber2011-08-181-2/+2
| | | | | | | | | * Changed all calls in core to the latter * Also marked wfGetForwardedFor() as deprecated * Moved wfGetIP() tests to WebRequestTest Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/94932
* Follow-up r90819: made XOR only work on two conditions per CR. Give a ↵Aaron Schulz2011-06-281-11/+4
| | | | | | | warning if three or more given. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90931
* Follow-up r90749: use a new 'autopromote' action for the autopromote rights ↵Aaron Schulz2011-06-261-1/+1
| | | | | | | log entries. Removed the 'rightsautocomment' msg. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90855
* Update calls to deprecated User::isValidEmailAddrSam Reed2011-06-261-3/+3
| | | | | | | | | Fix trailing whitespace Some minor documentation fixes Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90843
* Made '^' (XOR) in recCheckCondition() act as a one-hot detector. Before ↵Aaron Schulz2011-06-261-9/+11
| | | | | | | r28805, XOR silently ignored subconds beyond the first two. After r28805, XOR passed iff an odd number of subconds passed. It now passes iff exactly one subcond passes. This should be more intuitive, as I highly doubt anyone using 3+ subconds was doing it correctly before. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90819
* * Core:Aaron Schulz2011-06-261-1/+3
| | | | | | | | | | | | | | ** Made addAutopromoteOnceGroups() put in a user rights log entry ** Added APCOND_ISBOT cond to autopromote and updated some docs * FlaggedRevs: ** (bug 24948) Made $wgFlaggedRevsAutopromote a wrapper around $wgAutopromoteOnce and removed maybeMakeEditor()/recordDemote() (uses r90749) ** Split off new efSetFlaggedRevsOldAutopromoteConfig function ** Removed calls to FlaggedRevs class in setup function to avoid overhead ** Made cache keys in checkAutoPromoteCond() properly unique ** Made wasPreviouslyBlocked() protected and tweaked editSpacingCheck() param order Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90816
* * Follow-up r90749Aaron Schulz2011-06-251-2/+4
| | | | | | | | | | | | ** Tweaked addAutopromoteOnceGroups() calls for performance ** Some doc tweaks and fixes * Added NS_SPECIAL short-circuit on $wgTitle for file cache and removed unnecessary "is null" check * Pushed "$action != 'raw'" check into HTMLFileCache * Removed useless return value from performRequest() * Added type hint to performAction() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90776
* Follow-up r90749: pushed down accessing of $wgAutopromoteOnce to ↵Aaron Schulz2011-06-251-20/+21
| | | | | | | getAutopromoteOnceGroups() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90757
* Follow-up r90749:Aaron Schulz2011-06-251-48/+14
| | | | | | | | | * Removed clunky autopromoteOnceHook function and added $wgAutopromoteOnce. It currently supports edit or view based triggering. This makes configuration much simpler. * Added short-circuit to addAutopromoteOnceGroups() by checking if $criteria is empty * Spacing tweaks and typo fixes. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90755
* Added one-time promote support via Autopromote::autopromoteOnceHook ↵Aaron Schulz2011-06-251-0/+70
| | | | | | | function. This is still a bit rough on the edges. This uses a hook since extension may want to control when it's called for performance reasons. Patch by lampak. (for bug 24948) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90749
* And even more documentationSam Reed2011-05-281-2/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89061
* And more documentation. YaaaaySam Reed2011-05-281-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/89047
* Follow up r67073 : add curly to if statementAntoine Musso2010-10-211-1/+2
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/75163
* Fixup "} elseif ( $cond[0] = '!' ) {" from r35983Sam Reed2010-10-131-1/+1
| | | | | | | NB, why are some revisions marked ok by no one? :S Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/74727
* Fix a bunch of '? true : false' instancesChad Horohoe2010-09-271-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/73809
* Refactor to avoid defining globals inside switches.Platonides2010-08-121-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/70957
* Ran stylize.php, removed trailing whitespace, updated indentation and code ↵Siebrand Mazeland2010-05-301-21/+41
| | | | | | | formatting. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/67073
* Random indentation and code formatting updates. No functional changes.Siebrand Mazeland2010-02-141-1/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/62481
* * Add autopromote condition APCOND_BLOCKED to autopromote blocked users to ↵Ryan Schmidt2009-06-181-2/+4
| | | | | | | | | | | various user groups. * Add $wgRemoveGroups as a means of restricting a group's rights. The syntax is identical to $wgGroupPermissions, but users in these groups will have these rights stripped from them. * Modify Special:ListGroupRights so that it displays revoked permissions as well (the display of assigned vs. revoked is changeable via css). * Bump $wgStyleVersion Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/52083
* (bug 14737) Allow the autoconfirmed timer to run from the first editAaron Schulz2009-01-031-0/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/45365
* (bug 7492) Allow assignment of rights to specific IPs/rangesChad Horohoe2008-12-141-0/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/44592
* Testing commit access, per report. Minor whitespace change.Rotem Liss2008-08-181-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/39597
* Add a ! operator to autopromote conditionsAndrew Garrett2008-06-071-1/+6
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/35983
* Add GetAutoPromoteGroups hook, which was in my working copy but not ↵Andrew Garrett2008-06-041-0/+3
| | | | | | | committed yet (core change for TorBlock extension) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/35846
* WARNING: HUGE COMMITAlexandre Emsenhuber2008-05-201-5/+5
| | | | | | | | | | | | | | | | | | Doxygen documentation update: * Changed alls @addtogroup to @ingroup. @addtogroup adds the comment to the group description, but doesn't add the file, class, function, ... to the group like @ingroup does. See for example http://svn.wikimedia.org/doc/group__SpecialPage.html where it's impossible to see related files, classes, ... that should belong to that group. * Added @file to file description, it seems that it should be explicitely decalred for file descriptions, otherwise doxygen will think that the comment document the first class, variabled, function, ... that is in that file. * Removed some empty comments * Removed some ?> Added following groups: * ExternalStorage * JobQueue * MaintenanceLanguage One more thing: there are still a lot of warnings when generating the doc. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/35098
* Kill r34826's unnecessary boolval() per yesterday's IRC discussion (thought ↵Brion Vibber2008-05-151-1/+1
| | | | | | | vasilievv was going to revert himself, but guess not :D) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/34868
* * Move $var ? true : false check to boolval functionVictor Vasiliev2008-05-141-1/+1
| | | | | | | * Introduce $wgLogActionsHandlers Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/34826