* @return mixed true on success, message name on failure
*/
public function isValidMoveOperation( &$nt, $auth = true ) {
- global $wgUser;
if( !$this or !$nt ) {
return 'badtitletext';
}
if ( $auth && (
!$this->userCan( 'edit' ) || !$nt->userCan( 'edit' ) ||
- !$this->userCan( 'move' ) || !$nt->userCan( 'move' ) ||
- $this->getNamespace() == NS_IMAGE && !$wgUser->isAllowed( 'upload' ) ) ) {
+ !$this->userCan( 'move' ) || !$nt->userCan( 'move' ) ) ) {
return 'protectedpage';
}
return $err;
}
- // If it's existent image, move it as image
- if( $this->getNamespace() == NS_IMAGE && $nt->getNamespace() == NS_IMAGE && wfFindFile( $this ) ) {
- $oldfile = wfFindFile( $this );
- $newfile = wfFindFile( $nt );
- var_dump( array( $oldfile, $newfile ) );
- if( $newfile ) {
- return 'articleexists';
- }
- return 'a';
- }
-
$pageid = $this->getArticleID();
if( $nt->exists() ) {
$this->moveOverExistingRedirect( $nt, $reason, $createRedirect );
$this->purgeSquid();
}
- /**
- * Moves image to new title
- */
- //private function moveImage
-
/**
* Checks if $this can be moved to a given Title
* - Selects for update, so don't call it unless you mean business