function execute($par) { global $wgOut, $wgRequest; $this->setHeaders(); $ip = isset($par) ? $par : $wgRequest->getText('ip'); $this->loadParameters($ip); $wgOut->setPageTitle(wfMsg('globalblocking-list')); $wgOut->setSubtitle(GlobalBlocking::buildSubtitleLinks('GlobalBlockList')); $wgOut->setRobotPolicy("noindex,nofollow"); $wgOut->setArticleRelated(false); $wgOut->enableClientCache(false); $this->showList(); }
function execute($par) { global $wgOut, $wgRequest, $wgUser; $this->setHeaders(); $this->loadParameters($par); $wgOut->setPageTitle(wfMsg('globalblocking-block')); $wgOut->setSubtitle(GlobalBlocking::buildSubtitleLinks('GlobalBlock')); $wgOut->setRobotPolicy("noindex,nofollow"); $wgOut->setArticleRelated(false); $wgOut->enableClientCache(false); if (!$this->userCanExecute($wgUser)) { $this->displayRestrictionError(); return; } $errors = ''; if ($wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getVal('wpEditToken'))) { // They want to submit. Let's have a look. $errors = $this->trySubmit(); if (!$errors) { // Success! return; } } if (GlobalBlocking::getGlobalBlockId($this->mAddress)) { $this->mModifyForm = true; } if ($this->mModifyForm) { $dbr = GlobalBlocking::getGlobalBlockingSlave(); $block = $dbr->selectRow('globalblocks', '*', array('gb_address' => $this->mAddress), __METHOD__); if ($block) { if ($block->gb_expiry == 'infinity') { $this->mExpirySelection = 'indefinite'; } else { $this->mExpiry = wfTimestamp(TS_ISO_8601, $block->gb_expiry); } $this->mAnonOnly = $block->gb_anon_only; $this->mReason = $block->gb_reason; } } $errorstr = null; if (is_array($errors) && count($errors) > 0) { $errorstr = $this->formatErrors($errors); } $this->form($errorstr); }
function execute($par) { global $wgOut, $wgRequest, $wgUser; $this->setHeaders(); $this->loadParameters(); $wgOut->setPageTitle(wfMsg('globalblocking-whitelist')); $wgOut->setSubtitle(GlobalBlocking::buildSubtitleLinks('GlobalBlockStatus')); $wgOut->setRobotPolicy("noindex,nofollow"); $wgOut->setArticleRelated(false); $wgOut->enableClientCache(false); if (!$this->userCanExecute($wgUser)) { $this->displayRestrictionError(); return; } global $wgApplyGlobalBlocks; if (!$wgApplyGlobalBlocks) { $wgOut->addWikiMsg('globalblocking-whitelist-notapplied'); return; } $errors = ''; if ($wgRequest->wasPosted() && $wgUser->matchEditToken($wgRequest->getVal('wpEditToken'))) { // They want to submit. Let's have a look. $errors = $this->trySubmit(); if (!$errors) { // Success! return; } } $errorstr = ''; if (is_array($errors) && count($errors) > 0) { foreach ($errors as $error) { if (is_array($error)) { $msg = array_shift($error); } else { $msg = $error; $error = array(); } $errorstr .= Xml::tags('li', null, wfMsgExt($msg, array('parseinline'), $error)); } $errorstr = wfMsgExt('globalblocking-whitelist-errors', array('parse'), array(count($errors))) . Xml::tags('ul', array('class' => 'error'), $errorstr); $errorstr = Xml::tags('div', array('class' => 'error'), $errorstr); } $this->form($errorstr); }