+
+ # @todo Allow Title::getUserPermissionsErrors() to take an array
+ # @todo FIXME: Title::checkSpecialsAndNSPermissions() has a very wierd expectation of what
+ # getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected'
+ $errors = wfMergeErrorArrays(
+ $this->getTitle()->getUserPermissionsErrors(
+ 'import', $user, true,
+ array( 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' )
+ ),
+ $this->getTitle()->getUserPermissionsErrors(
+ 'importupload', $user, true,
+ array( 'ns-specialprotected', 'badaccess-group0', 'badaccess-groups' )
+ )
+ );
+
+ if ( $errors ) {
+ throw new PermissionsError( 'import', $errors );
+ }
+
+ $this->checkReadOnly();
+
+ $request = $this->getRequest();
+ if ( $request->wasPosted() && $request->getVal( 'action' ) == 'submit' ) {