Development

Changeset 21320

You must first sign up to be able to contribute.

Changeset 21320

Show
Ignore:
Timestamp:
08/22/09 01:02:32 (4 years ago)
Author:
dwhittle
Message:

ysfOpenPlugin [trunk]: refactored open id handling

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/ysfOpenPlugin/trunk/lib/validator/OpenIdentityValidator.class.php

    r20251 r21320  
    1919  { 
    2020 
    21     if(stristr($value, 'ymail.com') || stristr($value, 'yahoo.com')) // yahoo email = yahoo open id 
     21    if(stristr($value, '@ymail.com') || stristr($value, '@yahoo.com')) 
    2222    { 
    23       $value = 'https://me.yahoo.com'; 
     23      $value = 'https://open.login.yahooapis.com/openid/op/auth'; 
    2424    } 
    25     else if(stristr($value, 'gmail.com') || stristr($value, 'google.com')) // google email = google open id 
     25    else if(stristr($value, '@gmail.com') || stristr($value, '@google.com')) 
    2626    { 
    2727      $value = 'https://www.google.com/accounts/o8/id'; 
  • plugins/ysfOpenPlugin/trunk/modules/ysfOpenPlugin/actions/actions.class.php

    r20251 r21320  
    2020  { 
    2121    $oauthAccessToken = $this->getUser()->getAttribute('yahoo_oauth_access_token'); 
    22     $yahoo = $this->getUser()->getOAuthClient('yahoo'); 
     22    $yahoo = $this->getUser()->hasOAuthClient('yahoo') && $this->getUser()->getOAuthClient('yahoo')->hasAccessToken(); 
    2323 
    2424    if($yahoo) 
     
    5757 
    5858    $consumer = new Zend_OpenId_Consumer(new Zend_OpenId_Consumer_Storage_File(sfConfig::get('sf_cache_dir') . '/openid/')); 
    59     $profile = new Zend_OpenId_Extension_Sreg(array('nickname' => true, 'fullname' => false, 'email' => true, 'dob' => false, 'gender' => false, 'postcode' => false, 'language' => false, 'timezone' => false), null, '1.1'); 
     59    $profile  = new Zend_OpenId_Extension_Sreg(array('nickname' => true, 'fullname' => false, 'email' => true, 'dob' => false, 'gender' => false, 'postcode' => false, 'language' => false, 'timezone' => false), null, '1.1'); 
     60    // $oauth    = new Zend_OpenID_Extension_Oauth(); 
    6061 
    6162    $openIdMode = $request->getParameter('openid_mode'); 
  • plugins/ysfOpenPlugin/trunk/modules/ysfOpenPlugin/templates/loginSuccess.php

    r20251 r21320  
    2323 
    2424  <div class="yui-b"> 
    25     <a href="<?php echo url_for('ysfOpenPlugin/login'); ?>?_csrf_token=<?php echo $form->getCSRFToken(); ?>&amp;identity=https://me.yahoo.com" title="<?php echo __('Yahoo! OpenID'); ?>"> 
     25    <a href="<?php echo url_for('ysfOpenPlugin/login'); ?>?_csrf_token=<?php echo $form->getCSRFToken(); ?>&amp;identity=https://me.yahoo.com/" title="<?php echo __('Yahoo! OpenID'); ?>"> 
    2626      <img src="http://www.yahoo.com/favicon.ico" alt="<?php echo __('Yahoo! OpenID'); ?>" height="16" width="16" /> 
    2727      <?php echo __('Sign in with Yahoo! ID'); ?>