|
@@ 1856-1865 (lines=10) @@
|
| 1853 |
|
return $status; |
| 1854 |
|
} |
| 1855 |
|
|
| 1856 |
|
if ( !$wgUser->isAllowed( 'edit' ) ) { |
| 1857 |
|
if ( $wgUser->isAnon() ) { |
| 1858 |
|
$status->setResult( false, self::AS_READ_ONLY_PAGE_ANON ); |
| 1859 |
|
return $status; |
| 1860 |
|
} else { |
| 1861 |
|
$status->fatal( 'readonlytext' ); |
| 1862 |
|
$status->value = self::AS_READ_ONLY_PAGE_LOGGED; |
| 1863 |
|
return $status; |
| 1864 |
|
} |
| 1865 |
|
} |
| 1866 |
|
|
| 1867 |
|
$changingContentModel = false; |
| 1868 |
|
if ( $this->contentModel !== $this->mTitle->getContentModel() ) { |
|
@@ 1869-1877 (lines=9) @@
|
| 1866 |
|
|
| 1867 |
|
$changingContentModel = false; |
| 1868 |
|
if ( $this->contentModel !== $this->mTitle->getContentModel() ) { |
| 1869 |
|
if ( !$wgContentHandlerUseDB ) { |
| 1870 |
|
$status->fatal( 'editpage-cannot-use-custom-model' ); |
| 1871 |
|
$status->value = self::AS_CANNOT_USE_CUSTOM_MODEL; |
| 1872 |
|
return $status; |
| 1873 |
|
} elseif ( !$wgUser->isAllowed( 'editcontentmodel' ) ) { |
| 1874 |
|
$status->setResult( false, self::AS_NO_CHANGE_CONTENT_MODEL ); |
| 1875 |
|
return $status; |
| 1876 |
|
} |
| 1877 |
|
// Make sure the user can edit the page under the new content model too |
| 1878 |
|
$titleWithNewContentModel = clone $this->mTitle; |
| 1879 |
|
$titleWithNewContentModel->setContentModel( $this->contentModel ); |
| 1880 |
|
if ( !$titleWithNewContentModel->userCan( 'editcontentmodel', $wgUser ) |