/** * @return array */ function getDefaultQuery() { $query = parent::getDefaultQuery(); if (!isset($query['group']) && $this->requestedGroup) { $query['group'] = $this->requestedGroup; } return $this->mDefaultQuery = $query; }
/** * Show the special page * * @param string $par (optional) A group to list users from */ public function execute($par) { $this->setHeaders(); $this->outputHeader(); $up = new UsersPager($this->getContext(), $par, $this->including()); # getBody() first to check, if empty $usersbody = $up->getBody(); $s = ''; if (!$this->including()) { $s = $up->getPageHeader(); } if ($usersbody) { $s .= $up->getNavigationBar(); $s .= Html::rawElement('ul', [], $usersbody); $s .= $up->getNavigationBar(); } else { $s .= $this->msg('listusers-noresult')->parseAsBlock(); } $this->getOutput()->addHTML($s); }
/** * @param IContextSource $context * @param null $group Unused * @param string $par Parameter passed to the page */ function __construct(IContextSource $context = null, $group = null, $par = null) { parent::__construct($context); $this->RCMaxAge = $this->getConfig()->get('ActiveUserDays'); $un = $this->getRequest()->getText('username', $par); $this->requestedUser = ''; if ($un != '') { $username = Title::makeTitleSafe(NS_USER, $un); if (!is_null($username)) { $this->requestedUser = $username->getText(); } } $this->setupOptions(); }
function __construct($group = null) { global $wgRequest, $wgActiveUserDays; $this->RCMaxAge = $wgActiveUserDays; $un = $wgRequest->getText('username'); $this->requestedUser = ''; if ($un != '') { $username = Title::makeTitleSafe(NS_USER, $un); if (!is_null($username)) { $this->requestedUser = $username->getText(); } } $this->setupOptions(); parent::__construct(); }
function doBatchLookups() { parent::doBatchLookups(); $uids = array(); foreach ($this->mResult as $row) { $uids[] = $row->user_id; } // Fetch the block status of the user for showing "(blocked)" text and for // striking out names of suppressed users when privileged user views the list. // Although the first query already hits the block table for un-privileged, this // is done in two queries to avoid huge quicksorts and to make COUNT(*) correct. $dbr = $this->getDatabase(); $res = $dbr->select('ipblocks', array('ipb_user', 'MAX(ipb_deleted) AS block_status'), array('ipb_user' => $uids), __METHOD__, array('GROUP BY' => array('ipb_user'))); $this->blockStatusByUid = array(); foreach ($res as $row) { $this->blockStatusByUid[$row->ipb_user] = $row->block_status; // 0 or 1 } $this->mResult->seek(0); }
/** * constructor * $par string (optional) A group to list users from */ function wfSpecialListusers($par = null) { global $wgRequest, $wgOut; $up = new UsersPager($par); # getBody() first to check, if empty $usersbody = $up->getBody(); $s = $up->getPageHeader(); if ($usersbody) { $s .= $up->getNavigationBar(); $s .= '<ul>' . $usersbody . '</ul>'; $s .= $up->getNavigationBar(); } else { $s .= '<p>' . wfMsgHTML('listusers-noresult') . '</p>'; } $wgOut->addHTML($s); }
/** * constructor * $par string (optional) A group to list users from */ function wfSpecialListusers($par = null) { global $wgOut; $up = new UsersPager($par); # getBody() first to check, if empty $usersbody = $up->getBody(); $s = Xml::openElement('div', array('class' => 'mw-spcontent')); $s .= $up->getPageHeader(); if ($usersbody) { $s .= $up->getNavigationBar(); $s .= '<ul>' . $usersbody . '</ul>'; $s .= $up->getNavigationBar(); } else { $s .= '<p>' . wfMsgHTML('listusers-noresult') . '</p>'; } $s .= Xml::closeElement('div'); $wgOut->addHTML($s); }
/** * Returns the list of users. * * @return string */ protected function _getUsers() { $perm = $this->_config->getPermissions('assignee'); $group = $perm['group'] != '*' ? strtolower($perm['group']) : null; /** @see SpecialListusers **/ require_once 'SpecialListusers.php'; $users = new UsersPager($group); if (!$users->mQueryDone) { $users->doQuery(); } $users->mResult->rewind(); $list = ''; while ($row = $users->mResult->fetchObject()) { $list .= '<option value="' . $row->user_name . '"'; $list .= isset($_POST['bt_assignee']) && $_POST['bt_assignee'] == $row->user_name ? ' selected="true"' : ''; $list .= '>' . $row->user_name . '</option>'; } return $list; }
/** * Show the special page * * @param $par string (optional) A group to list users from */ public function execute($par) { global $wgOut; $this->setHeaders(); $this->outputHeader(); $up = new UsersPager($par); # getBody() first to check, if empty $usersbody = $up->getBody(); $s = $up->getPageHeader(); if ($usersbody) { $s .= $up->getNavigationBar(); $s .= Html::rawElement('ul', array(), $usersbody); $s .= $up->getNavigationBar(); } else { $s .= wfMessage('listusers-noresult')->parseAsBlock(); } $wgOut->addHTML($s); }