当前位置: 首页>>代码示例>>PHP>>正文


PHP wfReadOnly函数代码示例

本文整理汇总了PHP中wfReadOnly函数的典型用法代码示例。如果您正苦于以下问题:PHP wfReadOnly函数的具体用法?PHP wfReadOnly怎么用?PHP wfReadOnly使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wfReadOnly函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: execute

 /**
  * Execute
  */
 function execute($par)
 {
     global $wgRequest, $wgUser, $wgOut;
     $this->setHeaders();
     $this->outputHeader();
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     if (!$wgUser->isAllowed('import') && !$wgUser->isAllowed('importupload')) {
         return $wgOut->permissionRequired('import');
     }
     # TODO: allow Title::getUserPermissionsErrors() to take an array
     # FIXME: Title::checkSpecialsAndNSPermissions() has a very wierd expectation of what
     # getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected'
     $errors = wfMergeErrorArrays($this->getTitle()->getUserPermissionsErrors('import', $wgUser, true, array('ns-specialprotected', 'badaccess-group0', 'badaccess-groups')), $this->getTitle()->getUserPermissionsErrors('importupload', $wgUser, true, array('ns-specialprotected', 'badaccess-group0', 'badaccess-groups')));
     if ($errors) {
         $wgOut->showPermissionsErrorPage($errors);
         return;
     }
     if ($wgRequest->wasPosted() && $wgRequest->getVal('action') == 'submit') {
         $this->doImport();
     }
     $this->showForm();
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:28,代码来源:SpecialImport.php

示例2: execute

 function execute($par)
 {
     global $wgOut, $wgUser, $wgRequest;
     $this->setHeaders();
     $this->outputHeader();
     $wgOut->disallowUserJs();
     # Prevent hijacked user scripts from sniffing passwords etc.
     if ($wgUser->isAnon()) {
         $wgOut->showErrorPage('prefsnologin', 'prefsnologintext', array($this->getTitle()->getPrefixedDBkey()));
         return;
     }
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     if ($par == 'reset') {
         $this->showResetForm();
         return;
     }
     $wgOut->addModules('mediawiki.legacy.prefs');
     $wgOut->addModules('mediawiki.special.preferences');
     if ($wgRequest->getCheck('success')) {
         $wgOut->wrapWikiMsg("<div class=\"successbox\"><strong>\n\$1\n</strong></div><div id=\"mw-pref-clear\"></div>", 'savedprefs');
     }
     if ($wgRequest->getCheck('eauth')) {
         $wgOut->wrapWikiMsg("<div class='error' style='clear: both;'>\n\$1\n</div>", 'eauthentsent', $wgUser->getName());
     }
     $htmlForm = Preferences::getFormObject($wgUser);
     $htmlForm->setSubmitCallback(array('Preferences', 'tryUISubmit'));
     $htmlForm->show();
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:31,代码来源:SpecialPreferences.php

示例3: ProtectionForm

 function ProtectionForm(&$article)
 {
     global $wgRequest, $wgUser;
     global $wgRestrictionTypes, $wgRestrictionLevels;
     $this->mArticle =& $article;
     $this->mTitle =& $article->mTitle;
     if ($this->mTitle) {
         foreach ($wgRestrictionTypes as $action) {
             // Fixme: this form currently requires individual selections,
             // but the db allows multiples separated by commas.
             $this->mRestrictions[$action] = implode('', $this->mTitle->getRestrictions($action));
         }
     }
     // The form will be available in read-only to show levels.
     $this->disabled = !$wgUser->isAllowed('protect') || wfReadOnly() || $wgUser->isBlocked();
     $this->disabledAttrib = $this->disabled ? array('disabled' => 'disabled') : array();
     if ($wgRequest->wasPosted()) {
         $this->mReason = $wgRequest->getText('mwProtect-reason');
         foreach ($wgRestrictionTypes as $action) {
             $val = $wgRequest->getVal("mwProtect-level-{$action}");
             if (isset($val) && in_array($val, $wgRestrictionLevels)) {
                 $this->mRestrictions[$action] = $val;
             }
         }
     }
 }
开发者ID:k-hasan-19,项目名称:wiki,代码行数:26,代码来源:ProtectionForm.php

示例4: wfMsUploadRender

function wfMsUploadRender()
{
    #global $wgOut,$wgUser,$wgUserName,$wgScriptPath;
    global $output, $wgUser;
    global $wgMSU_ShowAutoKat, $wgMSU_AutoIndex, $wgMSU_CheckedAutoKat;
    if (!$wgUser->isAllowed('upload')) {
        if (!$wgUser->isLoggedIn()) {
            $output .= "<a id='ImageUploadLoginMsg'>einloggen</a>";
            return 0;
        } else {
            $output .= "keine Berechtigung";
            return 1;
        }
    } else {
        if (wfReadOnly()) {
            $output .= "Nur lesen";
            return 2;
        } else {
            $output .= "<form action='' method='post' id='upload-form'>";
            $output .= "<ul id='upload_list'></ul>";
            $output .= "<hr noshade>";
            $output .= "</form><a href='#' id='upload_all'></a>";
        }
    }
    #return $output."|".$wgUser->getName();
    return $output . "|" . $wgUser->getName() . "|" . $wgMSU_ShowAutoKat . "|" . $wgMSU_AutoIndex . "|" . $wgMSU_CheckedAutoKat;
}
开发者ID:Ratin,项目名称:WikiExtension,代码行数:27,代码来源:msupload_body.php

示例5: wfSpecialMovepage

/**
 * 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('');
        }
    }
}
开发者ID:BackupTheBerlios,项目名称:shoutwiki-svn,代码行数:32,代码来源:SpecialMovepage.php

示例6: execute

	/**
	 * Show the special page
	 *
	 * @param $par Mixed: parameter passed to the page or null
	 */
	public function execute( $par ) {
		global $wgRequest, $wgOut, $wgUser;

		// If the user doesn't have the required 'awardsmanage' permission, display an error
		if ( !$wgUser->isAllowed( 'awardsmanage' ) ) {
			$wgOut->permissionRequired( 'awardsmanage' );
			return;
		}

		// Show a message if the database is in read-only mode
		if ( wfReadOnly() ) {
			$wgOut->readOnlyPage();
			return;
		}

		// If user is blocked, s/he doesn't need to access this page
		if ( $wgUser->isBlocked() ) {
			$wgOut->blockedPage();
			return;
		}

		$this->gift_id = $wgRequest->getInt( 'gift_id' );
		$this->initLogo( $wgRequest );
		$this->executeLogo();
	}
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:30,代码来源:SpecialSystemGiftManagerLogo.php

示例7: execute

 public function execute($subpage)
 {
     global $wgOut, $wgUser, $wgExtensionsPath, $wgResourceBasePath;
     // Boilerplate special page permissions
     if ($wgUser->isBlocked()) {
         throw new UserBlockedError($this->getUser()->mBlock);
     }
     if (!$wgUser->isAllowed('wikiaquiz')) {
         $this->displayRestrictionError();
         return;
     }
     if (wfReadOnly() && !wfAutomaticReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     $wgOut->addScript('<script src="' . $wgResourceBasePath . '/resources/wikia/libraries/jquery-ui/jquery-ui-1.8.14.custom.js"></script>');
     $wgOut->addScript('<script src="' . $wgExtensionsPath . '/wikia/WikiaQuiz/js/CreateWikiaQuizArticle.js"></script>');
     $wgOut->addStyle(AssetsManager::getInstance()->getSassCommonURL('/extensions/wikia/WikiaQuiz/css/WikiaQuizBuilder.scss'));
     if ($subpage != '') {
         // We came here from the edit link, go into edit mode
         $wgOut->addHtml(F::app()->renderView('WikiaQuiz', 'EditQuizArticle', array('title' => $subpage)));
     } else {
         $wgOut->addHtml(F::app()->renderView('WikiaQuiz', 'CreateQuizArticle'));
     }
 }
开发者ID:yusufchang,项目名称:app,代码行数:25,代码来源:SpecialCreateWikiaQuizArticle.class.php

示例8: execute

 public function execute()
 {
     global $wgOut, $wgUser, $wgRequest, $wgTitle;
     wfRunHooks('beforeBlogListingForm', array(&$this, $wgRequest->getVal('article')));
     if (!$wgUser->isLoggedIn()) {
         $wgOut->showErrorPage('create-blog-no-login', 'create-blog-login-required', array(wfGetReturntoParam()));
         return;
     }
     if ($wgUser->isBlocked()) {
         throw new UserBlockedError($this->getUser()->mBlock);
     }
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     $this->mTitle = Title::makeTitle(NS_SPECIAL, 'CreateBlogListingPage');
     $wgOut->setPageTitle(wfMsg('create-blog-listing-title'));
     if ($wgRequest->wasPosted()) {
         $this->parseFormData();
         if (count($this->mFormErrors) > 0 || !empty($this->mRenderedPreview)) {
             $this->renderForm();
         } else {
             $this->save();
         }
     } else {
         if ($wgRequest->getVal('article') != null) {
             $this->parseTag(urldecode($wgRequest->getVal('article')));
         }
         $this->renderForm();
     }
 }
开发者ID:schwarer2006,项目名称:wikia,代码行数:31,代码来源:SpecialCreateBlogListingPage.php

示例9: wfSpecialMovepage

/**
 * 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('');
    }
}
开发者ID:rocLv,项目名称:conference,代码行数:38,代码来源:SpecialMovepage.php

示例10: execute

 public function execute($par)
 {
     global $wgUser, $wgOut, $wgRequest;
     # Can't block when the database is locked
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     # Permission check
     if (!$this->userCanExecute($wgUser)) {
         $wgOut->permissionRequired('block');
         return;
     }
     $this->setup($par);
     # bug 15810: blocked admins should have limited access here
     if ($wgUser->isBlocked()) {
         $status = IPBlockForm::checkUnblockSelf($this->BlockAddress);
         if ($status !== true) {
             throw new ErrorPageError('badaccess', $status);
         }
     }
     $action = $wgRequest->getVal('action');
     if ('success' == $action) {
         $this->showSuccess();
     } elseif ($wgRequest->wasPosted() && 'submit' == $action && $wgUser->matchEditToken($wgRequest->getVal('wpEditToken'))) {
         $this->doSubmit();
     } else {
         $this->showForm('');
     }
 }
开发者ID:GodelDesign,项目名称:Godel,代码行数:30,代码来源:SpecialBlockip.php

示例11: efAddToListEdit

function efAddToListEdit($action, $article)
{
    global $wgOut, $wgRequest, $wgTitle;
    if ($action !== 'addtolist') {
        return true;
    }
    if ($article->mTitle->getText() != $wgTitle->getText()) {
        return true;
    }
    // @todo should return some error
    if (wfReadOnly()) {
        return true;
    }
    $content = $article->getContent();
    $item = trim($wgRequest->getText('item')) . $wgRequest->getText('postfix');
    if (empty($item)) {
        return true;
    }
    $parts = explode('* <addmore', $content);
    $first = array_shift($parts);
    array_unshift($parts, "* {$item}\n* <addmore");
    array_unshift($parts, $first);
    $newContent = implode('', $parts);
    $article->doEdit($newContent, 'added list item');
    $wgOut->redirect($article->mTitle->getFullUrl());
    return false;
}
开发者ID:Tjorriemorrie,项目名称:app,代码行数:27,代码来源:AddToList.php

示例12: execute

 /**
  * Show the special page
  *
  * @param $par Mixed: parameter passed to the page or null
  */
 public function execute($par)
 {
     $out = $this->getOutput();
     $request = $this->getRequest();
     $user = $this->getUser();
     // Set the robot policies, etc.
     $out->setArticleRelated(false);
     $out->setRobotPolicy('noindex,nofollow');
     // If the user doesn't have the required 'awardsmanage' permission, display an error
     if (!$user->isAllowed('awardsmanage')) {
         $out->permissionRequired('awardsmanage');
         return;
     }
     // Show a message if the database is in read-only mode
     if (wfReadOnly()) {
         $out->readOnlyPage();
         return;
     }
     // If user is blocked, s/he doesn't need to access this page
     if ($user->isBlocked()) {
         $out->blockedPage();
         return;
     }
     $this->gift_id = $this->getRequest()->getInt('gift_id');
     $this->initLogo();
     $this->executeLogo();
 }
开发者ID:Reasno,项目名称:SocialProfile,代码行数:32,代码来源:SpecialSystemGiftManagerLogo.php

示例13: onUnknownAction

 public static function onUnknownAction($action, $article)
 {
     global $wgUser, $wgOut;
     if ($action !== 'unfavorite' && $action !== 'favorite') {
         return true;
     }
     if ($wgUser->isAnon()) {
         $wgOut->showErrorPage('favoritenologin', 'favoritenologintext');
         return;
     }
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     $wgOut->setRobotPolicy('noindex,nofollow');
     if ($action === 'favorite') {
         if (self::doFavorite($article)) {
             $wgOut->setPagetitle(wfMsg('addedfavorite'));
             $wgOut->addWikiMsg('addedfavoritetext', $article->getTitle()->getPrefixedText());
         }
     } else {
         if (self::doUnfavorite($article)) {
             $wgOut->setPagetitle(wfMsg('removedfavorite'));
             $wgOut->addWikiMsg('removedfavoritetext', $article->getTitle()->getPrefixedText());
         }
     }
     $wgOut->returnToMain(true, $article->getTitle()->getPrefixedText());
     return false;
 }
开发者ID:yusufchang,项目名称:app,代码行数:29,代码来源:FavoritesHooks.php

示例14: execute

 function execute()
 {
     wfProfileIn(__METHOD__);
     global $wgOut, $wgRequest;
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         wfProfileOut(__METHOD__);
         return;
     }
     $articleID = $wgRequest->getInt('articleid');
     $title = Title::newFromID($articleID);
     if (!is_null($title) && $title->exists()) {
         if (strpos($_SERVER['HTTP_USER_AGENT'], 'facebook') === false && strpos($_SERVER['HTTP_USER_AGENT'], 'bitlybot') === false) {
             $sharerID = $wgRequest->getInt('userid');
             $viewerIP = $wgRequest->getIP();
             $awardingService = new AchAwardingService();
             $awardingService->processSharing($articleID, $sharerID, $viewerIP);
         }
     } else {
         $title = Title::newMainPage();
     }
     // this works only for Wikia and only in current varnish configuration
     if (!headers_sent()) {
         header('X-Pass-Cache-Control: no-store, private, no-cache, must-revalidate');
     }
     $wgOut->redirect($title->getLocalURL());
     wfProfileOut(__METHOD__);
 }
开发者ID:yusufchang,项目名称:app,代码行数:28,代码来源:SpecialAchievementsSharing.class.php

示例15: execute

 function execute($subpage)
 {
     global $wgUser, $wgOut, $wgRequest;
     if ($wgUser->isBlocked()) {
         $wgOut->blockedPage();
         return;
     }
     if (wfReadOnly()) {
         $wgOut->readOnlyPage();
         return;
     }
     if (!$wgUser->isAllowed('makesysop')) {
         $this->displayRestrictionError();
         return;
     }
     $this->setHeaders();
     if ($wgUser->isAllowed('userrights')) {
         $f = new MakesysopStewardForm($wgRequest);
         $f->execute();
     } else {
         $f = new MakesysopForm($wgRequest);
         if ($f->mSubmit) {
             $f->doSubmit();
         } else {
             $f->showForm('');
         }
     }
 }
开发者ID:clrh,项目名称:mediawiki,代码行数:28,代码来源:SpecialMakesysop_body.php


注:本文中的wfReadOnly函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。