Skip to content

Commit

Permalink
Year and version bump
Browse files Browse the repository at this point in the history
Also revert index.php code from hybridauth#381
  • Loading branch information
AdwinTrave committed Mar 26, 2015
1 parent 351223c commit 425eda3
Show file tree
Hide file tree
Showing 19 changed files with 274 additions and 276 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Hybridauth Change log
=====================
2.4.0 -
2.4.0 - March 26 2015
New Providers:
- BitBucket #405
- Rhapsody #362
Expand All @@ -14,6 +14,10 @@ Hybridauth Change log
New:
#382 - LinkedIn send direct message
#388 - Add home town in VKontakte
#396 + #408 - Make Hybrid_Endpoint methods non-static
#410 - Set LinkedIn API request timeout to 5 seconds because the API can be slow.
#419 - Adding emailVerified for Google email type 'account'
#406 - Add access token to header in google provider
Fixes:
#382 - Fix undefined variable in Foursquare
#379 - Google authentication problem on the master branch (invalid_request, missing parameter) with Drupal 7
Expand All @@ -27,6 +31,11 @@ Hybridauth Change log
#296 - OAuth2Client - curl - invalid POSTc
#395 - Do not replace $_REQUEST with something else
#412 - Facebook now requires access_token to get coverInfoURL
#413 - Fix Fatal Error: Declaration of Hybrid_Storage::config() must be compatible with that of Hybrid_Storage_Interface::config()
#417 - Fixed an issue with email property for vkontakte
#393 + #420 - Steam API user data support
Removed:
- Removed examples (#381, #339, #208)

2.3.0 - November 16 2014
#87 - Make logging level based
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# HybridAuth 2.4.0-dev
# HybridAuth 2.4.0

[![Join the chat at https://gitter.im/hybridauth/hybridauth](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/hybridauth/hybridauth?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

Expand Down
80 changes: 40 additions & 40 deletions hybridauth/Hybrid/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@

/**
* Hybrid_Auth class
*
*
* Hybrid_Auth class provide a simple way to authenticate users via OpenID and OAuth.
*
*
* Generally, Hybrid_Auth is the only class you should instanciate and use throughout your application.
*/
class Hybrid_Auth
class Hybrid_Auth
{
public static $version = "2.4.0-dev";
public static $version = "2.4.0";

public static $config = array();

Expand All @@ -28,15 +28,15 @@ class Hybrid_Auth

/**
* Try to start a new session of none then initialize Hybrid_Auth
*
*
* Hybrid_Auth constructor will require either a valid config array or
* a path for a configuration file as parameter. To know more please
* a path for a configuration file as parameter. To know more please
* refer to the Configuration section:
* http://hybridauth.sourceforge.net/userguide/Configuration.html
*/
function __construct( $config )
{
Hybrid_Auth::initialize( $config );
{
Hybrid_Auth::initialize( $config );
}

// --------------------------------------------------------------------
Expand All @@ -55,7 +55,7 @@ public static function initialize( $config )
}

// build some need'd paths
$config["path_base"] = realpath( dirname( __FILE__ ) ) . "/";
$config["path_base"] = realpath( dirname( __FILE__ ) ) . "/";
$config["path_libraries"] = $config["path_base"] . "thirdparty/";
$config["path_resources"] = $config["path_base"] . "resources/";
$config["path_providers"] = $config["path_base"] . "Providers/";
Expand Down Expand Up @@ -99,10 +99,10 @@ public static function initialize( $config )
// start session storage mng
Hybrid_Auth::$store = new Hybrid_Storage();

Hybrid_Logger::info( "Enter Hybrid_Auth::initialize()");
Hybrid_Logger::info( "Hybrid_Auth::initialize(). PHP version: " . PHP_VERSION );
Hybrid_Logger::info( "Hybrid_Auth::initialize(). Hybrid_Auth version: " . Hybrid_Auth::$version );
Hybrid_Logger::info( "Hybrid_Auth::initialize(). Hybrid_Auth called from: " . Hybrid_Auth::getCurrentUrl() );
Hybrid_Logger::info( "Enter Hybrid_Auth::initialize()");
Hybrid_Logger::info( "Hybrid_Auth::initialize(). PHP version: " . PHP_VERSION );
Hybrid_Logger::info( "Hybrid_Auth::initialize(). Hybrid_Auth version: " . Hybrid_Auth::$version );
Hybrid_Logger::info( "Hybrid_Auth::initialize(). Hybrid_Auth called from: " . Hybrid_Auth::getCurrentUrl() );

// PHP Curl extension [http://www.php.net/manual/en/intro.curl.php]
if ( ! function_exists('curl_init') ) {
Expand All @@ -114,7 +114,7 @@ public static function initialize( $config )
if ( ! function_exists('json_decode') ) {
Hybrid_Logger::error('Hybridauth Library needs the JSON PHP extension.');
throw new Exception('Hybridauth Library needs the JSON PHP extension.');
}
}

// session.name
if( session_name() != "PHPSESSID" ){
Expand All @@ -132,10 +132,10 @@ public static function initialize( $config )
}

Hybrid_Logger::debug( "Hybrid_Auth initialize. dump used config: ", serialize( $config ) );
Hybrid_Logger::debug( "Hybrid_Auth initialize. dump current session: ", Hybrid_Auth::storage()->getSessionData() );
Hybrid_Logger::debug( "Hybrid_Auth initialize. dump current session: ", Hybrid_Auth::storage()->getSessionData() );
Hybrid_Logger::info( "Hybrid_Auth initialize: check if any error is stored on the endpoint..." );

if( Hybrid_Error::hasError() ){
if( Hybrid_Error::hasError() ){
$m = Hybrid_Error::getErrorMessage();
$c = Hybrid_Error::getErrorCode();
$p = Hybrid_Error::getErrorPrevious();
Expand All @@ -146,7 +146,7 @@ public static function initialize( $config )

// try to provide the previous if any
// Exception::getPrevious (PHP 5 >= 5.3.0) http://php.net/manual/en/exception.getprevious.php
if ( version_compare( PHP_VERSION, '5.3.0', '>=' ) && ($p instanceof Exception) ) {
if ( version_compare( PHP_VERSION, '5.3.0', '>=' ) && ($p instanceof Exception) ) {
throw new Exception( $m, $c, $p );
}
else{
Expand All @@ -156,7 +156,7 @@ public static function initialize( $config )

Hybrid_Logger::info( "Hybrid_Auth initialize: no error found. initialization succeed." );

// Endof initialize
// Endof initialize
}

// --------------------------------------------------------------------
Expand All @@ -176,30 +176,30 @@ public static function storage()
// --------------------------------------------------------------------

/**
* Get hybridauth session data.
* Get hybridauth session data.
*/
function getSessionData()
{
{
return Hybrid_Auth::storage()->getSessionData();
}

// --------------------------------------------------------------------

/**
* restore hybridauth session data.
* restore hybridauth session data.
*/
function restoreSessionData( $sessiondata = NULL )
{
{
Hybrid_Auth::storage()->restoreSessionData( $sessiondata );
}

// --------------------------------------------------------------------

/**
* Try to authenticate the user with a given provider.
* Try to authenticate the user with a given provider.
*
* If the user is already connected we just return and instance of provider adapter,
* ELSE, try to authenticate and authorize the user with the provider.
* ELSE, try to authenticate and authorize the user with the provider.
*
* $params is generally an array with required info in order for this provider and HybridAuth to work,
* like :
Expand All @@ -212,7 +212,7 @@ public static function authenticate( $providerId, $params = NULL )
Hybrid_Logger::info( "Enter Hybrid_Auth::authenticate( $providerId )" );

// if user not connected to $providerId then try setup a new adapter and start the login process for this provider
if( ! Hybrid_Auth::storage()->get( "hauth_session.$providerId.is_logged_in" ) ){
if( ! Hybrid_Auth::storage()->get( "hauth_session.$providerId.is_logged_in" ) ){
Hybrid_Logger::info( "Hybrid_Auth::authenticate( $providerId ), User not connected to the provider. Try to authenticate.." );

$provider_adapter = Hybrid_Auth::setup( $providerId, $params );
Expand All @@ -232,7 +232,7 @@ public static function authenticate( $providerId, $params = NULL )

/**
* Return the adapter instance for an authenticated provider
*/
*/
public static function getAdapter( $providerId = NULL )
{
Hybrid_Logger::info( "Enter Hybrid_Auth::getAdapter( $providerId )" );
Expand All @@ -244,25 +244,25 @@ public static function getAdapter( $providerId = NULL )

/**
* Setup an adapter for a given provider
*/
*/
public static function setup( $providerId, $params = NULL )
{
Hybrid_Logger::debug( "Enter Hybrid_Auth::setup( $providerId )", $params );

if( ! $params ){
if( ! $params ){
$params = Hybrid_Auth::storage()->get( "hauth_session.$providerId.id_provider_params" );

Hybrid_Logger::debug( "Hybrid_Auth::setup( $providerId ), no params given. Trying to get the stored for this provider.", $params );
}

if( ! $params ){
if( ! $params ){
$params = ARRAY();

Hybrid_Logger::info( "Hybrid_Auth::setup( $providerId ), no stored params found for this provider. Initialize a new one for new session" );
}

if( is_array($params) && ! isset( $params["hauth_return_to"] ) ){
$params["hauth_return_to"] = Hybrid_Auth::getCurrentUrl();
$params["hauth_return_to"] = Hybrid_Auth::getCurrentUrl();

Hybrid_Logger::debug( "Hybrid_Auth::setup( $providerId ). HybridAuth Callback URL set to: ", $params["hauth_return_to"] );
}
Expand All @@ -273,7 +273,7 @@ public static function setup( $providerId, $params = NULL )
$provider->factory( $providerId, $params );

return $provider;
}
}

// --------------------------------------------------------------------

Expand All @@ -289,7 +289,7 @@ public static function isConnectedWith( $providerId )

/**
* Return array listing all authenticated providers
*/
*/
public static function getConnectedProviders()
{
$idps = array();
Expand All @@ -307,7 +307,7 @@ public static function getConnectedProviders()

/**
* Return array listing all enabled providers as well as a flag if you are connected.
*/
*/
public static function getProviders()
{
$idps = array();
Expand All @@ -328,8 +328,8 @@ public static function getProviders()
// --------------------------------------------------------------------

/**
* A generic function to logout all connected provider at once
*/
* A generic function to logout all connected provider at once
*/
public static function logoutAllProviders()
{
$idps = Hybrid_Auth::getConnectedProviders();
Expand Down Expand Up @@ -363,7 +363,7 @@ public static function redirect( $url, $mode = "PHP" )
echo '<body onload="redirect()">';
echo 'Redirecting, please wait...';
echo '</body>';
echo '</html>';
echo '</html>';
}

die();
Expand All @@ -374,12 +374,12 @@ public static function redirect( $url, $mode = "PHP" )
/**
* Utility function, return the current url. TRUE to get $_SERVER['REQUEST_URI'], FALSE for $_SERVER['PHP_SELF']
*/
public static function getCurrentUrl( $request_uri = true )
public static function getCurrentUrl( $request_uri = true )
{
if (php_sapi_name() == 'cli') {
return '';
}

if(
isset( $_SERVER['HTTPS'] ) && ( $_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1 )
|| isset( $_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'
Expand Down
26 changes: 13 additions & 13 deletions hybridauth/Hybrid/Error.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
/**
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
* (c) 2009-2014, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
* (c) 2009-2015, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/

/**
* Errors manager
*
* HybridAuth errors are stored in Hybrid::storage() and not displayed directly to the end user
*
* HybridAuth errors are stored in Hybrid::storage() and not displayed directly to the end user
*/
class Hybrid_Error
{
Expand All @@ -35,7 +35,7 @@ public static function setError( $message, $code = NULL, $trace = NULL, $previou
* Clear the last error
*/
public static function clearError()
{
{
Hybrid_Logger::info( "Enter Hybrid_Error::clearError()" );

Hybrid_Auth::storage()->delete( "hauth_session.error.status" );
Expand All @@ -46,44 +46,44 @@ public static function clearError()
}

/**
* Checks to see if there is a an error.
*
* Checks to see if there is a an error.
*
* @return boolean True if there is an error.
*/
public static function hasError()
{
{
return (bool) Hybrid_Auth::storage()->get( "hauth_session.error.status" );
}

/**
* return error message
* return error message
*/
public static function getErrorMessage()
{
{
return Hybrid_Auth::storage()->get( "hauth_session.error.message" );
}

/**
* return error code
* return error code
*/
public static function getErrorCode()
{
{
return Hybrid_Auth::storage()->get( "hauth_session.error.code" );
}

/**
* return string detailed error backtrace as string.
*/
public static function getErrorTrace()
{
{
return Hybrid_Auth::storage()->get( "hauth_session.error.trace" );
}

/**
* @return string detailed error backtrace as string.
*/
public static function getErrorPrevious()
{
{
return Hybrid_Auth::storage()->get( "hauth_session.error.previous" );
}
}
4 changes: 2 additions & 2 deletions hybridauth/Hybrid/Exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
/*!
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
* (c) 2009-2015, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/

/**
* Exception implementation
*
*
* The base Exception is extended to allow applications to handle exceptions from hybrid auth
* separately from general exceptions.
*/
Expand Down
Loading

0 comments on commit 425eda3

Please sign in to comment.