r88697 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88696‎ | r88697 | r88698 >
Date:22:42, 23 May 2011
Author:wikinaut
Status:deferred
Tags:
Comment:
OpenID dashboard now shows # of users, OpenID users, OpenIDs
Modified paths:
  • /trunk/extensions/OpenID/OpenID.setup.php (modified) (history)
  • /trunk/extensions/OpenID/SpecialOpenIDDashboard.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/OpenID.setup.php
@@ -27,7 +27,7 @@
2828 exit( 1 );
2929 }
3030
31 -define( 'MEDIAWIKI_OPENID_VERSION', '0.925-beta' );
 31+define( 'MEDIAWIKI_OPENID_VERSION', '0.926-beta' );
3232
3333 $path = dirname( __FILE__ );
3434 set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . get_include_path() );
Index: trunk/extensions/OpenID/SpecialOpenIDDashboard.body.php
@@ -66,6 +66,10 @@
6767 return;
6868 }
6969
 70+ $totalUsers = SiteStats::users();
 71+ $OpenIDdistinctUsers = $this->getOpenIDUsers( 'distinctusers' );
 72+ $OpenIDUsers = $this->getOpenIDUsers();
 73+
7074 $out = "<table class='openiddashboard wikitable'><tr><th>Parameter</th><th>Value</th></tr>";
7175 $out .= show( 'MEDIAWIKI_OPENID_VERSION', MEDIAWIKI_OPENID_VERSION );
7276 $out .= show( '$wgOpenIDOnly', $wgOpenIDOnly );
@@ -79,6 +83,11 @@
8084 $out .= show( '$wgOpenIDProposeUsernameFromSREG', $wgOpenIDProposeUsernameFromSREG );
8185 $out .= show( '$wgOpenIDShowUrlOnUserPage', $wgOpenIDShowUrlOnUserPage );
8286 $out .= show( '$wgOpenIDShowProviderIcons', $wgOpenIDShowProviderIcons );
 87+
 88+ $out .= show( 'Number of users (total)', $totalUsers );
 89+ $out .= show( 'Number of users with OpenID', $OpenIDdistinctUsers );
 90+ $out .= show( 'Number of OpenIDs (total)', $OpenIDUsers );
 91+ $out .= show( 'Number of users without OpenID', $totalUsers - $OpenIDdistinctUsers );
8392 $out .= '</table>';
8493
8594 $this->setHeaders();
@@ -93,4 +102,21 @@
94103 $wgOut->wrapWikiMsg( "<p class='error'>$1</p>", $args );
95104 }
96105
 106+
 107+ function getOpenIDUsers ( $distinctusers = '' ) {
 108+ wfProfileIn( __METHOD__ );
 109+ $distinct = ( $distinctusers == 'distinctusers' ) ? 'COUNT(DISTINCT uoi_user)' : 'COUNT(*)' ;
 110+
 111+ $dbr = wfGetDB( DB_SLAVE );
 112+ $OpenIDUserCount = (int)$dbr->selectField(
 113+ 'user_openid',
 114+ $distinct,
 115+ null,
 116+ __METHOD__,
 117+ null
 118+ );
 119+ wfProfileOut( __METHOD__ );
 120+ return $OpenIDUserCount;
 121+ }
 122+
97123 }

Status & tagging log