r46642 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r46641‎ | r46642 | r46643 >
Date:13:20, 31 January 2009
Author:catrope
Status:ok
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/api/ApiBase.php (modified) (history)
  • /trunk/phase3/includes/api/ApiEmailUser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiEmailUser.php
@@ -50,28 +50,15 @@
5151 // Check required parameters
5252 if ( !isset( $params['target'] ) )
5353 $this->dieUsageMsg( array( 'missingparam', 'target' ) );
54 - // Validate target
55 - $targetUser = EmailUserForm::validateEmailTarget( $params['target'] );
56 - if ( isset( $params['check'] ) ) {
57 - // Only a check was requested; don't actually send a mail
58 - if ( $targetUser instanceof User )
59 - $result = array( 'result' => 'Enabled' );
60 - else
61 - $result = array( 'result' => 'Disabled', 'error' => $targetUser );
62 -
63 - $this->getResult()->addValue( null, $this->getModuleName(), $result );
64 - return;
65 - }
66 - // If $targetUser is not a User it represents an error message
67 - if ( !( $targetUser instanceof User ) )
68 - $this->dieUsageMsg( array( $targetUser ) );
69 -
70 - // Check more parameters
7154 if ( !isset( $params['text'] ) )
7255 $this->dieUsageMsg( array( 'missingparam', 'text' ) );
7356 if ( !isset( $params['token'] ) )
7457 $this->dieUsageMsg( array( 'missingparam', 'token' ) );
7558
 59+ // Validate target
 60+ $targetUser = EmailUserForm::validateEmailTarget( $params['target'] );
 61+ if ( !( $targetUser instanceof User ) )
 62+ $this->dieUsageMsg( array( $targetUser ) );
7663
7764 // Check permissions
7865 $error = EmailUserForm::getPermissionsError( $wgUser, $params['token'] );
@@ -99,7 +86,6 @@
10087 'text' => null,
10188 'token' => null,
10289 'ccme' => false,
103 - 'check' => null,
10490 );
10591 }
10692
@@ -110,7 +96,6 @@
11197 'text' => 'Mail body',
11298 'token' => 'A token previously acquired via prop=info',
11399 'ccme' => 'Send a copy of this mail to me',
114 - 'check' => 'Only check whether email can be sent to the target user',
115100 );
116101 }
117102
@@ -122,8 +107,7 @@
123108
124109 protected function getExamples() {
125110 return array (
126 - 'api.php?action=emailuser&target=WikiSysop&text=Content',
127 - 'api.php?action=emailuser&target=WikiSysop&check=yes',
 111+ 'api.php?action=emailuser&target=WikiSysop&text=Content'
128112 );
129113 }
130114
Index: trunk/phase3/includes/api/ApiBase.php
@@ -694,7 +694,6 @@
695695 'ipb_cant_unblock' => array('code' => 'cantunblock', 'info' => "The block you specified was not found. It may have been unblocked already"),
696696 '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"),
697697 'usermaildisabled' => array('code' => 'usermaildisabled', 'info' => "User email has been disabled"),
698 - 'usermailenabled' => array('code' => 'usermailenabled', 'info' => "User email is enabled"),
699698 'blockedemailuser' => array('code' => 'blockedfrommail', 'info' => "You have been blocked from sending e-mail"),
700699 'notarget' => array('code' => 'notarget', 'info' => "You have not specified a valid target for this action"),
701700 '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"),
Index: trunk/phase3/RELEASE-NOTES
@@ -136,7 +136,6 @@
137137 * (bug 15949) Add undo functionality to action=edit
138138 * (bug 16483) Kill filesort in ApiQueryBacklinks caused by missing parentheses.
139139 Building query properly now using makeList()
140 -* Add "check" parameter to action=email
141140 * (bug 17182) Fix pretty printer so URLs with parentheses in them are
142141 autolinked correctly
143142

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r46512Add "check" parameter to action=emailsoxred9301:25, 29 January 2009
r46515Per 46512#c1554, moving check to before required params, returns a result rat...soxred9303:23, 29 January 2009
r46517Forgot to remove thatsoxred9304:13, 29 January 2009

Status & tagging log