コード例 #1
0
 function showList()
 {
     global $wgOut;
     // Generate conditions list.
     $conds = array();
     if ($this->mSearchUser) {
         $user = User::newFromName($this->mSearchUser);
         if (!$user) {
             $conds[] = 'afl_ip=afl_user_text';
             $conds['afl_user'] = 0;
             $conds['afl_user_text'] = $this->mSearchUser;
         } else {
             $conds['afl_user'] = $user->getId();
             $conds['afl_user_text'] = $user->getName();
         }
     }
     if ($this->mSearchFilter) {
         $conds['afl_filter'] = $this->mSearchFilter;
     }
     $searchTitle = Title::newFromText($this->mSearchTitle);
     if ($this->mSearchTitle && $searchTitle) {
         $conds['afl_namespace'] = $searchTitle->getNamespace();
         $conds['afl_title'] = $searchTitle->getDBkey();
     }
     $pager = new AbuseLogPager($this, $conds);
     $pager->doQuery();
     $result = $pager->getResult();
     if ($result && $result->numRows() !== 0) {
         $wgOut->addHTML($pager->getNavigationBar() . Xml::tags('ul', null, $pager->getBody()) . $pager->getNavigationBar());
     } else {
         $wgOut->addWikiMsg('abusefilter-log-noresults');
     }
 }
コード例 #2
0
 function showList()
 {
     $out = $this->getOutput();
     // Generate conditions list.
     $conds = array();
     if ($this->mSearchUser) {
         $user = User::newFromName($this->mSearchUser);
         if (!$user) {
             $conds['afl_user'] = 0;
             $conds['afl_user_text'] = $this->mSearchUser;
         } else {
             $conds['afl_user'] = $user->getId();
             $conds['afl_user_text'] = $user->getName();
         }
     }
     if ($this->mSearchWiki) {
         $conds['afl_wiki'] = $this->mSearchWiki;
     }
     if ($this->mSearchFilter) {
         $searchFilters = array_map('trim', explode('|', $this->mSearchFilter));
         // if a filter is hidden, users who can't view private filters should not be able to find log entries generated by it
         if (!AbuseFilterView::canViewPrivate() && !$this->getUser()->isAllowed('abusefilter-log-private')) {
             $searchedForPrivate = false;
             foreach ($searchFilters as $index => $filter) {
                 if (AbuseFilter::filterHidden($filter)) {
                     unset($searchFilters[$index]);
                     $searchedForPrivate = true;
                 }
             }
             if ($searchedForPrivate) {
                 $out->addWikiMsg('abusefilter-log-private-not-included');
             }
         }
         if (empty($searchFilters)) {
             $out->addWikiMsg('abusefilter-log-noresults');
             return;
         }
         $conds['afl_filter'] = $searchFilters;
     }
     $searchTitle = Title::newFromText($this->mSearchTitle);
     if ($this->mSearchTitle && $searchTitle) {
         $conds['afl_namespace'] = $searchTitle->getNamespace();
         $conds['afl_title'] = $searchTitle->getDBkey();
     }
     $pager = new AbuseLogPager($this, $conds);
     $pager->doQuery();
     $result = $pager->getResult();
     if ($result && $result->numRows() !== 0) {
         $out->addHTML($pager->getNavigationBar() . Xml::tags('ul', array('class' => 'plainlinks'), $pager->getBody()) . $pager->getNavigationBar());
     } else {
         $out->addWikiMsg('abusefilter-log-noresults');
     }
 }
コード例 #3
0
 function showList()
 {
     $out = $this->getOutput();
     // Generate conditions list.
     $conds = array();
     if ($this->mSearchUser) {
         $user = User::newFromName($this->mSearchUser);
         if (!$user) {
             $conds['afl_user'] = 0;
             $conds['afl_user_text'] = $this->mSearchUser;
         } else {
             $conds['afl_user'] = $user->getId();
             $conds['afl_user_text'] = $user->getName();
         }
     }
     if ($this->mSearchWiki) {
         $conds['afl_wiki'] = $this->mSearchWiki;
     }
     if ($this->mSearchFilter) {
         // if the filter is hidden, users who can't view private filters should not be able to find log entries generated by it
         if (!AbuseFilter::filterHidden($this->mSearchFilter) || AbuseFilterView::canViewPrivate() || $this->getUser()->isAllowed('abusefilter-log-private')) {
             $conds['afl_filter'] = $this->mSearchFilter;
         }
     }
     $searchTitle = Title::newFromText($this->mSearchTitle);
     if ($this->mSearchTitle && $searchTitle) {
         $conds['afl_namespace'] = $searchTitle->getNamespace();
         $conds['afl_title'] = $searchTitle->getDBkey();
     }
     $pager = new AbuseLogPager($this, $conds);
     $pager->doQuery();
     $result = $pager->getResult();
     if ($result && $result->numRows() !== 0) {
         $out->addHTML($pager->getNavigationBar() . Xml::tags('ul', array('class' => 'plainlinks'), $pager->getBody()) . $pager->getNavigationBar());
     } else {
         $out->addWikiMsg('abusefilter-log-noresults');
     }
 }