Index: trunk/phase3/includes/api/ApiEmailUser.php |
— | — | @@ -52,21 +52,21 @@ |
53 | 53 | $this->dieUsageMsg( array( 'missingparam', 'target' ) ); |
54 | 54 | // Validate target |
55 | 55 | $targetUser = EmailUserForm::validateEmailTarget( $params['target'] ); |
56 | | - if( isset( $params['check'] ) ) |
57 | | - if($targetUser instanceof User) { |
| 56 | + if ( isset( $params['check'] ) ) { |
| 57 | + // Only a check was requested; don't actually send a mail |
| 58 | + if ( $targetUser instanceof User ) |
58 | 59 | $result = array( 'result' => 'Enabled' ); |
59 | | - $this->getResult()->addValue( null, $this->getModuleName(), $result ); |
60 | | - return; |
61 | | - } |
62 | | - else { |
| 60 | + else |
63 | 61 | $result = array( 'result' => 'Disabled' ); |
64 | | - $this->getResult()->addValue( null, $this->getModuleName(), $result ); |
65 | | - return; |
66 | | - } |
| 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 | 67 | if ( !( $targetUser instanceof User ) ) |
68 | 68 | $this->dieUsageMsg( array( $targetUser ) ); |
69 | 69 | |
70 | | - //Check more parameters |
| 70 | + // Check more parameters |
71 | 71 | if ( !isset( $params['text'] ) ) |
72 | 72 | $this->dieUsageMsg( array( 'missingparam', 'text' ) ); |
73 | 73 | if ( !isset( $params['token'] ) ) |
— | — | @@ -110,7 +110,7 @@ |
111 | 111 | 'text' => 'Mail body', |
112 | 112 | 'token' => 'A token previously acquired via prop=info', |
113 | 113 | 'ccme' => 'Send a copy of this mail to me', |
114 | | - 'check' => 'Check if the user has email enabled', |
| 114 | + 'check' => 'Only check whether the user has email enabled', |
115 | 115 | ); |
116 | 116 | } |
117 | 117 | |