Index: trunk/extensions/OpenID/Consumer.php |
— | — | @@ -37,7 +37,7 @@ |
38 | 38 | # If false, works like "Order Deny,Allow" in Apache; allow by default, |
39 | 39 | # deny items in deny that aren't in allow. |
40 | 40 | |
41 | | - $wgOpenIDConsumerDenyByDefault = true; |
| 41 | + $wgOpenIDConsumerDenyByDefault = false; |
42 | 42 | |
43 | 43 | # Which partners to allow; regexps here. See above. |
44 | 44 | |
— | — | @@ -58,6 +58,12 @@ |
59 | 59 | |
60 | 60 | $wgOpenIDConsumerStorePath = NULL; |
61 | 61 | |
| 62 | + # Expiration time for the OpenID cookie. Lets the user re-authenticate |
| 63 | + # automatically if their session is expired. Only really useful if |
| 64 | + # it's much greater than $wgCookieExpiration. Default: about one year. |
| 65 | + |
| 66 | + $wgOpenIDCookieExpiration = 365 * 24 * 60 * 60; |
| 67 | + |
62 | 68 | function wfSpecialOpenIDLogin($par) { |
63 | 69 | global $wgRequest, $wgUser, $wgOut; |
64 | 70 | |
— | — | @@ -195,6 +201,10 @@ |
196 | 202 | |
197 | 203 | wfRunHooks('UserLoginComplete', array(&$wgUser)); |
198 | 204 | |
| 205 | + # Set a cookie for later check-immediate use |
| 206 | + |
| 207 | + OpenIDLoginSetCookie($openid); |
| 208 | + |
199 | 209 | $wgOut->setPageTitle( wfMsg( 'openidsuccess' ) ); |
200 | 210 | $wgOut->setRobotpolicy( 'noindex,nofollow' ); |
201 | 211 | $wgOut->setArticleRelated( false ); |
— | — | @@ -202,6 +212,15 @@ |
203 | 213 | $wgOut->returnToMain( ); |
204 | 214 | } |
205 | 215 | |
| 216 | + function OpenIDLoginSetCookie($openid) { |
| 217 | + global $wgCookiePath, $wgCookieDomain, $wgCookieSecure, $wgCookiePrefix; |
| 218 | + global $wgOpenIDCookieExpiration; |
| 219 | + |
| 220 | + $exp = time() + $wgOpenIDCookieExpiration; |
| 221 | + |
| 222 | + setcookie($wgCookiePrefix.'OpenID', $openid, $exp, $wgCookiePath, $wgCookieDomain, $wgCookieSecure); |
| 223 | + } |
| 224 | + |
206 | 225 | function OpenIDLoginForm() { |
207 | 226 | global $wgOut, $wgUser; |
208 | 227 | $sk = $wgUser->getSkin(); |
— | — | @@ -771,3 +790,4 @@ |
772 | 791 | } |
773 | 792 | } |
774 | 793 | |
| 794 | +?> |