Merge "mediawiki.page.gallery.resize: Remove weird mw.hook call"
[lhc/web/wiklou.git] / includes / specials / SpecialActiveusers.php
index d963677..8dc4b3c 100644 (file)
@@ -31,7 +31,6 @@
  * @ingroup SpecialPage
  */
 class ActiveUsersPager extends UsersPager {
-
        /**
         * @var FormOptions
         */
@@ -93,12 +92,16 @@ class ActiveUsersPager extends UsersPager {
        function getQueryInfo() {
                $dbr = $this->getDatabase();
 
+               $activeUserSeconds = $this->getConfig()->get( 'ActiveUserDays' ) * 86400;
+               $timestamp = $dbr->timestamp( wfTimestamp( TS_UNIX ) - $activeUserSeconds );
                $conds = array(
                        'qcc_type' => 'activeusers',
                        'qcc_namespace' => NS_USER,
                        'user_name = qcc_title',
                        'rc_user_text = qcc_title',
-                       'rc_type != ' . $dbr->addQuotes( RC_EXTERNAL ) // Don't count wikidata.
+                       'rc_type != ' . $dbr->addQuotes( RC_EXTERNAL ), // Don't count wikidata.
+                       'rc_log_type IS NULL OR rc_log_type != ' . $dbr->addQuotes( 'newusers' ),
+                       'rc_timestamp >= ' . $dbr->addQuotes( $timestamp ),
                );
                if ( $this->requestedUser != '' ) {
                        $conds[] = 'qcc_title >= ' . $dbr->addQuotes( $this->requestedUser );
@@ -194,20 +197,31 @@ class ActiveUsersPager extends UsersPager {
                $self = $this->getTitle();
                $limit = $this->mLimit ? Html::hidden( 'limit', $this->mLimit ) : '';
 
-               $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); # Form tag
+               # Form tag
+               $out = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) );
                $out .= Xml::fieldset( $this->msg( 'activeusers' )->text() ) . "\n";
                $out .= Html::hidden( 'title', $self->getPrefixedDBkey() ) . $limit . "\n";
 
+               # Username field
                $out .= Xml::inputLabel( $this->msg( 'activeusers-from' )->text(),
-                       'username', 'offset', 20, $this->requestedUser, array( 'tabindex' => 1 ) ) . '<br />';# Username field
+                       'username', 'offset', 20, $this->requestedUser, array( 'tabindex' => 1 ) ) . '<br />';
 
                $out .= Xml::checkLabel( $this->msg( 'activeusers-hidebots' )->text(),
                        'hidebots', 'hidebots', $this->opts->getValue( 'hidebots' ), array( 'tabindex' => 2 ) );
 
-               $out .= Xml::checkLabel( $this->msg( 'activeusers-hidesysops' )->text(),
-                       'hidesysops', 'hidesysops', $this->opts->getValue( 'hidesysops' ), array( 'tabindex' => 3 ) ) . '<br />';
-
-               $out .= Xml::submitButton( $this->msg( 'allpagessubmit' )->text(), array( 'tabindex' => 4 ) ) . "\n";# Submit button and form bottom
+               $out .= Xml::checkLabel(
+                       $this->msg( 'activeusers-hidesysops' )->text(),
+                       'hidesysops',
+                       'hidesysops',
+                       $this->opts->getValue( 'hidesysops' ),
+                       array( 'tabindex' => 3 )
+               ) . '<br />';
+
+               # Submit button and form bottom
+               $out .= Xml::submitButton(
+                       $this->msg( 'allpagessubmit' )->text(),
+                       array( 'tabindex' => 4 )
+               ) . "\n";
                $out .= Xml::closeElement( 'fieldset' );
                $out .= Xml::closeElement( 'form' );