Do not allow a user to delete a page they can't edit
[lhc/web/wiklou.git] / includes / api / ApiImport.php
index 1d960c9..25ce89b 100644 (file)
@@ -98,8 +98,6 @@ class ApiImport extends ApiBase {
        }
 
        public function getAllowedParams() {
-               global $wgImportSources;
-
                return array(
                        'token' => array(
                                ApiBase::PARAM_TYPE => 'string',
@@ -110,7 +108,7 @@ class ApiImport extends ApiBase {
                                ApiBase::PARAM_TYPE => 'upload',
                        ),
                        'interwikisource' => array(
-                               ApiBase::PARAM_TYPE => $wgImportSources
+                               ApiBase::PARAM_TYPE => $this->getConfig()->get( 'ImportSources' ),
                        ),
                        'interwikipage' => null,
                        'fullhistory' => false,
@@ -136,17 +134,6 @@ class ApiImport extends ApiBase {
                );
        }
 
-       public function getResultProperties() {
-               return array(
-                       ApiBase::PROP_LIST => true,
-                       '' => array(
-                               'ns' => 'namespace',
-                               'title' => 'string',
-                               'revisions' => 'integer'
-                       )
-               );
-       }
-
        public function getDescription() {
                return array(
                        'Import a page from another wiki, or an XML file.',
@@ -155,18 +142,6 @@ class ApiImport extends ApiBase {
                );
        }
 
-       public function getPossibleErrors() {
-               return array_merge( parent::getPossibleErrors(), array(
-                       array( 'cantimport' ),
-                       array( 'missingparam', 'interwikipage' ),
-                       array( 'cantimport-upload' ),
-                       array( 'import-unknownerror', 'source' ),
-                       array( 'import-unknownerror', 'result' ),
-                       array( 'import-rootpage-nosubpage', 'namespace' ),
-                       array( 'import-rootpage-invalid' ),
-               ) );
-       }
-
        public function needsToken() {
                return true;
        }