return;
}
- if ( ! $this->mTitle->userCanEdit() ) {
+ if ( ! $this->mTitle->userCan( 'edit' ) ) {
wfDebug( "$fname: user can't edit\n" );
$wgOut->readOnlyPage( $this->getContent(), true );
wfProfileOut( $fname );
wfProfileOut($fname);
return;
}
- if ( !$this->mTitle->userCanCreate() && !$this->mTitle->exists() ) {
+ if ( !$this->mTitle->userCan( 'create' ) && !$this->mTitle->exists() ) {
wfDebug( "$fname: no create permission\n" );
$this->noCreatePermission();
wfProfileOut( $fname );
if ( 0 == $aid ) {
// Late check for create permission, just in case *PARANOIA*
- if ( !$this->mTitle->userCanCreate() ) {
+ if ( !$this->mTitle->userCan( 'create' ) ) {
wfDebug( "$fname: no create permission\n" );
$this->noCreatePermission();
wfProfileOut( $fname );
$wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );
return;
}
- if ( ! $this->mTitle->userCanEdit() ) {
+ if ( ! $this->mTitle->userCan( 'edit' ) ) {
$wgOut->readOnlyPage( $this->getContent(), true );
return;
}
}
} else {
$url = htmlspecialchars( wfImageArchiveUrl( $img ) );
- if( $wgUser->getID() != 0 && $wgTitle->userCanEdit() ) {
+ if( $wgUser->getID() != 0 && $wgTitle->userCan( 'edit' ) ) {
$token = urlencode( $wgUser->editToken( $img ) );
$rlink = $this->skin->makeKnownLinkObj( $wgTitle,
wfMsgHtml( 'revertimg' ), 'action=revert&oldimage=' .
}
else $a = array( 'bgcolor' => '#FFFFFF' );
if($wgOut->isArticle() && $wgUser->getOption('editondblclick') &&
- $wgTitle->userCanEdit() ) {
+ $wgTitle->userCan( 'edit' ) ) {
$s = $wgTitle->getFullURL( $this->editUrlOptions() );
$s = 'document.location = "' .wfEscapeJSString( $s ) .'";';
$a += array ('ondblclick' => $s);
if ( ! $wgOut->isArticleRelated() ) {
$s = wfMsg( 'protectedpage' );
} else {
- if ( $wgTitle->userCanEdit() ) {
+ if ( $wgTitle->userCan( 'edit' ) ) {
$t = wfMsg( 'editthispage' );
} else {
$t = wfMsg( 'viewsource' );
function moveThisPage() {
global $wgTitle;
- if ( $wgTitle->userCanMove() ) {
+ if ( $wgTitle->userCan( 'move' ) ) {
return $this->makeKnownLinkObj( SpecialPage::getTitleFor( 'Movepage' ),
wfMsg( 'movethispage' ), 'target=' . $wgTitle->getPrefixedURL() );
} else {
true);
wfProfileIn( "$fname-edit" );
- if ( $this->mTitle->quickUserCan( 'edit' ) && ( $this->mTitle->exists() || $this->mTitle->userCanCreate( false ) ) ) {
+ if ( $this->mTitle->quickUserCan( 'edit' ) && ( $this->mTitle->exists() || $this->mTitle->quickUserCan( 'create' ) ) ) {
$istalk = $this->mTitle->isTalkPage();
$istalkclass = $istalk?' istalk':'';
$content_actions['edit'] = array(
* If the image is protected, non-sysop users won't be able
* to modify it by uploading a new revision.
*/
- if( !$nt->userCanEdit() ) {
+ if( !$nt->userCan( 'edit' ) ) {
return $this->uploadError( wfMsgWikiHtml( 'protectedpage' ) );
}
}
if ( $auth && (
- !$this->userCanEdit() || !$nt->userCanEdit() ||
- !$this->userCanMove() || !$nt->userCanMove() ) ) {
+ !$this->userCan( 'edit' ) || !$nt->userCan( 'edit' ) ||
+ !$this->userCan( 'move' ) || !$nt->userCan( 'move' ) ) ) {
return 'protectedpage';
}
{
$s .= $sep . $this->watchThisPage();
}
- if ( $wgTitle->userCanEdit() )
+ if ( $wgTitle->userCan( 'edit' ) )
$s .= $sep . $this->moveThisPage();
}
if ( $wgUser->isAllowed('delete') and $articleExists ) {
}
function is_special() { return cbt_value( $this->mTitle->getNamespace() == NS_SPECIAL, 'title' ); }
- function can_edit() { return cbt_value( (string)($this->mTitle->userCanEdit()), 'dynamic' ); }
- function can_move() { return cbt_value( (string)($this->mTitle->userCanMove()), 'dynamic' ); }
+ function can_edit() { return cbt_value( (string)($this->mTitle->userCan( 'edit' )), 'dynamic' ); }
+ function can_move() { return cbt_value( (string)($this->mTitle->userCan( 'move' )), 'dynamic' ); }
function is_talk() { return cbt_value( (string)($this->mTitle->isTalkPage()), 'title' ); }
function is_protected() { return cbt_value( (string)$this->mTitle->isProtected(), 'dynamic' ); }
function nskey() { return cbt_value( $this->mTitle->getNamespaceKey(), 'title' ); }