summaryrefslogtreecommitdiff
path: root/includes/api/ApiBlock.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/api/ApiBlock.php')
-rw-r--r--includes/api/ApiBlock.php10
1 files changed, 4 insertions, 6 deletions
diff --git a/includes/api/ApiBlock.php b/includes/api/ApiBlock.php
index e5c238ae..34813bf7 100644
--- a/includes/api/ApiBlock.php
+++ b/includes/api/ApiBlock.php
@@ -31,7 +31,7 @@ if (!defined('MEDIAWIKI')) {
* API module that facilitates the blocking of users. Requires API write mode
* to be enabled.
*
- * @addtogroup API
+ * @ingroup API
*/
class ApiBlock extends ApiBase {
@@ -87,17 +87,15 @@ class ApiBlock extends ApiBase {
$form->BlockEmail = $params['noemail'];
$form->BlockHideName = $params['hidename'];
- $dbw = wfGetDb(DB_MASTER);
- $dbw->begin();
+ $userID = $expiry = null;
$retval = $form->doBlock($userID, $expiry);
if(!empty($retval))
// We don't care about multiple errors, just report one of them
$this->dieUsageMsg($retval);
- $dbw->commit();
$res['user'] = $params['user'];
$res['userID'] = $userID;
- $res['expiry'] = ($expiry == Block::infinity() ? 'infinite' : $expiry);
+ $res['expiry'] = ($expiry == Block::infinity() ? 'infinite' : wfTimestamp(TS_ISO_8601, $expiry));
$res['reason'] = $params['reason'];
if($params['anononly'])
$res['anononly'] = '';
@@ -159,6 +157,6 @@ class ApiBlock extends ApiBase {
}
public function getVersion() {
- return __CLASS__ . ': $Id: ApiBlock.php 30222 2008-01-28 19:05:26Z catrope $';
+ return __CLASS__ . ': $Id: ApiBlock.php 35388 2008-05-27 10:18:28Z catrope $';
}
}