Exemplo n.º 1
0
/**
 * Constructor
 */
function wfSpecialLockdb()
{
    global $wgUser, $wgOut, $wgRequest;
    if (!$wgUser->isAllowed('siteadmin')) {
        $wgOut->permissionRequired('siteadmin');
        return;
    }
    # If the lock file isn't writable, we can do sweet bugger all
    global $wgReadOnlyFile;
    if (!is_writable(dirname($wgReadOnlyFile))) {
        DBLockForm::notWritable();
        return;
    }
    $action = $wgRequest->getVal('action');
    $f = new DBLockForm();
    if ('success' == $action) {
        $f->showSuccess();
    } else {
        if ('submit' == $action && $wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getVal('wpEditToken'))) {
            $f->doSubmit();
        } else {
            $f->showForm('');
        }
    }
}
/**
 * Constructor
 */
function wfSpecialLockdb()
{
    global $wgUser, $wgOut, $wgRequest;
    if (!$wgUser->isAllowed('siteadmin')) {
        $wgOut->developerRequired();
        return;
    }
    $action = $wgRequest->getVal('action');
    $f = new DBLockForm();
    if ('success' == $action) {
        $f->showSuccess();
    } else {
        if ('submit' == $action && $wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getVal('wpEditToken'))) {
            $f->doSubmit();
        } else {
            $f->showForm('');
        }
    }
}