aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/changePassword.php
Commit message (Collapse)AuthorAgeFilesLines
* Add an option for changePassword.php to read the password through stdinAlex2024-12-061-2/+26
| | | | | Bug: T378203 Change-Id: Id846cb26406b6de9d9062c9516aa60b0e16a88da
* maintenance: Use more of namespaced Maintenance classReedy2024-10-161-0/+2
| | | | Change-Id: I53f2e32c73c92cc3a0deee48ebe6d13329a7a0cf
* Exclude boilerplate maintenance code from code coverage reportsDreamy Jazz2024-08-271-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | Why: * Maintenance scripts in core have bolierplate code that is added before and after the class to allow directly running the maintenance script. * Running the maintenance script directly has been deprecated since 1.40, so this boilerplate code is only to support a now deprecated method of running maintenance scripts. * This code cannot also be marked as covered, due to PHPUnit not recognising code coverage for files. * Therefore, it is best to ignore this boilerplate code in code coverage reports as it cannot be marked as covered and also is for deprecated code. What: * Wrap the boilerplate code (requiring Maintenance.php and then later defining the maintenance script class and running if the maintenance script was called directly) with @codeCoverageIgnore comments. * Some files use a different boilerplate code, however, these should also be marked as ignored for coverage for the same reason that coverage is not properly reported for files. Bug: T371167 Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
* Maintenance: Print errors from StatusValue objects in a consistent wayBartosz Dziewoński2024-06-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow Maintenance::error() and Maintenance::fatalError() to take StatusValue objects. They now print each error message from the status on a separate line, in English, ignoring on-wiki message overrides, as wikitext but after parser function expansion. Thoughts on the previously commonly used methods: - $status->getMessage( false, false, 'en' )->text() Almost the same as the new output, but it allows on-wiki message overrides, and if there is more than one error, it prefixes each line with a '*' (like a wikitext list). - $status->getMessage( false, false, 'en' )->plain() - $status->getWikiText( false, false, 'en' ) As above, but these forms do not expand parser functions such as {{GENDER:}}. - print_r( $status->getErrorsArray(), true ) - print_r( $status->getErrors(), true ) These forms output the message keys instead of the message text, which is not very human-readable. The error messages are now always printed using error() rather than output(), which means they go to STDERR rather than STDOUT and they're printed even with the --quiet flag. Change-Id: I5b8e7c7ed2a896a1029f58857a478d3f1b4b0589
* maintenance: Move username/userid validation into Maintenance classReedy2021-07-131-10/+1
| | | | Change-Id: Ie8f650eb03186feb7f69e7c71ef121c0d26404f5
* Do not output wikitext in maintenance scriptUmherirrender2019-09-201-1/+1
| | | | | | | | Also remove print_r with a string Always use english for maintenance scripts Bug: T229843 Change-Id: I539a1ac1f6a201dd8ee9ce89599cc34bebfba79f
* Improve changePassword.php error handlingGergő Tisza2019-04-081-12/+8
| | | | | | | | * User::changeAuthenticationData does not throw PasswordError * passwords are not stored in User so there's no point in saving it Bug: T219689 Change-Id: I2cef889523903fb8c5f091f63482970ea212446c
* Use ::class to resolve class names in maintenance scriptsUmherirrender2018-01-231-1/+1
| | | | | | | This helps to find renamed or misspelled classes earlier. Phan will check the class names Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
* Maintenance: add fatalError() methodBryan Davis2017-11-211-3/+3
| | | | | | | | Deprecate the second argument to Maintenance::error() in favor of a new Maintenance::fatalError() method. This is intended to make it easier to review flow control in maintenance scripts. Change-Id: I75699008638f7e99b11210c7bb9e2e131fca7c9e
* Remove $wgDisableAuthManagerGergő Tisza2016-08-091-13/+7
| | | | Change-Id: I2b2c9693a275fcc026916bd97f303e7a5c8df341
* Add new convenience User method for authentication data changeGergő Tisza2016-06-081-1/+15
| | | | | | | | | | | | | Also update createAndPromote.php to use it so it can display errors. Note that there are two possible approaches. The other is to do the update for all requests for which the test passed, even if some tests fail. The approach of the patch seems more manageable from the caller's point of view (either the operation was a success, or it failed and nothing happened). Change-Id: I86abed4b80472cd888337444fac0cbcb870b1246
* Use addDescription() instead of accessing mDescription directlyMax Semenik2016-01-301-1/+1
| | | | Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
* phpcs: More require/include is not a functionTimo Tijhof2013-05-211-1/+1
| | | | | | | | | | | | | Follows-up I1343872de7, Ia533aedf63 and I2df2f80b81. Also updated usage in text in documentation and the installer LocalSettingsGenerator. Most of them were handled by this regex: - find: (require|include|require_once|include_once)\s*\(\s*(.+?)\s*\)\s*;$ - replace: $1 $2; Change-Id: I6b38aad9a5149c9c43ce18bd8edbab14b8ce43fa
* phpcs: Fix WhiteSpace.LanguageConstructSpacing warningsTimo Tijhof2013-05-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Squiz.WhiteSpace.LanguageConstructSpacing: Language constructs must be followed by a single space; expected "require_once expression" but found "require_once(expression)" It is a keyword (e.g. like `new`, `return` and `print`). As such the parentheses don't make sense. Per our code conventions, we use a space after keywords like these. We appeared to have an unwritten exception for `require` that doesn't make sense. About 60% of require/include usage was missing the space and/or had superfluous parentheses. It is as silly as print("foo") or return("foo"), it works because keywords have no significance for whitespace between it and the expression that follows, and since experessions can be wrapped in parentheses for clarity (e.g. when doing string concatenation or mathematical operations) the parenthesis before and after basiclaly just ignored. Change-Id: I2df2f80b8123714bea7e0771bf94b51ad5bb4b87
* style: fix up commas in function argumentsAntoine Musso2013-02-061-1/+1
| | | | | | | | | | | | Fix up spaces in our function calls, we do not want spaces before a comma and try to avoid multiple commas whenever possible. Errors: * No space found after comma in function call * Space found before comma in function call Change-Id: I51aec02016f742422fa60b92ad35ba3f0ef59ba3
* Use __DIR__ instead of dirname( __FILE__ )jeroendedauw2012-08-271-1/+1
| | | | | | We can now do this since we finally switched to PHP 5.3 for MW 1.20 and get rid of the silly dirname(__FILE__) stuff :) Change-Id: Id9b2c9cd2e678197aa81c78adced5d1d31ff57b1
* Improve documentation of maintenance scripts.Alexandre Emsenhuber2012-06-161-0/+5
| | | | Change-Id: I328a3d42a09f2b082ebc153c2f399793e23942d7
* (bug 26854) Invalid user names go unchecked. Applied most of the patch ↵Roan Kattouw2011-11-201-1/+1
| | | | | | | submitted by Søren Løvborg, checking for null return values from User::newFromName() Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/103745
* Revert r96732Sam Reed2011-09-101-1/+0
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96733
* Invalidate user cache upon password changeSam Reed2011-09-101-0/+1
| | | | | | | Should help (maybe fix?) Bug 30850 - maintenance/changePassword.php does not purge (APC) cache Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/96732
* Allow changePassword.php to use username or useridSam Reed2011-03-271-2/+9
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/84857
* Fix concern raised by Brion in r74108 (but has really existed since the ↵Chad Horohoe2011-01-131-1/+1
| | | | | | | | | | | maintenance rewrite). Right now, including a maintenance script causes it to execute. This is bad when you want to reuse the particular class but not have it start executing all by itself. Until now, we relied on setting MW_NO_SETUP which was a) hacky, b) irreversable, and c) likely to be forgotten if you didn't use one of the wrappers like runChild(). Instead, move the freaky magic to doMaintenance and have *it* check if it's in a specific call stack that indicates this is being run from the file scope and should be executed. Rename DO_MAINTENANCE to RUN_MAINTENANCE_IF_MAIN so it's nice and clear what magic happens behind the require_once(). Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/80205
* Whitespace fixup under tha maint directory.Mark A. Hershberger2010-12-041-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/77711
* Standardised file description headers:Alexandre Emsenhuber2010-09-011-2/+3
| | | | | | | | * added @file where needed * replaced @copyright and @license with GPL header and copyright notice Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/72159
* Stylize maintenance folder..Sam Reed2010-05-221-6/+6
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/66751
* newline on that output so your terminal don't look funny :)Brion Vibber2009-09-041-1/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/55830
* Actually return something useful on successChad Horohoe2009-09-041-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/55818
* Revert r54244 which was stupid and fix this properly. Require ↵Chad Horohoe2009-08-031-1/+1
| | | | | | | commandLine.inc/Maintenance.php using the full path every time. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54312
* Don't put \n on the end of every error() call, just do it in error() itself. ↵Chad Horohoe2009-08-021-1/+1
| | | | | | | Still have to use on output(), because people like "Something...done" stuff. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54240
* Merge maintenance-work branch (now with less errors!):Chad Horohoe2009-08-021-41/+36
| | | | | | | | | | | * Docs have been updated to indicate the standard on how to write maintenance scripts (MW.org docs will follow) Have ported vast majority of maintenance scripts to new format. Remaining ones (mostly FiveUpgrade-related) are a bit more tricky. commandLine.inc is untouched for now. Many have gotten code-style updates as well. Deleted .inc files were only used by their .php counterparts, and have been merged into single files. * (bug 11867) Lock error on redirect table when running orphans.php * (bug 16322) Allow maintenance scripts to accept DB user/pass over input or params * (bug 18566) Maintenance script to un/protect pages * initStats overhaul, now uses class SiteStatsInit. Also fixes bug 18930 Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/54225
* Revert r52336 "Merge maintenance-work branch:"Brion Vibber2009-06-241-25/+40
| | | | | | | | Seems to have broken a bunch of stuff. Don't commit giant non-critical changes that break Setup.php and all maint scripts. Thanks! Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/52340
* Merge maintenance-work branch:Chad Horohoe2009-06-241-40/+25
| | | | | | | | | | | | * (bug 16322) Allow maint scripts to accept DB user/pass over input or params if no AdminSettings.php * (bug 18768) Remove AdminSettings.php from MediaWiki core * (bug 19157) createAndPromote error on bad password * (bug 14201) Create AdminSettings.php during wiki installation, in the same way as LocalSettings.php * Introduce new Maintenance class framework and port a good number of scripts over; the ones that are left are a little more complicated. Read the docs. * Not deleting "unused" files yet, don't want to break everything at once :) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/52336
* * Small cleanupsNiklas Laxström2009-02-011-3/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/46685
* * Changed password hash format, see wikitech-lTim Starling2008-06-051-9/+2
| | | | | | | | | * Made the PasswordReset and Maintenance extensions, and maintenance/changePassword.php work with CentralAuth, by calling User::setPassword() instead of updating the database directly. They work now even if you use an object cache. * Don't automatically log in as the user in question when CentralAuthUser::setPassword() is called, it's kind of uncool when an administrator is setting the password of another user. * Fix bug 14330 by setting the local passwords on demerge Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/35923
* Revert r35178 and normalize User's getID() and setID() methods to prettier ↵Brion Vibber2008-05-221-3/+3
| | | | | | | | | getId() and setId() This doesn't accomplish anything, of course, but if you're going to run around changing them, at least make em prettier eh? :) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/35186
* WARNING: HUGE COMMITAlexandre Emsenhuber2008-05-201-3/+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
* Remove ?>'s from files. They're pointless, and just asking for people to ↵Aryeh Gregor2007-06-291-1/+1
| | | | | | | mess with the files and add trailing whitespace. (Yes, I looked over every one and reverted those that were bogus. Slash-enter a million times in less worked well enough, although it was a bit mind-numbing.) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/23531
* Give feedback on wrong/missing args, and for invalid user.Greg Sabino Mullane2007-05-161-14/+25
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/22203
* The war on redundant ampersand usage!Nick Jenkins2007-01-221-1/+1
| | | | | | | | | | | | * Convert "$dbw =& wfGetDB( DB_MASTER );" --> "$dbw = wfGetDB( DB_MASTER );" * convert "$skin =& $wgUser->getSkin();" --> "$skin = $wgUser->getSkin();" For the time being have not changed the function definitions of wfGetDB() or User::getSkin() [i.e. they are still both return-by-ref], so as to ensure the interface does not change for extensions [some of which may still be trying to run on PHP4 environments]. However presumably at some point this can be changed too. Also includes tiny tweak to newlines in parserTests - will show 1 rather than 2 newlines between the "Reading tests from" strings when in quiet mode. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/19598
* Use Doxygen @addtogroup instead of phpdoc @package && @subpackageAntoine Musso2007-01-201-2/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/19502
* * Adding a trailing ?>Ævar Arnfjörð Bjarmason2006-03-071-0/+1
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/13184
* * Added wfDie() wrapper, and some manual die(-1), to force the return codeBrion Vibber2006-01-141-1/+1
| | | | | | | to the shell to return nonzero when we crap out with an error. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/12660
* * s~\t+$~~Ævar Arnfjörð Bjarmason2006-01-071-3/+3
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/12476
* Move check for --help to after the command-line checks, so it doesn'tBrion Vibber2005-11-161-4/+5
| | | | | | | | print an ugly warning message when hit in a web browser. (Path disclosure issue with display_errors on.) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/11734
* * Password changing script for idiot users with amnesiaÆvar Arnfjörð Bjarmason2005-11-151-0/+51
Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/11733