/**
 * Constructor
 */
function wfSpecialMovepage($par = null)
{
    global $wgUser, $wgOut, $wgRequest, $action;
    # Check rights
    if (!$wgUser->isAllowed('move')) {
        $wgOut->showPermissionsErrorPage(array($wgUser->isAnon() ? 'movenologintext' : 'movenotallowed'));
        return;
    }
    # Don't allow blocked users to move pages
    if ($wgUser->isBlocked()) {
        $wgOut->blockedPage();
        return;
    }
    # Check for database lock
    if (wfReadOnly()) {
        $wgOut->readOnlyPage();
        return;
    }
    $f = new MovePageForm($par);
    if ('success' == $action) {
        $f->showSuccess();
    } else {
        if ('submit' == $action && $wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getVal('wpEditToken'))) {
            $f->doSubmit();
        } else {
            $f->showForm('');
        }
    }
}
示例#2
0
/**
 * Constructor
 */
function wfSpecialMovepage($par = null)
{
    global $wgUser, $wgOut, $wgRequest, $action;
    # Check for database lock
    if (wfReadOnly()) {
        $wgOut->readOnlyPage();
        return;
    }
    $target = isset($par) ? $par : $wgRequest->getVal('target');
    // Yes, the use of getVal() and getText() is wanted, see bug 20365
    $oldTitleText = $wgRequest->getVal('wpOldTitle', $target);
    $newTitleText = $wgRequest->getText('wpNewTitle');
    $oldTitle = Title::newFromText($oldTitleText);
    $newTitle = Title::newFromText($newTitleText);
    if (is_null($oldTitle)) {
        $wgOut->showErrorPage('notargettitle', 'notargettext');
        return;
    }
    if (!$oldTitle->exists()) {
        $wgOut->showErrorPage('nopagetitle', 'nopagetext');
        return;
    }
    # Check rights
    $permErrors = $oldTitle->getUserPermissionsErrors('move', $wgUser);
    if (!empty($permErrors)) {
        $wgOut->showPermissionsErrorPage($permErrors);
        return;
    }
    $form = new MovePageForm($oldTitle, $newTitle);
    if ('submit' == $action && $wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getVal('wpEditToken'))) {
        $form->doSubmit();
    } else {
        $form->showForm('');
    }
}
/**
 * Constructor
 */
function wfSpecialMovepage($par = null)
{
    global $wgUser, $wgOut, $wgRequest, $action, $wgOnlySysopMayMove;
    # check rights. We don't want newbies to move pages to prevents possible attack
    if ($wgUser->isAnon() or $wgUser->isBlocked() or $wgOnlySysopMayMove and $wgUser->isNewbie()) {
        $wgOut->errorpage("movenologin", "movenologintext");
        return;
    }
    # We don't move protected pages
    if (wfReadOnly()) {
        $wgOut->readOnlyPage();
        return;
    }
    $f = new MovePageForm($par);
    if ('success' == $action) {
        $f->showSuccess();
    } else {
        if ('submit' == $action && $wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getVal('wpEditToken'))) {
            $f->doSubmit();
        } else {
            $f->showForm('');
        }
    }
}
	protected function doOldNormalMovePage() {
		global $wgRequest;
		$form = new MovePageForm( $this->oldTitle, $this->newTitle );
		if ( 'submit' == $wgRequest->getVal( 'action' ) && $this->checkToken() && $wgRequest->wasPosted() ) {
			$form->doSubmit();
		} else {
			$form->showForm( '' );
		}
	}