Ignore:
Timestamp:
Jul 6, 2013, 4:32:05 PM (11 years ago)
Author:
mistic100
Message:

add Steam provider (OpenID based)

Location:
extensions/oAuth/include
Files:
3 edited

Legend:

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

    r20368 r23808  
    2727  global $hybridauth_conf;
    2828 
    29   $out = array();
    30  
    31   foreach ($hybridauth_conf['providers'] as $id => $data)
    32   {
    33     if ($data['enabled'])
    34     {
    35       $out[$id] = $data;
    36     }
    37   }
    38  
    39   return $out;
     29  return array_filter($hybridauth_conf['providers'], create_function('$p', 'return $p["enabled"];'));
    4030}
    4131
     32function oauth_assign_template_vars()
     33{
     34  global $template, $conf;
     35 
     36  if ($template->get_template_vars('OAUTH_URL') == null)
     37  {
     38    $template->assign(array(
     39      'oauth' => $conf['oauth'],
     40      'OAUTH_URL' => get_root_url() . OAUTH_PATH . 'auth.php?provider=',
     41      'OAUTH_PATH' => OAUTH_PATH,
     42      'OAUTH_ABS_PATH' => realpath(OAUTH_PATH) . '/',
     43      'PROVIDERS' => get_activated_providers(),
     44      'ABS_ROOT_URL' => rtrim(get_gallery_home_url(), '/') . '/',
     45      ));
     46  }
     47}
    4248
    4349?>
  • extensions/oAuth/include/providers_stats.inc.php

    r21584 r23808  
    6161    'new_app_link'      => null,
    6262  ),
     63  'Steam' => array(
     64    'label'             => 'Steam',
     65    'provider_name'     => 'Steam',
     66    'new_app_link'      => null,
     67  ),
    6368  'Wordpress' => array(
    6469    'label'             => 'Wordpress',
  • extensions/oAuth/include/public_events.inc.php

    r21584 r23808  
    3535    $_SESSION['page_errors'][] = sprintf(l10n('You registered with a %s account, please sign in with the same account.'), $provider);
    3636   
    37     $redirect_to = get_root_url().'identification.php';
     37    $redirect_to = get_root_url().'identification.php'; // variable used by identification.php
    3838    return true;
    3939  }
     
    5050  global $conf, $template, $hybridauth_conf, $page;
    5151 
    52   // comming from identification page
     52  // coming from identification page
    5353  if (pwg_get_session_var('oauth_new_user') != null)
    5454  {
     
    6666      {
    6767        pwg_unset_session_var('oauth_new_user');
    68         throw new Exception('Hacking attempt!');
     68        throw new Exception('Hacking attempt!', 403);
    6969      }
    7070   
     
    142142function oauth_begin_profile()
    143143{
    144   global $template, $user, $conf, $hybridauth_conf;
     144  global $template, $user, $conf, $hybridauth_conf, $page;
    145145 
    146146  $query = '
     
    254254  $add = 'disabled="disabled" ';
    255255  $script = '
    256 {footer_script}
    257 jQuery("input[type=\'password\'], input[name=\'send_password_by_mail\']").parent("li").css("display", "none");
     256{footer_script require="jquery"}
     257jQuery("input[type=\'password\'], input[name=\'send_password_by_mail\']").parent().css("display", "none");
    258258{/footer_script}';
    259259
     
    276276}
    277277
    278 
    279 function oauth_assign_template_vars()
    280 {
    281   global $template, $conf;
    282  
    283   if ($template->get_template_vars('OAUTH_URL') == null)
    284   {
    285     $template->assign(array(
    286       'oauth' => $conf['oauth'],
    287       'OAUTH_URL' => get_root_url() . OAUTH_PATH . 'auth.php?provider=',
    288       'OAUTH_PATH' => OAUTH_PATH,
    289       'OAUTH_ABS_PATH' => realpath(OAUTH_PATH) . '/',
    290       'PROVIDERS' => get_activated_providers(),
    291       'ABS_ROOT_URL' => rtrim(get_gallery_home_url(), '/') . '/',
    292       ));
    293   }
    294 }
    295278?>
Note: See TracChangeset for help on using the changeset viewer.