<?php
-
-/*
+/**
+ *
+ *
* Created on Jul 3, 2007
- * API for MediaWiki 1.8+
*
- * Copyright (C) 2007 Roan Kattouw <Firstname>.<Lastname>@home.nl
+ * Copyright © 2007 Roan Kattouw <Firstname>.<Lastname>@gmail.com
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
* http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
*/
if ( !defined( 'MEDIAWIKI' ) ) {
global $wgUser;
$params = $this->extractRequestParams();
- $titleObj = null;
-
if ( !$wgUser->isAllowed( 'undelete' ) ) {
$this->dieUsageMsg( array( 'permdenied-undelete' ) );
}
}
$pa = new PageArchive( $titleObj );
- $dbw = wfGetDB( DB_MASTER );
- $dbw->begin();
$retval = $pa->undelete( ( isset( $params['timestamps'] ) ? $params['timestamps'] : array() ), $params['reason'] );
if ( !is_array( $retval ) ) {
$this->dieUsageMsg( array( 'cannotundelete' ) );
return array(
'title' => array(
ApiBase::PARAM_TYPE => 'string',
- ApiBase::PARAM_REQUIRED => 1
+ ApiBase::PARAM_REQUIRED => true
),
'token' => null,
'reason' => '',
public function getPossibleErrors() {
return array_merge( parent::getPossibleErrors(), array(
- array( 'missingparam', 'title' ),
array( 'permdenied-undelete' ),
array( 'blockedtext' ),
array( 'invalidtitle', 'title' ),
) );
}
+ public function needsToken() {
+ return true;
+ }
+
public function getTokenSalt() {
return '';
}