r44237 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44236‎ | r44237 | r44238 >
Date:17:13, 4 December 2008
Author:siebrand
Status:ok
Tags:
Comment:
(bug 16564) Add Support for X-XRDS-Location meta header
Modified paths:
  • /trunk/extensions/LinkOpenID/LinkOpenID.i18n.php (modified) (history)
  • /trunk/extensions/LinkOpenID/LinkOpenID.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LinkOpenID/LinkOpenID.i18n.php
@@ -22,7 +22,8 @@
2323 This allows you to use your userpage as an OpenID as well.',
2424 'linkopenid-prefstext-openid' => 'Your OpenID:',
2525 'linkopenid-prefstext-v1url' => 'Server-URL for OpenID Version 1.1:',
26 - 'linkopenid-prefstext-v2url' => 'Server-URL for OpenID Version 2:'
 26+ 'linkopenid-prefstext-v2url' => 'Server-URL for OpenID Version 2:',
 27+ 'linkopenid-prefstext-xrdsurl' => 'XRDS-URL:', # Only translate this if needed.
2728 );
2829
2930 /** German
@@ -38,5 +39,5 @@
3940 Dies ermöglicht Ihnen die alternative Nutzung Ihrer Benutzerseite als OpenID.',
4041 'linkopenid-prefstext-openid' => 'Ihre OpenID:',
4142 'linkopenid-prefstext-v1url' => 'Server-URL für OpenID Version 1.1:',
42 - 'linkopenid-prefstext-v2url' => 'Server-URL für OpenID Version 2:'
 43+ 'linkopenid-prefstext-v2url' => 'Server-URL für OpenID Version 2:',
4344 );
Index: trunk/extensions/LinkOpenID/LinkOpenID.php
@@ -48,6 +48,7 @@
4949 if ( $openid != '' ) {
5050 $v1url = $user->getOption('wflinkopenid_v1url');
5151 $v2url = $user->getOption('wflinkopenid_v2url');
 52+ $xrdsurl = $user->getOption('wflinkopenid_xrdsurl');
5253
5354 if ( $v1url != '' ) {
5455 $wgOut->addLink( array('rel' => 'openid.server', 'href' => $v1url) );
@@ -58,6 +59,9 @@
5960 $wgOut->addLink( array('rel' => 'openid2.provider', 'href' => $v2url) );
6061 $wgOut->addLink( array('rel' => 'openid2.local_id', 'href' => $openid) );
6162 }
 63+
 64+ if ( $xrdsurl != '' )
 65+ $wgOut->addMeta('X-XRDS-Location', $xrdsurl);
6266 }
6367 }
6468 }
@@ -70,6 +74,7 @@
7175 $prefs->wfLinkOpenID['openid'] = $request->getVal('wflinkopenid_openid');
7276 $prefs->wfLinkOpenID['v1url'] = $request->getVal('wflinkopenid_v1url');
7377 $prefs->wfLinkOpenID['v2url'] = $request->getVal('wflinkopenid_v2url');
 78+ $prefs->wfLinkOpenID['xrdsurl'] = $request->getVal('wflinkopenid_xrdsurl');
7479 return TRUE;
7580 }
7681
@@ -96,6 +101,11 @@
97102 "<tr><td>" . wfMsgHtml( 'linkopenid-prefstext-v2url' ) . "</td><td>" .
98103 "<input type='text' name='wflinkopenid_v2url' size='60' value='" .
99104 htmlentities($prefs->wfLinkOpenID['v2url']) . "'></td></tr>" .
 105+
 106+ "<tr><td>" . wfMsgHtml( 'linkopenid-prefstext-xrdsurl' ) . "</td><td>" .
 107+ "<input type='text' name='wflinkopenid_xrdsurl' size='60' value='" .
 108+ htmlentities($prefs->wfLinkOpenID['xrdsurl']) . "'></td></tr>" .
 109+
100110 "</table></fieldset>"
101111 );
102112
@@ -106,6 +116,7 @@
107117 $user->setOption('wflinkopenid_openid', $form->wfLinkOpenID['openid'] );
108118 $user->setOption('wflinkopenid_v1url', $form->wfLinkOpenID['v1url'] );
109119 $user->setOption('wflinkopenid_v2url', $form->wfLinkOpenID['v2url'] );
 120+ $user->setOption('wflinkopenid_xrdsurl', $form->wfLinkOpenID['xrdsurl'] );
110121 return TRUE;
111122 }
112123
@@ -114,5 +125,6 @@
115126 $prefs->wfLinkOpenID['openid'] = $user->getOption('wflinkopenid_openid');
116127 $prefs->wfLinkOpenID['v1url'] = $user->getOption('wflinkopenid_v1url');
117128 $prefs->wfLinkOpenID['v2url'] = $user->getOption('wflinkopenid_v2url');
 129+ $prefs->wfLinkOpenID['xrdsurl'] = $user->getOption('wflinkopenid_xrdsurl');
118130 return TRUE;
119131 }

Status & tagging log