Do not allow a user to delete a page they can't edit
[lhc/web/wiklou.git] / includes / api / ApiDelete.php
index 2fa4518..f26d58b 100644 (file)
@@ -104,8 +104,8 @@ class ApiDelete extends ApiBase {
         *
         * @param Page|WikiPage $page Page or WikiPage object to work on
         * @param User $user User doing the action
-        * @param string $token delete token (same as edit token)
-        * @param string|null $reason reason for the deletion. Autogenerated if null
+        * @param string $token Delete token (same as edit token)
+        * @param string|null $reason Reason for the deletion. Autogenerated if null
         * @return Status|array
         */
        public static function delete( Page $page, User $user, $token, &$reason = null ) {
@@ -229,34 +229,10 @@ class ApiDelete extends ApiBase {
                );
        }
 
-       public function getResultProperties() {
-               return array(
-                       '' => array(
-                               'title' => 'string',
-                               'reason' => 'string',
-                               'logid' => 'integer'
-                       )
-               );
-       }
-
        public function getDescription() {
                return 'Delete a page.';
        }
 
-       public function getPossibleErrors() {
-               return array_merge( parent::getPossibleErrors(),
-                       $this->getTitleOrPageIdErrorMessage(),
-                       array(
-                               array( 'notanarticle' ),
-                               array( 'hookaborted', 'error' ),
-                               array( 'delete-toobig', 'limit' ),
-                               array( 'cannotdelete', 'title' ),
-                               array( 'invalidoldimage' ),
-                               array( 'nodeleteablefile' ),
-                       )
-               );
-       }
-
        public function needsToken() {
                return true;
        }