@@ 1835-1844 (lines=10) @@ | ||
1832 | return $status; |
|
1833 | } |
|
1834 | ||
1835 | if ( !$wgUser->isAllowed( 'edit' ) ) { |
|
1836 | if ( $wgUser->isAnon() ) { |
|
1837 | $status->setResult( false, self::AS_READ_ONLY_PAGE_ANON ); |
|
1838 | return $status; |
|
1839 | } else { |
|
1840 | $status->fatal( 'readonlytext' ); |
|
1841 | $status->value = self::AS_READ_ONLY_PAGE_LOGGED; |
|
1842 | return $status; |
|
1843 | } |
|
1844 | } |
|
1845 | ||
1846 | $changingContentModel = false; |
|
1847 | if ( $this->contentModel !== $this->mTitle->getContentModel() ) { |
|
@@ 1848-1856 (lines=9) @@ | ||
1845 | ||
1846 | $changingContentModel = false; |
|
1847 | if ( $this->contentModel !== $this->mTitle->getContentModel() ) { |
|
1848 | if ( !$wgContentHandlerUseDB ) { |
|
1849 | $status->fatal( 'editpage-cannot-use-custom-model' ); |
|
1850 | $status->value = self::AS_CANNOT_USE_CUSTOM_MODEL; |
|
1851 | return $status; |
|
1852 | } elseif ( !$wgUser->isAllowed( 'editcontentmodel' ) ) { |
|
1853 | $status->setResult( false, self::AS_NO_CHANGE_CONTENT_MODEL ); |
|
1854 | return $status; |
|
1855 | } |
|
1856 | // Make sure the user can edit the page under the new content model too |
|
1857 | $titleWithNewContentModel = clone $this->mTitle; |
|
1858 | $titleWithNewContentModel->setContentModel( $this->contentModel ); |
|
1859 | if ( !$titleWithNewContentModel->userCan( 'editcontentmodel', $wgUser ) |