Changeset 26608 for extensions/oAuth/include/functions.inc.php
- Timestamp:
- Jan 11, 2014, 12:08:40 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/oAuth/include/functions.inc.php
r26605 r26608 45 45 'providers' => $hybridauth_conf['providers'], 46 46 'persona_email' => @$persona_email, 47 'key' => get_ephemeral_key(0), 47 48 )); 48 49 $template->assign(array( … … 81 82 } 82 83 84 function 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 83 101 // http://www.sitepoint.com/authenticate-users-with-mozilla-persona/ 84 102 function persona_verify() … … 93 111 ); 94 112 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)); 108 114 109 115 $options = array(
Note: See TracChangeset
for help on using the changeset viewer.