Merge "Allow ORMTable to access a foreign wiki."
[lhc/web/wiklou.git] / includes / api / ApiUndelete.php
index c89f49a..2ee8641 100644 (file)
@@ -4,7 +4,7 @@
  *
  * Created on Jul 3, 2007
  *
- * Copyright © 2007 Roan Kattouw <Firstname>.<Lastname>@gmail.com
+ * 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
@@ -61,7 +61,13 @@ class ApiUndelete extends ApiBase {
                }
 
                $pa = new PageArchive( $titleObj );
-               $retval = $pa->undelete( ( isset( $params['timestamps'] ) ? $params['timestamps'] : array() ), $params['reason'] );
+               $retval = $pa->undelete(
+                       ( isset( $params['timestamps'] ) ? $params['timestamps'] : array() ),
+                       $params['reason'],
+                       array(),
+                       false,
+                       $this->getUser()
+               );
                if ( !is_array( $retval ) ) {
                        $this->dieUsageMsg( 'cannotundelete' );
                }
@@ -94,7 +100,10 @@ class ApiUndelete extends ApiBase {
                                ApiBase::PARAM_TYPE => 'string',
                                ApiBase::PARAM_REQUIRED => true
                        ),
-                       'token' => null,
+                       'token' => array(
+                               ApiBase::PARAM_TYPE => 'string',
+                               ApiBase::PARAM_REQUIRED => true
+                       ),
                        'reason' => '',
                        'timestamps' => array(
                                ApiBase::PARAM_TYPE => 'timestamp',
@@ -116,7 +125,7 @@ class ApiUndelete extends ApiBase {
                return array(
                        'title' => 'Title of the page you want to restore',
                        'token' => 'An undelete token previously retrieved through list=deletedrevs',
-                       'reason' => 'Reason for restoring (optional)',
+                       'reason' => 'Reason for restoring',
                        'timestamps' => 'Timestamps of the revisions to restore. If not set, all revisions will be restored.',
                        'watchlist' => 'Unconditionally add or remove the page from your watchlist, use preferences or do not change watch',
                );