+
+ } elseif ( $action == 'move' ) {
+ if ( !$user->isAllowed( 'move' ) ) {
+ // User can't move anything
+ $errors[] = $user->isAnon() ? array ( 'movenologintext' ) : array ('movenotallowed');
+ } elseif ( !$user->isAllowed( 'move-rootuserpages' )
+ && $this->getNamespace() == NS_USER && !$this->isSubpage() )
+ {
+ // Show user page-specific message only if the user can move other pages
+ $errors[] = array( 'cant-move-user-page' );
+ }
+
+ // Check for immobile pages
+ if ( !MWNamespace::isMovable( $this->getNamespace() ) ) {
+ // Specific message for this case
+ $errors[] = array( 'immobile-source-namespace', $this->getNsText() );
+ } elseif ( !$this->isMovable() ) {
+ // Less specific message for rarer cases
+ $errors[] = array( 'immobile-page' );
+ }
+
+ } elseif ( $action == 'move-target' ) {
+ if ( !$user->isAllowed( 'move' ) ) {
+ // User can't move anything
+ $errors[] = $user->isAnon() ? array ( 'movenologintext' ) : array ('movenotallowed');
+ } elseif ( !$user->isAllowed( 'move-rootuserpages' )
+ && $this->getNamespace() == NS_USER && !$this->isSubpage() )
+ {
+ // Show user page-specific message only if the user can move other pages
+ $errors[] = array( 'cant-move-to-user-page' );
+ }
+ if ( !MWNamespace::isMovable( $this->getNamespace() ) ) {
+ $errors[] = array( 'immobile-target-namespace', $this->getNsText() );
+ } elseif ( !$this->isMovable() ) {
+ $errors[] = array( 'immobile-target-page' );
+ }
+