Index: trunk/extensions/OpenID/OpenID.alias.php |
— | — | @@ -14,6 +14,7 @@ |
15 | 15 | 'OpenIDConvert' => array( 'OpenIDConvert' ), |
16 | 16 | 'OpenIDServer' => array( 'OpenIDServer' ), |
17 | 17 | 'OpenIDXRDS' => array( 'OpenIDXRDS' ), |
| 18 | + 'OpenIDDashboard' => array( 'OpenIDDashboard' ), |
18 | 19 | ); |
19 | 20 | |
20 | 21 | /** Arabic (العربية) */ |
— | — | @@ -170,4 +171,4 @@ |
171 | 172 | /** |
172 | 173 | * For backwards compatibility with MediaWiki 1.15 and earlier. |
173 | 174 | */ |
174 | | -$aliases =& $specialPageAliases; |
\ No newline at end of file |
| 175 | +$aliases =& $specialPageAliases; |
Index: trunk/extensions/OpenID/SpecialOpenIDDashboard.body.php |
— | — | @@ -31,6 +31,16 @@ |
32 | 32 | 'openid-dashboard-title-admin' : 'openid-dashboard-title' ) ; |
33 | 33 | } |
34 | 34 | |
| 35 | + function show( $string, $value ) { |
| 36 | + if ( $value === null ) { |
| 37 | + $value = 'null'; |
| 38 | + } elseif ( is_bool( $value ) ) { |
| 39 | + $value = wfBoolToStr( $value ); |
| 40 | + } else { |
| 41 | + $value = htmlspecialchars( $value ); |
| 42 | + } |
| 43 | + return "<tr><td>$string</td><td>$value</td></tr>\n"; |
| 44 | + } |
35 | 45 | |
36 | 46 | /** |
37 | 47 | * Show the special page |
— | — | @@ -38,16 +48,6 @@ |
39 | 49 | * @param $par Mixed: parameter passed to the page or null |
40 | 50 | */ |
41 | 51 | function execute( $par ) { |
42 | | - |
43 | | - function show( $string, $value ) { |
44 | | - if ( isset($value) ) { |
45 | | - $value = ( $value===false ) ? 'false' : $value; |
46 | | - } else { |
47 | | - $value = 'undefined'; |
48 | | - } |
49 | | - return "<tr><td>$string</td><td>$value</td></tr>"; |
50 | | - } |
51 | | - |
52 | 52 | global $wgOut, $wgUser; |
53 | 53 | global $wgOpenIDShowUrlOnUserPage; |
54 | 54 | global $wgOpenIDTrustEmailAddress; |
— | — | @@ -62,32 +62,32 @@ |
63 | 63 | global $wgOpenIDShowProviderIcons; |
64 | 64 | |
65 | 65 | if ( !$this->userCanExecute($wgUser) ) { |
66 | | - $this->displayRestrictionError(); |
67 | | - return; |
68 | | - } |
| 66 | + $this->displayRestrictionError(); |
| 67 | + return; |
| 68 | + } |
69 | 69 | |
70 | 70 | $totalUsers = SiteStats::users(); |
71 | 71 | $OpenIDdistinctUsers = $this->getOpenIDUsers( 'distinctusers' ); |
72 | 72 | $OpenIDUsers = $this->getOpenIDUsers(); |
73 | 73 | |
74 | 74 | $out = "<table class='openiddashboard wikitable'><tr><th>Parameter</th><th>Value</th></tr>"; |
75 | | - $out .= show( 'MEDIAWIKI_OPENID_VERSION', MEDIAWIKI_OPENID_VERSION ); |
76 | | - $out .= show( '$wgOpenIDOnly', $wgOpenIDOnly ); |
77 | | - $out .= show( '$wgOpenIDClientOnly', $wgOpenIDClientOnly ); |
78 | | - $out .= show( '$wgOpenIDAllowServingOpenIDUserAccounts', $wgOpenIDAllowServingOpenIDUserAccounts ); |
79 | | - $out .= show( '$wgOpenIDTrustEmailAddress', $wgOpenIDTrustEmailAddress ); |
80 | | - $out .= show( '$wgOpenIDAllowExistingAccountSelection', $wgOpenIDAllowExistingAccountSelection ); |
81 | | - $out .= show( '$wgOpenIDAllowAutomaticUsername', $wgOpenIDAllowAutomaticUsername ); |
82 | | - $out .= show( '$wgOpenIDAllowNewAccountname', $wgOpenIDAllowNewAccountname ); |
83 | | - $out .= show( '$wgOpenIDUseEmailAsNickname', $wgOpenIDUseEmailAsNickname ); |
84 | | - $out .= show( '$wgOpenIDProposeUsernameFromSREG', $wgOpenIDProposeUsernameFromSREG ); |
85 | | - $out .= show( '$wgOpenIDShowUrlOnUserPage', $wgOpenIDShowUrlOnUserPage ); |
86 | | - $out .= show( '$wgOpenIDShowProviderIcons', $wgOpenIDShowProviderIcons ); |
| 75 | + $out .= $this->show( 'MEDIAWIKI_OPENID_VERSION', MEDIAWIKI_OPENID_VERSION ); |
| 76 | + $out .= $this->show( '$wgOpenIDOnly', $wgOpenIDOnly ); |
| 77 | + $out .= $this->show( '$wgOpenIDClientOnly', $wgOpenIDClientOnly ); |
| 78 | + $out .= $this->show( '$wgOpenIDAllowServingOpenIDUserAccounts', $wgOpenIDAllowServingOpenIDUserAccounts ); |
| 79 | + $out .= $this->show( '$wgOpenIDTrustEmailAddress', $wgOpenIDTrustEmailAddress ); |
| 80 | + $out .= $this->show( '$wgOpenIDAllowExistingAccountSelection', $wgOpenIDAllowExistingAccountSelection ); |
| 81 | + $out .= $this->show( '$wgOpenIDAllowAutomaticUsername', $wgOpenIDAllowAutomaticUsername ); |
| 82 | + $out .= $this->show( '$wgOpenIDAllowNewAccountname', $wgOpenIDAllowNewAccountname ); |
| 83 | + $out .= $this->show( '$wgOpenIDUseEmailAsNickname', $wgOpenIDUseEmailAsNickname ); |
| 84 | + $out .= $this->show( '$wgOpenIDProposeUsernameFromSREG', $wgOpenIDProposeUsernameFromSREG ); |
| 85 | + $out .= $this->show( '$wgOpenIDShowUrlOnUserPage', $wgOpenIDShowUrlOnUserPage ); |
| 86 | + $out .= $this->show( '$wgOpenIDShowProviderIcons', $wgOpenIDShowProviderIcons ); |
87 | 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 ); |
| 88 | + $out .= $this->show( 'Number of users (total)', $totalUsers ); |
| 89 | + $out .= $this->show( 'Number of users with OpenID', $OpenIDdistinctUsers ); |
| 90 | + $out .= $this->show( 'Number of OpenIDs (total)', $OpenIDUsers ); |
| 91 | + $out .= $this->show( 'Number of users without OpenID', $totalUsers - $OpenIDdistinctUsers ); |
92 | 92 | $out .= '</table>'; |
93 | 93 | |
94 | 94 | $this->setHeaders(); |