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