Changeset 26604


Ignore:
Timestamp:
Jan 10, 2014, 9:51:32 PM (10 years ago)
Author:
mistic100
Message:

clean templating + allow to use Steam/Wordpress/Flickr without displaying OpenID

Location:
extensions/oAuth
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • extensions/oAuth/admin/providers.php

    r26556 r26604  
    88if (isset($_POST['save_config']))
    99{
    10   $providers = array();
     10  $providers = array(); $count_enabled = 0;
    1111  foreach ($_POST['providers'] as $id => $data)
    1212  {
    1313    $data['enabled'] = $data['enabled']=='true';
     14    if ($data['enabled']) $count_enabled++;
    1415   
    1516    if ($PROVIDERS_CONFIG[$id]['new_app_link'] and $data['enabled'])
     
    2122        $page['errors'][] = l10n('%s: invalid keys', $PROVIDERS_CONFIG[$id]['provider_name']);
    2223      }
    23     }
    24    
    25     if ( ($id=='Wordpress' or $id=='Flickr' or $id=='Steam') and $data['enabled'] and !@$providers['OpenID']['enabled'] ) // in the template, OpenID must be before other OpenID based providers
    26     {
    27       $page['errors'][] = l10n('OpenID must be enabled in order to use %s authentication', $id);
    2824    }
    2925   
     
    4339 
    4440  $hybridauth_conf['providers'] = $providers;
     41  $hybridauth_conf['total'] = count($hybridauth_conf['providers']);
     42  $hybridauth_conf['enabled'] = $count_enabled;
    4543 
    4644  if (!count($page['errors']))
     
    4846    // generate config file
    4947    $content = "<?php\ndefined('PHPWG_ROOT_PATH') or die('Hacking attempt!');\n\nreturn ";
    50     $content.= var_export(array('providers'=>$providers), true);
     48    $content.= var_export(array_intersect_key($hybridauth_conf, array_flip(array('providers','total','enabled'))), true);
    5149    $content.= ";\n?>";
    5250   
  • extensions/oAuth/auth.php

    r26556 r26604  
    1515  }
    1616 
    17   if (
    18     !array_key_exists($provider, $hybridauth_conf['providers'])
    19     or !$hybridauth_conf['providers'][$provider]['enabled']
    20   ) {
     17  // OpenID is always enabled
     18  $hybridauth_conf['providers']['OpenID']['enabled'] = true;
     19 
     20  if (!array_key_exists($provider, $hybridauth_conf['providers'])
     21      or !$hybridauth_conf['providers'][$provider]['enabled']
     22    )
     23  {
    2124    throw new Exception('Invalid provider!', 1002);
    2225  }
  • extensions/oAuth/include/functions.inc.php

    r26556 r26604  
    2323}
    2424
    25 function get_activated_providers()
     25function oauth_assign_template_vars($u_redirect=null)
    2626{
    27   global $hybridauth_conf;
     27  global $template, $conf, $hybridauth_conf;
    2828 
    29   return array_filter($hybridauth_conf['providers'], create_function('$p', 'return $p["enabled"];'));
    30 }
    31 
    32 function oauth_assign_template_vars()
    33 {
    34   global $template, $conf;
     29  $conf['oauth']['include_common_template'] = true;
    3530 
    36   if ($template->get_template_vars('OAUTH_URL') == null)
     31  if ($template->get_template_vars('OAUTH') == null)
    3732  {
     33    $template->assign('OAUTH', array(
     34      'conf' => $conf['oauth'],
     35      'u_login' => get_root_url() . OAUTH_PATH . 'auth.php?provider=',
     36      'providers' => $hybridauth_conf['providers'],
     37      ));
    3838    $template->assign(array(
    39       'oauth' => $conf['oauth'],
    40       'OAUTH_URL' => get_root_url() . OAUTH_PATH . 'auth.php?provider=',
    4139      'OAUTH_PATH' => OAUTH_PATH,
    4240      'OAUTH_ABS_PATH' => realpath(OAUTH_PATH) . '/',
    43       'PROVIDERS' => get_activated_providers(),
    4441      'ABS_ROOT_URL' => rtrim(get_gallery_home_url(), '/') . '/',
    4542      ));
    4643  }
     44 
     45  if (isset($u_redirect))
     46  {
     47    $template->append('OAUTH', compact('u_redirect'), true);
     48  }
    4749}
     50
     51function get_oauth_id($user_id)
     52{
     53  global $conf;
     54 
     55  $query = '
     56SELECT oauth_id FROM ' . USERS_TABLE . '
     57  WHERE ' . $conf['user_fields']['id'] . ' = ' . $user_id . '
     58  AND oauth_id != ""
     59;';
     60  $result = pwg_query($query);
     61 
     62  if (!pwg_db_num_rows($result))
     63  {
     64    return null;
     65  }
     66  else
     67  {
     68    list($oauth_id) = pwg_db_fetch_row($result);
     69    return $oauth_id;
     70  }
     71}
  • extensions/oAuth/include/public_events.inc.php

    r26556 r26604  
    77function oauth_begin_identification()
    88{
    9   global $template, $conf;
    10  
    11   oauth_assign_template_vars();
    12   $template->assign('REDIRECT_TO', !empty($_GET['redirect']) ? urldecode($_GET['redirect']) : get_gallery_home_url());
    13  
     9  global $template, $conf, $hybridauth_conf;
     10 
     11  if ($hybridauth_conf['enabled'] > 0)
     12  {
     13    return;
     14  }
     15
     16  $u_redirect = !empty($_GET['redirect']) ? urldecode($_GET['redirect']) : get_gallery_home_url();
     17  oauth_assign_template_vars($u_redirect);
     18
    1419  $template->set_prefilter('identification', 'oauth_add_buttons_prefilter');
    1520}
     
    2328 
    2429  $query = '
    25 SELECT oauth_id FROM '.USERS_TABLE.'
    26   WHERE '.$conf['user_fields']['username'].' = "'.pwg_db_real_escape_string($username).'"
     30SELECT oauth_id FROM ' . USERS_TABLE . '
     31  WHERE ' . $conf['user_fields']['username'] . ' = "' . pwg_db_real_escape_string($username) . '"
    2732  AND oauth_id != ""
    2833;';
     
    4954{
    5055  global $conf, $template, $hybridauth_conf, $page;
     56 
     57  if ($hybridauth_conf['enabled'] == 0)
     58  {
     59    return;
     60  }
    5161 
    5262  // coming from identification page
     
    6979      }
    7080   
    71       $template->assign(array(
    72         'OAUTH_PROVIDER' => $provider,
    73         'OAUTH_USERNAME' => $remote_user->displayName,
    74         'OAUTH_PROFILE_URL' => $remote_user->profileURL,
    75         'OAUTH_AVATAR' => $remote_user->photoURL,
    76         'OAUTH_PATH' => OAUTH_PATH,
     81      $template->assign('OAUTH_USER', array(
     82        'provider' => $provider,
     83        'username' => $remote_user->displayName,
     84        'u_profile' => $remote_user->profileURL,
     85        'avatar' => $remote_user->photoURL,
    7786        ));
    7887       
     
    8493      if (isset($_POST['submit']))
    8594      {
    86         $page['errors'] =
    87           register_user($_POST['login'],
    88                         hash('sha1', $oauth_id.$conf['secret_key']),
    89                         $_POST['mail_address']
    90                         );
    91                        
    92         if (count($page['errors']) == 0)
     95        $user_id = register_user(
     96          $_POST['login'],
     97          hash('sha1', $oauth_id.$conf['secret_key']),
     98          $_POST['mail_address'],
     99          true,
     100          $page['errors'],
     101          false
     102          );
     103
     104        if ($user_id !== false)
    93105        {
    94106          pwg_unset_session_var('oauth_new_user');
    95           $user_id = get_userid($_POST['login']);
    96107         
    97108          // update oauth field
    98109          $query = '
    99 UPDATE '.USERS_TABLE.'
    100   SET oauth_id = "'.$oauth_id.'"
    101   WHERE '.$conf['user_fields']['id'].' = '.$user_id.'
     110UPDATE ' . USERS_TABLE . '
     111  SET oauth_id = "' . $oauth_id . '"
     112  WHERE ' . $conf['user_fields']['id'] . ' = ' . $user_id . '
    102113;';
    103114          pwg_query($query);
     
    118129     
    119130      // template
     131      $template->assign('OAUTH_PATH', OAUTH_PATH);
    120132      $template->set_prefilter('register', 'oauth_add_profile_prefilter');
    121133      $template->set_prefilter('register', 'oauth_remove_password_fields_prefilter');
     
    128140  else if ($conf['oauth']['display_register'])
    129141  {
    130     oauth_assign_template_vars();
    131     $template->assign('REDIRECT_TO', get_gallery_home_url());
     142    oauth_assign_template_vars(get_gallery_home_url());
    132143   
    133144    $template->set_prefilter('register', 'oauth_add_buttons_prefilter');
     
    141152function oauth_begin_profile()
    142153{
    143   global $template, $user, $conf, $hybridauth_conf, $page;
    144  
    145   $query = '
    146 SELECT oauth_id FROM '.USERS_TABLE.'
    147   WHERE '.$conf['user_fields']['id'].' = '.$user['id'].'
    148   AND oauth_id != ""
    149 ;';
    150   $result = pwg_query($query);
    151  
    152   if (!pwg_db_num_rows($result))
    153   {
    154     return;
    155   }
    156  
    157   list($oauth_id) = pwg_db_fetch_row($result);
     154  global $template, $user, $hybridauth_conf, $page;
     155 
     156  $oauth_id = get_oauth_id($user['id']);
     157 
     158  if (!isset($oauth_id))
     159  {
     160    return;
     161  }
     162 
    158163  list($provider) = explode('---', $oauth_id);
    159164 
     
    165170    $remote_user = $adapter->getUserProfile();
    166171   
    167     $template->assign(array(
    168       'OAUTH_PROVIDER' => $provider,
    169       'OAUTH_USERNAME' => $remote_user->displayName,
    170       'OAUTH_PROFILE_URL' => $remote_user->profileURL,
    171       'OAUTH_AVATAR' => $remote_user->photoURL,
    172       'OAUTH_PATH' => OAUTH_PATH,
     172    $template->assign('OAUTH_USER', array(
     173      'provider' => $provider,
     174      'username' => $remote_user->displayName,
     175      'u_profile' => $remote_user->profileURL,
     176      'avatar' => $remote_user->photoURL,
    173177      ));
    174178   
     179    $template->assign('OAUTH_PATH', OAUTH_PATH);
    175180    $template->set_prefilter('profile_content', 'oauth_add_profile_prefilter');
    176181    $template->set_prefilter('profile_content', 'oauth_remove_password_fields_prefilter');
     
    187192function oauth_logout($user_id)
    188193{
    189   global $conf, $hybridauth_conf;
    190  
    191   $query = '
    192 SELECT oauth_id FROM '.USERS_TABLE.'
    193   WHERE '.$conf['user_fields']['id'].' = '.$user_id.'
    194   AND oauth_id != ""
    195 ;';
    196   $result = pwg_query($query);
    197  
    198   if (!pwg_db_num_rows($result))
    199   {
    200     return;
    201   }
    202  
    203   list($oauth_id) = pwg_db_fetch_row($result);
     194  global $hybridauth_conf;
     195 
     196  $oauth_id = get_oauth_id($user_id);
     197 
     198  if (!isset($oauth_id))
     199  {
     200    return;
     201  }
     202
    204203  list($provider) = explode('---', $oauth_id);
    205204 
     
    222221function oauth_blockmanager($menu_ref_arr)
    223222{
    224   global $template, $conf;
     223  global $template, $conf, $hybridauth_conf;
    225224 
    226225  $menu = &$menu_ref_arr[0]; 
    227226 
    228   if (!$conf['oauth']['display_menubar'] or $menu->get_block('mbIdentification') == null)
    229   {
    230     return;
    231   }
    232  
    233   oauth_assign_template_vars();
    234   $template->assign('REDIRECT_TO', get_gallery_home_url());
     227  if ($hybridauth_conf['enabled'] == 0 or
     228      !$conf['oauth']['display_menubar'] or
     229      $menu->get_block('mbIdentification') == null
     230    )
     231  {
     232    return;
     233  }
     234 
     235  oauth_assign_template_vars(get_gallery_home_url());
    235236 
    236237  $template->set_prefilter('menubar', 'oauth_add_menubar_buttons_prefilter');
     238}
     239
     240function oauth_include_template()
     241{
     242  global $conf, $template;
     243 
     244  if (isset($conf['oauth']['include_common_template']))
     245  {
     246    $template->set_filename('oauth', realpath(OAUTH_PATH . 'template/identification_common.tpl'));
     247    $template->parse('oauth');
     248  }
    237249}
    238250
     
    254266  $script = '
    255267{footer_script require="jquery"}
    256 jQuery("input[type=\'password\'], input[name=\'send_password_by_mail\']").parent().css("display", "none");
     268jQuery("input[type=password], input[name=send_password_by_mail]").parent().hide();
    257269{/footer_script}';
    258270
     
    263275function oauth_add_profile_prefilter($content)
    264276{
    265   $search = '#</legend>#';
     277  $search = '#(</legend>)#';
    266278  $add = file_get_contents(OAUTH_PATH . 'template/profile.tpl');
    267   return preg_replace($search, '</legend> '.$add, $content, 1);
     279  return preg_replace($search, '$1 '.$add, $content, 1);
    268280}
    269281
    270282function oauth_add_menubar_buttons_prefilter($content)
    271283{
    272   $search = '{include file=$block->template|@get_extent:$id }';
     284  $search = '#({include file=\$block->template\|@?get_extent:\$id ?})#';
    273285  $add = file_get_contents(OAUTH_PATH . 'template/identification_menubar.tpl');
    274   return str_replace($search, $search.$add, $content);
    275 }
     286  return preg_replace($search, '$1 '.$add, $content);
     287}
  • extensions/oAuth/main.inc.php

    r26558 r26604  
    4242  add_event_handler('loc_begin_register', 'oauth_begin_register');
    4343  add_event_handler('loc_begin_profile', 'oauth_begin_profile');
     44 
     45  add_event_handler('loc_after_page_header', 'oauth_include_template');
    4446 
    4547  add_event_handler('try_log_user', 'oauth_try_log_user', EVENT_HANDLER_PRIORITY_NEUTRAL-30, 2);
  • extensions/oAuth/maintain.inc.php

    r26556 r26604  
    1212    'menubar_icon' => '26px',
    1313    );
     14   
     15  private $file;
     16 
     17  function __construct($plugin_id)
     18  {
     19    parent::__construct($plugin_id);
     20   
     21    $this->file = PWG_LOCAL_DIR . 'config/hybridauth.inc.php';
     22  }
    1423
    1524  function install($plugin_version, &$errors=array())
     
    2736    {     
    2837      pwg_query('ALTER TABLE `' . USERS_TABLE . '` ADD `oauth_id` VARCHAR(255) DEFAULT NULL;');
     38    }
     39   
     40    // add fields in hybridauth conf file
     41    if (file_exists($this->file))
     42    {
     43      $hybridauth_conf = include($this->file);
     44      if (!isset($hybridauth_conf['total']))
     45      {
     46        $enabled = array_filter($hybridauth_conf['providers'], create_function('$p', 'return $p["enabled"];'));
     47       
     48        $hybridauth_conf['total'] = count($hybridauth_conf['providers']);
     49        $hybridauth_conf['enabled'] = count($enabled);
     50       
     51        $content = "<?php\ndefined('PHPWG_ROOT_PATH') or die('Hacking attempt!');\n\nreturn ";
     52        $content.= var_export($hybridauth_conf, true);
     53        $content.= ";\n?>";
     54       
     55        file_put_contents($this->file, $content);
     56      }
    2957    }
    3058
     
    5078    pwg_query('ALTER TABLE `'. USERS_TABLE .'` DROP `oauth_id`;');
    5179   
    52     @unlink(PHPWG_PLUGINS_PATH . PWG_LOCAL_DIR . 'config/hybridauth.inc.php');
     80    @unlink($this->file);
    5381  }
    5482}
  • extensions/oAuth/template/auth.tpl

    r26556 r26604  
    3030{elseif $REDIRECT_TO}
    3131  <script type="text/javascript">
    32     if (window.opener) window.opener.parent.redirect('{$REDIRECT_TO}');
     32    if (window.opener) window.opener.parent.oauth_redirect('{$REDIRECT_TO}');
    3333    window.self.close();
    3434  </script>
  • extensions/oAuth/template/identification_common.tpl

    r26556 r26604  
    1212{footer_script}
    1313// redirect, called from the popup
    14 function redirect(type) {
    15   var url = "{$REDIRECT_TO}";
    16   if (typeof type != 'undefined' && type != 'default') {
    17     url = "{$ABS_ROOT_URL}"+ type +".php";
     14function oauth_redirect(type) {
     15  var url = '{$OAUTH.u_redirect}';
     16  if (type && type != 'default') {
     17    url = '{$ABS_ROOT_URL}'+ type +'.php';
    1818  }
    1919
     
    2424function open_auth(url) {
    2525  window.open(
    26     url+ "&t=" + (new Date()).getTime(),
    27     "hybridauth_social_sing_on",
    28     "location=0,status=0,scrollbars=0,width=800,height=500"
     26    url + '&t=' + (new Date()).getTime(),
     27    'hybridauth_social_sign_on',
     28    'location=0,status=0,scrollbars=0,width=800,height=500'
    2929  ); 
    3030}
    3131
    3232// click on a button
    33 jQuery("a.oauth").click(function() {
     33jQuery('a.oauth').click(function(e) {
     34  e.preventDefault();
     35 
    3436  var idp = jQuery(this).data('idp');
    3537 
     
    3840      switch(idp) {
    3941        case 'OpenID':
    40           jQuery("#openid_label").html('{'Please enter your OpenID URL'|translate|escape:javascript}'); break;
     42          jQuery('#openid_label').html('{'Please enter your OpenID URL'|translate|escape:javascript}'); break;
    4143        case 'Wordpress': case 'Flickr': case 'Steam':
    42           jQuery("#openid_label").html('{'Please enter your username'|translate|escape:javascript}'); break;
     44          jQuery('#openid_label').html('{'Please enter your username'|translate|escape:javascript}'); break;
    4345      }
    4446     
     
    4749        bg_color = $('body').css('background-color');
    4850      }
    49       jQuery("#openid_form").css('background-color', bg_color);
     51      jQuery('#openid_form').css('background-color', bg_color);
    5052
    51       jQuery("#openid_form .oauth_38px").removeClass().addClass("oauth_38px " + idp.toLowerCase());
    52       jQuery("#openid_form h3").html(idp);
    53       jQuery("#openid_form").data('idp', idp);
     53      jQuery('#openid_form .oauth_38px').removeClass().addClass('oauth_38px ' + idp.toLowerCase());
     54      jQuery('#openid_form h3').html(idp);
     55      jQuery('#openid_form').data('idp', idp);
    5456
    5557      jQuery.colorbox({
    56         inline:true,
    57         href:"#openid_form",
    58         initialWidth:0,
    59         initialHeight:0,
     58        inline: true,
     59        href: '#openid_form',
     60        initialWidth: 0,
     61        initialHeight: 0,
     62        mawWidth: '100%',
    6063        onComplete: function(){ jQuery.colorbox.resize({ speed:0 }) } // prevent misalignement when icon not loaded
    61       })
     64      });
    6265      break;
    6366     
    6467    default:
    65       open_auth("{$OAUTH_URL}"+ idp);
     68      open_auth('{$OAUTH.u_login}'+ idp);
    6669  }
    67  
    68   return false;
    6970});
    7071
    71 jQuery("#openid_form").submit(function() {
     72jQuery('#openid_form').submit(function(e) {
     73  e.preventDefault();
     74 
    7275  var idp = jQuery(this).data('idp');
    73   var oi = jQuery("#openid_form input[name='openid_identifier']").val();
    74   jQuery("#openid_form input[name='openid_identifier']").val('');
     76  var oi = jQuery('#openid_form input[name=openid_identifier]').val();
     77  jQuery('#openid_form input[name=openid_identifier]').val('');
    7578 
    76   jQuery("#openid_label").removeClass('error');
     79  jQuery('#openid_label').removeClass('error');
    7780  if (!oi) {
    78     jQuery("#openid_label").addClass('error');
    79     return false;
     81    jQuery('#openid_label').addClass('error');
     82    return;
    8083  }
    8184 
    8285  switch(idp) {
    83     case 'Wordpress': oi = "http://" + oi + ".wordpress.com"; break;
    84     case 'Flickr': oi = "http://www.flickr.com/photos/" + oi + "/"; break;
    85     case 'Steam': oi = "http://steamcommunity.com/openid/" + oi; break;
     86    case 'Wordpress': oi = 'http://' + oi + '.wordpress.com'; break;
     87    case 'Flickr': oi = 'http://www.flickr.com/photos/' + oi + '/'; break;
     88    case 'Steam': oi = 'http://steamcommunity.com/openid/' + oi; break;
    8689  }
    8790
    88   open_auth("{$OAUTH_URL}OpenID&openid_identifier="+ encodeURI(oi));
     91  open_auth('{$OAUTH.u_login}OpenID&openid_identifier=' + encodeURI(oi));
    8992
    9093  jQuery.colorbox.close();
    91   return false;
    9294});
    9395
    94 jQuery("#openid_cancel").click(function() {
    95   jQuery("#openid_label").removeClass('error');
     96jQuery('#openid_cancel').click(function(e) {
     97  e.preventDefault();
     98 
     99  jQuery('#openid_label').removeClass('error');
    96100  jQuery.colorbox.close();
    97   return false;
    98101});
    99102{/footer_script}
     
    107110    <div>
    108111      <br>
    109       <label id="openid_label" for="openid_identifier">Open ID URL</label>
     112      <label id="openid_label" for="openid_identifier"></label>
    110113      <br>
    111114      <input type="text" name="openid_identifier" id="openid_identifier" size="50">
  • extensions/oAuth/template/identification_menubar.tpl

    r26556 r26604  
    1 {if $id == "mbIdentification" and isset($U_LOGIN) and count($PROVIDERS)}
    2   {if not $OAUTH_JS_LOADED}
    3     {assign var=OAUTH_JS_LOADED value=true}
    4     {include file=$OAUTH_ABS_PATH|cat:'template/identification_common.tpl'}
    5   {/if}
     1{if $id == "mbIdentification" and isset($U_LOGIN)}
    62  {html_style}
    7     dl#mbIdentification dd:first-of-type { padding-bottom:0 !important;
    8     #mbIdentification .oauth { margin:0 1px; }
     3  dl#mbIdentification dd:first-of-type { padding-bottom:0 !important; }
     4  #mbIdentification .oauth { margin:0 1px; }
    95  {/html_style}
    106 
     
    1410      <legend>{'Or sign in with'|translate}</legend>
    1511     
    16     {foreach from=$PROVIDERS item=provider key=p}{strip}
    17       <a href="#" class="oauth oauth_{$oauth.menubar_icon} {$p|strtolower}" data-idp="{$p}" title="{$provider.name}"></a>
     12    {foreach from=$OAUTH.providers item=provider key=p}{strip}
     13      {if $provider.enabled}
     14        <a href="#" class="oauth oauth_{$OAUTH.conf.menubar_icon} {$p|strtolower}" data-idp="{$p}" title="{$provider.name}"></a>
     15      {/if}
    1816    {/strip}{/foreach}
    1917    </fieldset>
  • extensions/oAuth/template/identification_page.tpl

    r26556 r26604  
    1 {if count($PROVIDERS)}
    2   {if not $OAUTH_JS_LOADED}
    3     {assign var=OAUTH_JS_LOADED value=true}
    4     {include file=$OAUTH_ABS_PATH|cat:'template/identification_common.tpl'}
     1{html_style}
     2#oauth_wrap .oauth { margin:0 2px; }
     3{/html_style}
     4 
     5<fieldset style="text-align:center;" id="oauth_wrap">
     6  <legend>{'Or sign in with'|translate}</legend>
     7 
     8{foreach from=$OAUTH.providers item=provider key=p}{strip}
     9  {if $provider.enabled}
     10    <a href="#" class="oauth oauth_{$OAUTH.conf.identification_icon} {$p|strtolower}" data-idp="{$p}" title="{$provider.name}"></a>
    511  {/if}
    6   {html_style}
    7     #oauth_wrap .oauth { margin:0 2px; }
    8   {/html_style}
    9    
    10   <fieldset style="text-align:center;" id="oauth_wrap">
    11     <legend>{'Or sign in with'|translate}</legend>
    12    
    13   {foreach from=$PROVIDERS item=provider key=p}{strip}
    14     <a href="#" class="oauth oauth_{$oauth.identification_icon} {$p|strtolower}" data-idp="{$p}" title="{$provider.name}"></a>
    15   {/strip}{/foreach}
    16   </fieldset>
    17 {/if}
     12{/strip}{/foreach}
     13</fieldset>
  • extensions/oAuth/template/profile.tpl

    r26556 r26604  
    1919
    2020<div id="oauth">
    21 {if $OAUTH_AVATAR}
    22   <img src="{$OAUTH_AVATAR}" class="avatar">
     21{if $OAUTH_USER.avatar}
     22  <img src="{$OAUTH_USER.avatar}" class="avatar">
    2323{else}
    2424  <img src="{$ROOT_URL}{$OAUTH_PATH}template/images/avatar-default.png" class="avatar">
    2525{/if}
    2626
    27   {'Logged with'|translate} : <b>{$OAUTH_PROVIDER}</b><br>
    28   <b>{'Username'|translate}</b> : {$OAUTH_USERNAME}<br>
    29   {if $OAUTH_PROFILE_URL}<b>{'Profile URL'|translate}</b> : <a href="{$OAUTH_PROFILE_URL}">{$OAUTH_PROFILE_URL|truncate:40:' ... ':true:true}</a>{/if}
     27  {'Logged with'|translate} : <b>{$OAUTH_USER.provider}</b><br>
     28  <b>{'Username'|translate}</b> : {$OAUTH_USER.username}<br>
     29  {if $OAUTH_USER.u_profile}<b>{'Profile URL'|translate}</b> : <a href="{$OAUTH_USER.u_profile}">{$OAUTH_USER.u_profile|truncate:40:' ... ':true:true}</a>{/if}
    3030</div>
Note: See TracChangeset for help on using the changeset viewer.