From 8e361227a27b631871b3a82c30a0bfb2fb49f7c9 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Sat, 31 Jan 2009 13:20:36 +0000 Subject: [PATCH] Revert r46512 (Add "check" parameter to action=email) and its followups r46515 and r46517. This functionality is already present in list=users (as usprop=emailable), where it belongs --- RELEASE-NOTES | 1 - includes/api/ApiBase.php | 1 - includes/api/ApiEmailUser.php | 26 +++++--------------------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index a12e189ea5..0e50d55927 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -136,7 +136,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 15949) Add undo functionality to action=edit * (bug 16483) Kill filesort in ApiQueryBacklinks caused by missing parentheses. Building query properly now using makeList() -* Add "check" parameter to action=email * (bug 17182) Fix pretty printer so URLs with parentheses in them are autolinked correctly diff --git a/includes/api/ApiBase.php b/includes/api/ApiBase.php index 1bc86382dd..292f7db9fb 100644 --- a/includes/api/ApiBase.php +++ b/includes/api/ApiBase.php @@ -694,7 +694,6 @@ abstract class ApiBase { 'ipb_cant_unblock' => array('code' => 'cantunblock', 'info' => "The block you specified was not found. It may have been unblocked already"), 'mailnologin' => array('code' => 'cantsend', 'info' => "You're not logged in or you don't have a confirmed e-mail address, so you can't send e-mail"), 'usermaildisabled' => array('code' => 'usermaildisabled', 'info' => "User email has been disabled"), - 'usermailenabled' => array('code' => 'usermailenabled', 'info' => "User email is enabled"), 'blockedemailuser' => array('code' => 'blockedfrommail', 'info' => "You have been blocked from sending e-mail"), 'notarget' => array('code' => 'notarget', 'info' => "You have not specified a valid target for this action"), 'noemail' => array('code' => 'noemail', 'info' => "The user has not specified a valid e-mail address, or has chosen not to receive e-mail from other users"), diff --git a/includes/api/ApiEmailUser.php b/includes/api/ApiEmailUser.php index a42f435b98..5548b18432 100644 --- a/includes/api/ApiEmailUser.php +++ b/includes/api/ApiEmailUser.php @@ -50,28 +50,15 @@ class ApiEmailUser extends ApiBase { // Check required parameters if ( !isset( $params['target'] ) ) $this->dieUsageMsg( array( 'missingparam', 'target' ) ); - // Validate target - $targetUser = EmailUserForm::validateEmailTarget( $params['target'] ); - if ( isset( $params['check'] ) ) { - // Only a check was requested; don't actually send a mail - if ( $targetUser instanceof User ) - $result = array( 'result' => 'Enabled' ); - else - $result = array( 'result' => 'Disabled', 'error' => $targetUser ); - - $this->getResult()->addValue( null, $this->getModuleName(), $result ); - return; - } - // If $targetUser is not a User it represents an error message - if ( !( $targetUser instanceof User ) ) - $this->dieUsageMsg( array( $targetUser ) ); - - // Check more parameters if ( !isset( $params['text'] ) ) $this->dieUsageMsg( array( 'missingparam', 'text' ) ); if ( !isset( $params['token'] ) ) $this->dieUsageMsg( array( 'missingparam', 'token' ) ); + // Validate target + $targetUser = EmailUserForm::validateEmailTarget( $params['target'] ); + if ( !( $targetUser instanceof User ) ) + $this->dieUsageMsg( array( $targetUser ) ); // Check permissions $error = EmailUserForm::getPermissionsError( $wgUser, $params['token'] ); @@ -99,7 +86,6 @@ class ApiEmailUser extends ApiBase { 'text' => null, 'token' => null, 'ccme' => false, - 'check' => null, ); } @@ -110,7 +96,6 @@ class ApiEmailUser extends ApiBase { 'text' => 'Mail body', 'token' => 'A token previously acquired via prop=info', 'ccme' => 'Send a copy of this mail to me', - 'check' => 'Only check whether email can be sent to the target user', ); } @@ -122,8 +107,7 @@ class ApiEmailUser extends ApiBase { protected function getExamples() { return array ( - 'api.php?action=emailuser&target=WikiSysop&text=Content', - 'api.php?action=emailuser&target=WikiSysop&check=yes', + 'api.php?action=emailuser&target=WikiSysop&text=Content' ); } -- 2.20.1