Ignore:
Timestamp:
Jan 11, 2014, 12:08:40 PM (10 years ago)
Author:
mistic100
Message:

finish updating guides, fix flow issues, update language file

File:
1 edited

Legend:

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

    r26605 r26608  
    4545      'providers' => $hybridauth_conf['providers'],
    4646      'persona_email' => @$persona_email,
     47      'key' => get_ephemeral_key(0),
    4748      ));
    4849    $template->assign(array(
     
    8182}
    8283
     84function get_servername($with_port=false)
     85{
     86  $scheme = 'http';
     87  if ( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443 )
     88  {
     89    $scheme = 'https';
     90  }
     91 
     92  $servername = $scheme . '://' . $_SERVER['HTTP_HOST'];
     93  if ($with_port)
     94  {
     95    $servername.= ':' . $_SERVER['SERVER_PORT'];
     96  }
     97   
     98  return $servername;
     99}
     100
    83101// http://www.sitepoint.com/authenticate-users-with-mozilla-persona/
    84102function persona_verify()
     
    93111    );
    94112
    95   $scheme = 'http';
    96   if ( (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') || $_SERVER['SERVER_PORT'] == 443 )
    97   {
    98     $scheme = 'https';
    99   }
    100   $audience = sprintf(
    101     '%s://%s:%s',
    102     $scheme,
    103     $_SERVER['HTTP_HOST'],
    104     $_SERVER['SERVER_PORT']
    105     );
    106 
    107   $params = 'assertion=' . urlencode($assert) . '&audience=' . urlencode($audience);
     113  $params = 'assertion=' . urlencode($assert) . '&audience=' . urlencode(get_servername(true));
    108114
    109115  $options = array(
Note: See TracChangeset for help on using the changeset viewer.