Ignore:
Timestamp:
Mar 15, 2013, 6:43:07 PM (11 years ago)
Author:
mistic100
Message:

don't delete keys when the provider is removed, hide fieldset when no provider active, use jQuery instead of $

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/oAuth/include/public_events.inc.php

    r21325 r21584  
    6161      $adapter = $hybridauth->authenticate($provider);
    6262      $remote_user = $adapter->getUserProfile();
     63     
     64      // security, check remote identifier
     65      if ($remote_user->identifier != $user_identifier)
     66      {
     67        pwg_unset_session_var('oauth_new_user');
     68        throw new Exception('Hacking attempt!');
     69      }
    6370   
    6471      $template->assign(array(
     
    7380     
    7481      $oauth_id = $provider.'---'.$remote_user->identifier;
    75      
    76       // security, check remote identifier
    77       if ($remote_user->identifier != $user_identifier)
    78       {
    79         pwg_unset_session_var('oauth_new_user');
    80         throw new Exception('Hacking attempt!');
    81       }
    8282     
    8383      // form submited
     
    9696          $user_id = get_userid($_POST['login']);
    9797         
    98           // udpdate oauth field
     98          // update oauth field
    9999          $query = '
    100100UPDATE '.USERS_TABLE.'
     
    235235  $template->assign('REDIRECT_TO', get_gallery_home_url());
    236236 
    237   $template->set_prefilter('menubar', 'oauth_add_menubar_buttons');
     237  $template->set_prefilter('menubar', 'oauth_add_menubar_buttons_prefilter');
    238238}
    239239
     
    254254  $add = 'disabled="disabled" ';
    255255  $script = '
    256 {footer_script}{literal}
     256{footer_script}
    257257jQuery("input[type=\'password\'], input[name=\'send_password_by_mail\']").parent("li").css("display", "none");
    258 {/literal}{/footer_script}';
     258{/footer_script}';
    259259
    260260  $content = str_replace($search, $search.$add, $content);
     
    269269}
    270270
    271 function oauth_add_menubar_buttons($content)
     271function oauth_add_menubar_buttons_prefilter($content)
    272272{
    273273  $search = '{include file=$block->template|@get_extent:$id }';
Note: See TracChangeset for help on using the changeset viewer.