Index: trunk/extensions/OpenID/OpenID.i18n.php |
— | — | @@ -37,7 +37,6 @@ |
38 | 38 | 'openidserver' => 'OpenID server', |
39 | 39 | 'openidxrds' => 'Yadis file', |
40 | 40 | 'openidconvert' => 'OpenID converter', |
41 | | - |
42 | 41 | 'openiderror' => 'Verification error', |
43 | 42 | 'openiderrortext' => 'An error occured during verification of the OpenID URL.', |
44 | 43 | 'openidconfigerror' => 'OpenID configuration error', |
— | — | @@ -98,7 +97,6 @@ |
99 | 98 | 'openidlogininstructions-passwordloginallowed' => 'If you already have an account on {{SITENAME}}, you can [[Special:UserLogin|log in]] with your username and password as usual. |
100 | 99 | To use OpenID in the future, you can [[Special:OpenIDConvert|convert your account to OpenID]] after you have logged in normally.', |
101 | 100 | 'openidupdateuserinfo' => 'Update my personal information:', |
102 | | - |
103 | 101 | 'openiddelete' => 'Delete OpenID', |
104 | 102 | 'openiddelete-text' => 'By clicking the "{{int:openiddelete-button}}" button, you will remove the OpenID $1 from your account. |
105 | 103 | You will no longer be able to log in with this OpenID.', |
— | — | @@ -126,6 +124,14 @@ |
127 | 125 | 'openid-provider-label-yahoo' => 'Log in using your Yahoo account', |
128 | 126 | 'openid-provider-label-aol' => 'Enter your AOL screenname', |
129 | 127 | 'openid-provider-label-other-username' => 'Enter your $1 username', |
| 128 | + |
| 129 | + 'specialpages-group-openid' => 'OpenID service pages and status information', |
| 130 | + 'right-openid-dashboard-access' => 'Standard access to the OpenID dashboard', |
| 131 | + 'right-openid-dashboard-admin' => 'Administrator access to the OpenID dashboard', |
| 132 | + |
| 133 | + 'openid-dashboard-title' => 'OpenID dashboard', |
| 134 | + 'openid-dashboard-title-admin' => 'OpenID dashboard (administrator)', |
| 135 | + 'openid-dashboard-introduction' => 'The current OpenID extension settings ([$1 help])', |
130 | 136 | ); |
131 | 137 | |
132 | 138 | /** Message documentation (Message documentation) |
— | — | @@ -171,6 +177,14 @@ |
172 | 178 | 'openid-pref-update-userinfo-on-login' => 'OpenID preference label for updating fron OpenID persona upon login', |
173 | 179 | 'openid-urls-action' => '{{Identical|Action}}', |
174 | 180 | 'openid-urls-delete' => '{{identical|Delete}}', |
| 181 | + |
| 182 | + 'specialpages-group-openid' => 'Display group name for OpenID-extension related special pages for Special:SpecialPages', |
| 183 | + 'right-openid-dashboard-access' => 'the standard access right for the OpenID dashboard, which is a restricted special page', |
| 184 | + 'right-openid-dashboard-admin' => 'the special adminstrator access right for the OpenID dashboard, which is a restricted special page', |
| 185 | + 'openid-dashboard-title' => 'Display name and page title for the OpenID dashboard (non-admin) on Special:SpecialPages', |
| 186 | + 'openid-dashboard-title-admin' => 'Display name and page title for the adminstrator OpenID dashboard on Special:SpecialPages', |
| 187 | + 'openid-dashboard-introduction' => 'Intro text for the special OpenID dashboard page: the user gets status information about the current OpenID settings of this wiki. |
| 188 | +* $1 is the url of the help page explaining the parameters', |
175 | 189 | ); |
176 | 190 | |
177 | 191 | /** Faeag Rotuma (Faeag Rotuma) |
Index: trunk/extensions/OpenID/OpenID.hooks.php |
— | — | @@ -25,9 +25,9 @@ |
26 | 26 | $list['CreateAccount'] = 'SpecialOpenIDCreateAccount'; |
27 | 27 | } |
28 | 28 | |
29 | | - # Special pages are added at global scope; remove server-related ones |
30 | | - # if client-only flag is set |
31 | | - $addList = array( 'Login', 'Convert' ); |
| 29 | + # Special pages are added at global scope; |
| 30 | + # remove server-related ones if client-only flag is set |
| 31 | + $addList = array( 'Login', 'Convert', 'Dashboard' ); |
32 | 32 | if ( !$wgOpenIDClientOnly ) { |
33 | 33 | $addList[] = 'Server'; |
34 | 34 | $addList[] = 'XRDS'; |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | |
37 | 37 | foreach ( $addList as $sp ) { |
38 | 38 | $list['OpenID' . $sp] = 'SpecialOpenID' . $sp; |
| 39 | + SpecialPageFactory::setGroup( 'OpenID' . $sp, 'openid' ); |
39 | 40 | } |
40 | 41 | |
41 | 42 | return true; |
Index: trunk/extensions/OpenID/OpenID.setup.php |
— | — | @@ -254,6 +254,7 @@ |
255 | 255 | $wgAutoloadClasses['SpecialOpenIDConvert'] = $dir . 'SpecialOpenIDConvert.body.php'; |
256 | 256 | $wgAutoloadClasses['SpecialOpenIDServer'] = $dir . 'SpecialOpenIDServer.body.php'; |
257 | 257 | $wgAutoloadClasses['SpecialOpenIDXRDS'] = $dir . 'SpecialOpenIDXRDS.body.php'; |
| 258 | +$wgAutoloadClasses['SpecialOpenIDDashboard'] = $dir . 'SpecialOpenIDDashboard.body.php'; |
258 | 259 | |
259 | 260 | # UI class |
260 | 261 | $wgAutoloadClasses['OpenIDProvider'] = $dir . 'OpenIDProvider.body.php'; |
— | — | @@ -283,6 +284,11 @@ |
284 | 285 | # FIXME, function does not exist |
285 | 286 | # $wgHooks['UserLoginForm'][] = 'OpenIDHooks::onUserLoginForm'; |
286 | 287 | |
| 288 | +# new user rights |
| 289 | +$wgAvailableRights[] = array( 'openid-dashboard-access', 'openid-dashboard-admin' ); |
| 290 | +$wgGroupPermissions['user']['openid-dashboard-access'] = true; |
| 291 | +$wgGroupPermissions['sysop']['openid-dashboard-admin'] = true; |
| 292 | + |
287 | 293 | $myResourceTemplate = array( |
288 | 294 | 'localBasePath' => dirname( __FILE__ ) . '/skin', |
289 | 295 | 'remoteExtPath' => 'OpenID/skin', |
Index: trunk/extensions/OpenID/SpecialOpenIDDashboard.body.php |
— | — | @@ -0,0 +1,90 @@ |
| 2 | +<?php |
| 3 | +/** |
| 4 | + * Implements Special:OpenIDDashboard parameter settings and status information |
| 5 | + * |
| 6 | + * @ingroup SpecialPage |
| 7 | + * @ingroup Extensions |
| 8 | + * @version 0.1 |
| 9 | + * @author Thomas Gries |
| 10 | + * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later |
| 11 | + * @link http://www.mediawiki.org/wiki/Extension:OpenID Documentation |
| 12 | + * |
| 13 | + */ |
| 14 | +class SpecialOpenIDDashboard extends SpecialPage { |
| 15 | + |
| 16 | + /** |
| 17 | + * Constructor - sets up the new special page |
| 18 | + * required right: openid-dashboard-access |
| 19 | + */ |
| 20 | + public function __construct() { |
| 21 | + parent::__construct( 'OpenIDDashboard', 'openid-dashboard-access' ); |
| 22 | + } |
| 23 | + |
| 24 | + /** |
| 25 | + * Different description will be shown on Special:SpecialPage depending on |
| 26 | + * whether the user has the 'openiddashboard' right or not. |
| 27 | + */ |
| 28 | + function getDescription() { |
| 29 | + global $wgUser; |
| 30 | + |
| 31 | + return wfMsg( $wgUser->isAllowed( 'openid-dashboard-admin' ) ? |
| 32 | + 'openid-dashboard-title-admin' : 'openid-dashboard-title' ) ; |
| 33 | + } |
| 34 | + |
| 35 | + |
| 36 | + /** |
| 37 | + * Show the special page |
| 38 | + * |
| 39 | + * @param $par Mixed: parameter passed to the page or null |
| 40 | + */ |
| 41 | + 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 | + global $wgOut, $wgUser; |
| 53 | + global $wgOpenIDShowUrlOnUserPage; |
| 54 | + global $wgOpenIDTrustEmailAddress; |
| 55 | + global $wgOpenIDAllowExistingAccountSelection; |
| 56 | + global $wgOpenIDAllowNewAccountname; |
| 57 | + global $wgOpenIDUseEmailAsNickname; |
| 58 | + global $wgOpenIDProposeUsernameFromSREG; |
| 59 | + global $wgOpenIDAllowAutomaticUsername; |
| 60 | + global $wgOpenIDOnly; |
| 61 | + global $wgOpenIDClientOnly; |
| 62 | + global $wgOpenIDAllowServingOpenIDUserAccounts; |
| 63 | + global $wgOpenIDShowProviderIcons; |
| 64 | + |
| 65 | + $out = "<table class='openiddashboard wikitable'><tr><th>Parameter</th><th>Value</th></tr>"; |
| 66 | + $out .= show( '$wgOpenIDOnly', $wgOpenIDOnly ); |
| 67 | + $out .= show( '$wgOpenIDClientOnly', $wgOpenIDClientOnly ); |
| 68 | + $out .= show( '$wgOpenIDAllowServingOpenIDUserAccounts', $wgOpenIDAllowServingOpenIDUserAccounts ); |
| 69 | + $out .= show( '$wgOpenIDTrustEmailAddress', $wgOpenIDTrustEmailAddress ); |
| 70 | + $out .= show( '$wgOpenIDAllowExistingAccountSelection', $wgOpenIDAllowExistingAccountSelection ); |
| 71 | + $out .= show( '$wgOpenIDAllowAutomaticUsername', $wgOpenIDAllowAutomaticUsername ); |
| 72 | + $out .= show( '$wgOpenIDAllowNewAccountname', $wgOpenIDAllowNewAccountname ); |
| 73 | + $out .= show( '$wgOpenIDUseEmailAsNickname', $wgOpenIDUseEmailAsNickname ); |
| 74 | + $out .= show( '$wgOpenIDProposeUsernameFromSREG', $wgOpenIDProposeUsernameFromSREG ); |
| 75 | + $out .= show( '$wgOpenIDShowUrlOnUserPage', $wgOpenIDShowUrlOnUserPage ); |
| 76 | + $out .= show( '$wgOpenIDShowProviderIcons', $wgOpenIDShowProviderIcons ); |
| 77 | + $out .= '</table>'; |
| 78 | + |
| 79 | + $this->setHeaders(); |
| 80 | + $this->outputHeader(); |
| 81 | + $wgOut->addWikiMsg( 'openid-dashboard-introduction', 'http://www.mediawiki.org/wiki/Extension:OpenID' ); |
| 82 | + $wgOut->addHTML( $out ); |
| 83 | + } |
| 84 | + |
| 85 | + function error() { |
| 86 | + global $wgOut; |
| 87 | + $args = func_get_args(); |
| 88 | + $wgOut->wrapWikiMsg( "<p class='error'>$1</p>", $args ); |
| 89 | + } |
| 90 | + |
| 91 | +} |
Property changes on: trunk/extensions/OpenID/SpecialOpenIDDashboard.body.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 92 | + native |