/usr/share/mediawiki-extensions/openid/SpecialOpenIDDashboard.body.php is in mediawiki-extensions-openid 3.6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | <?php
/**
* Implements Special:OpenIDDashboard parameter settings and status information
*
* @ingroup SpecialPage
* @ingroup Extensions
* @author Thomas Gries
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
* @link http://www.mediawiki.org/wiki/Extension:OpenID Documentation
*
*/
class SpecialOpenIDDashboard extends SpecialPage {
/**
* Constructor - sets up the new special page
* required right: openid-dashboard-access
*/
public function __construct() {
parent::__construct( 'OpenIDDashboard', 'openid-dashboard-access' );
}
/**
* Different description will be shown on Special:SpecialPage depending on
* whether the user has the 'openiddashboard' right or not.
*/
function getDescription() {
global $wgUser;
return wfMsg( $wgUser->isAllowed( 'openid-dashboard-admin' ) ?
'openid-dashboard-title-admin' : 'openid-dashboard-title' ) ;
}
function show( $string, $value ) {
if ( $value === null ) {
$value = 'null';
} elseif ( is_bool( $value ) ) {
$value = wfBoolToStr( $value );
} else {
$value = htmlspecialchars( $value );
}
return Html::openElement( 'tr' ) .
Html::openElement( 'td' ) . $string . Html::closeElement( 'td' ) .
Html::openElement( 'td' ) . $value . Html::closeElement( 'td' ) .
Html::closeElement( 'tr' ) . "\n";
}
/**
* Show the special page
*
* @param $par Mixed: parameter passed to the page or null
*/
function execute( $par ) {
global $wgOut, $wgUser;
global $wgOpenIDShowUrlOnUserPage;
global $wgOpenIDTrustEmailAddress;
global $wgOpenIDAllowExistingAccountSelection;
global $wgOpenIDAllowNewAccountname;
global $wgOpenIDUseEmailAsNickname;
global $wgOpenIDProposeUsernameFromSREG;
global $wgOpenIDAllowAutomaticUsername;
global $wgOpenIDOnly;
global $wgOpenIDClientOnly;
global $wgOpenIDAllowServingOpenIDUserAccounts;
global $wgOpenIDShowProviderIcons;
if ( !$this->userCanExecute( $wgUser ) ) {
$this->displayRestrictionError();
return;
}
$totalUsers = SiteStats::users();
$OpenIDdistinctUsers = $this->getOpenIDUsers( 'distinctusers' );
$OpenIDUsers = $this->getOpenIDUsers();
$this->setHeaders();
$this->outputHeader();
$wgOut->addWikiMsg( 'openid-dashboard-introduction', 'http://www.mediawiki.org/wiki/Extension:OpenID' );
$wgOut->addHTML(
Html::openElement( 'table', array( 'style' => 'width:50%;', 'class' => 'mw-openiddashboard-table wikitable' ) )
);
# Here we show some basic version infos. Retrieval of SVN revision number of OpenID appears to be too difficult
$out = $this->show( 'OpenID ' . wfMsg( 'version-software-version' ), MEDIAWIKI_OPENID_VERSION );
$out .= $this->show( 'MediaWiki ' . wfMsg( 'version-software-version' ), SpecialVersion::getVersion() );
$out .= $this->show( '$wgOpenIDOnly', $wgOpenIDOnly );
$out .= $this->show( '$wgOpenIDClientOnly', $wgOpenIDClientOnly );
$out .= $this->show( '$wgOpenIDAllowServingOpenIDUserAccounts', $wgOpenIDAllowServingOpenIDUserAccounts );
$out .= $this->show( '$wgOpenIDTrustEmailAddress', $wgOpenIDTrustEmailAddress );
$out .= $this->show( '$wgOpenIDAllowExistingAccountSelection', $wgOpenIDAllowExistingAccountSelection );
$out .= $this->show( '$wgOpenIDAllowAutomaticUsername', $wgOpenIDAllowAutomaticUsername );
$out .= $this->show( '$wgOpenIDAllowNewAccountname', $wgOpenIDAllowNewAccountname );
$out .= $this->show( '$wgOpenIDUseEmailAsNickname', $wgOpenIDUseEmailAsNickname );
$out .= $this->show( '$wgOpenIDProposeUsernameFromSREG', $wgOpenIDProposeUsernameFromSREG );
$out .= $this->show( '$wgOpenIDShowUrlOnUserPage', $wgOpenIDShowUrlOnUserPage );
$out .= $this->show( '$wgOpenIDShowProviderIcons', $wgOpenIDShowProviderIcons );
$out .= $this->show( wfMsgExt( 'statistics-users', array( 'parseinline' ) ), $totalUsers );
$out .= $this->show( wfMsg( 'openid-dashboard-number-openid-users' ), $OpenIDdistinctUsers );
$out .= $this->show( wfMsg( 'openid-dashboard-number-openids-in-database' ), $OpenIDUsers );
$out .= $this->show( wfMsg( 'openid-dashboard-number-users-without-openid' ), $totalUsers - $OpenIDdistinctUsers );
$wgOut->addHTML( $out . Html::closeElement( 'table' ) . "\n" );
}
function error() {
global $wgOut;
$args = func_get_args();
$wgOut->wrapWikiMsg( "<p class='error'>$1</p>", $args );
}
function getOpenIDUsers ( $distinctusers = '' ) {
wfProfileIn( __METHOD__ );
$distinct = ( $distinctusers == 'distinctusers' ) ? 'COUNT(DISTINCT uoi_user)' : 'COUNT(*)' ;
$dbr = wfGetDB( DB_SLAVE );
$OpenIDUserCount = (int)$dbr->selectField(
'user_openid',
$distinct,
null,
__METHOD__,
null
);
wfProfileOut( __METHOD__ );
return $OpenIDUserCount;
}
}
|