Page MenuHomePhabricator

bug_30788_password_reset_via_the_api.patch

Authored By
bzimport
Nov 21 2014, 11:48 PM
Size
2 KB
Referenced Files
None
Subscribers
None

bug_30788_password_reset_via_the_api.patch

Index: includes/api/ApiMain.php
===================================================================
--- includes/api/ApiMain.php (revision 96412)
+++ includes/api/ApiMain.php (working copy)
@@ -84,6 +84,7 @@
'patrol' => 'ApiPatrol',
'import' => 'ApiImport',
'userrights' => 'ApiUserrights',
+ 'passwordreset' => 'ApiPasswordReset',
);
/**
Index: includes/api/ApiPasswordReset.php
===================================================================
--- includes/api/ApiPasswordReset.php (revision 0)
+++ includes/api/ApiPasswordReset.php (revision 0)
@@ -0,0 +1,51 @@
+<?php
+
+class ApiPasswordReset extends ApiBase {
+ function execute() {
+ $params = $this->extractRequestParams();
+ $username = $params['user'];
+ }
+
+ public function mustBePosted() {
+ return true;
+ }
+
+ public function isWriteMode() {
+ return true;
+ }
+
+ public function getAllowedParams() {
+ return array(
+ 'name' => null,
+ );
+ }
+
+ public function getParamDescription() {
+ return array(
+ 'name' => 'User Name',
+ );
+ }
+
+ public function getDescription() {
+ return 'Generate a password reset email';
+ }
+
+ public function getPossibleErrors() {
+ return array_merge( parent::getPossibleErrors(), array(
+ ) );
+ }
+
+ public function getExamples() {
+ return array(
+ 'api.php?action=passwordreset&name=User'
+ );
+ }
+
+ public function getHelpUrls() {
+ return 'http://www.mediawiki.org/wiki/API:PasswordReset';
+ }
+
+ public function getVersion() {
+ return __CLASS__ . ': $Id$';
+ }
+}
\ No newline at end of file
Property changes on: includes\api\ApiPasswordReset.php
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Index: includes/AutoLoader.php
===================================================================
--- includes/AutoLoader.php (revision 96412)
+++ includes/AutoLoader.php (working copy)
@@ -303,6 +303,7 @@
'ApiPageSet' => 'includes/api/ApiPageSet.php',
'ApiParamInfo' => 'includes/api/ApiParamInfo.php',
'ApiParse' => 'includes/api/ApiParse.php',
+ 'ApiPasswordReset' => 'includes/api/ApiPasswordReset.php',
'ApiPatrol' => 'includes/api/ApiPatrol.php',
'ApiProtect' => 'includes/api/ApiProtect.php',
'ApiPurge' => 'includes/api/ApiPurge.php',
Index: RELEASE-NOTES-1.19
===================================================================
--- RELEASE-NOTES-1.19 (revision 96412)
+++ RELEASE-NOTES-1.19 (working copy)
@@ -99,6 +99,7 @@
* (bug 26885) Allow show/hide of account blocks, temporary blocks and single IP
address blocks for list=blocks.
* (bug 30591) Add support to only return keys in ApiAllMessages.
+* (bug 30788) Allow triggering of user password reset email via the API
=== Languages updated in 1.19 ===

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7527
Default Alt Text
bug_30788_password_reset_via_the_api.patch (2 KB)

Event Timeline