Changeset 2750
- Timestamp:
- 11/07/07 08:22:57 (1 year ago)
- Files:
-
- authopenidplugin/0.11/authopenid/authopenid.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
authopenidplugin/0.11/authopenid/authopenid.py
r2747 r2750 34 34 35 35 from openid.consumer import consumer 36 from openid import sreg 36 37 37 38 class AuthOpenIdPlugin(Component): … … 209 210 # communicate securely with the identity server. 210 211 212 sreg_request = sreg.SRegRequest(optional=['nickname', 'email']) 213 request.addExtension(sreg_request) 214 211 215 trust_root = self._get_trust_root(req) + '/' 212 216 return_to = self._get_trust_root(req) + req.href.openidprocess() … … 277 281 req.outcookie['trac_auth'] = cookie 278 282 req.outcookie['trac_auth']['path'] = req.href() 283 req.outcookie['trac_auth']['expires'] = 60*60*24 284 285 reg_info = sreg.SRegResponse.fromSuccessResponse(info).getExtensionArgs() 286 287 if reg_info and reg_info.has_key('nickname') and len(reg_info['nickname']) > 0: 288 req.session['name'] = reg_info['nickname'] 289 if reg_info and reg_info.has_key('email') and len(reg_info['email']) > 0: 290 req.session['email'] = reg_info['email'] 291 279 292 elif info.status == consumer.CANCEL: 280 293 # cancelled … … 326 339 cursor = db.cursor() 327 340 cursor.execute("DELETE FROM auth_cookie WHERE name=%s OR time < %s", 328 (req.authname, int(time.time()) - 86400 * 10))341 (req.authname, int(time.time()) - 60*60*24)) 329 342 db.commit() 330 343 self._expire_cookie(req)
