diff --git a/README.md b/README.md deleted file mode 100644 index 88f2cfb..0000000 --- a/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# admin -Admin and user rights management diff --git a/account/index.php b/account/index.php index ca2eb92..1085283 100644 --- a/account/index.php +++ b/account/index.php @@ -33,11 +33,11 @@ // Request method: GET $ajax = checkRequestMode("get"); - // User must be logged in if (!isUserLoggedIn()){ addAlert("danger", lang("LOGIN_REQUIRED")); apiReturnError($ajax, SITE_ROOT . "login.php"); + } setReferralPage(getAbsoluteDocumentPath(__FILE__)); @@ -47,5 +47,4 @@ header( "Location: $home_page" ) ; exit(); - ?> \ No newline at end of file diff --git a/account/logout.php b/account/logout.php index 5c3373b..140d2a1 100644 --- a/account/logout.php +++ b/account/logout.php @@ -28,11 +28,13 @@ THE SOFTWARE. */ - require_once("../models/config.php"); +require_once("../hybridauth/Hybrid/Auth.php"); // Request method: GET $ajax = checkRequestMode("get"); +$config = '../hybridauth/config.php'; + if (!securePage(__FILE__)){ apiReturnError($ajax); @@ -43,6 +45,11 @@ //Log the user out if(isUserLoggedIn()) { + // initialize Hybrid_Auth class with the config file + $hybridauth = new Hybrid_Auth($config); + //Make HybridAuth forget that the user logged in with a provider + $hybridauth->logoutAllProviders(); + //log out the user from our site $loggedInUser->userLogOut(); } diff --git a/hybridauth/hybridauth/Hybrid/index.html b/api/index.html similarity index 100% rename from hybridauth/hybridauth/Hybrid/index.html rename to api/index.html diff --git a/api/process_login.php b/api/process_login.php index 8f8b02d..d736e83 100644 --- a/api/process_login.php +++ b/api/process_login.php @@ -33,7 +33,7 @@ set_error_handler('logAllErrors'); -// Publically accessible API +// Publicly accessible API // Request method: POST $ajax = checkRequestMode("post"); diff --git a/api/update_plugin_settings.php b/api/update_plugin_settings.php index e25979a..52bae7e 100644 --- a/api/update_plugin_settings.php +++ b/api/update_plugin_settings.php @@ -37,7 +37,7 @@ // Check to see if this should be a binary or string value, update accordingly if ($results = checkBinaryConfig($name)){ - // Assume binary data type, hack to simply change to new value rather then using value + // Assume binary data type, hack to simply change to new value rather than using value if ($results[1] == 1){ if (updateSitePluginSettings($name, 0)){ $successes[] = lang("CONFIG_UPDATE_SUCCESSFUL"); diff --git a/api/user_resend_activation.php b/api/user_resend_activation.php index 7d453e6..b5cb484 100644 --- a/api/user_resend_activation.php +++ b/api/user_resend_activation.php @@ -84,7 +84,7 @@ { $userdetails = fetchUserAuthByUserName($username); - //See if the user's account is activation + //See if the user's account is active if($userdetails["active"]==1) { $errors[] = lang("ACCOUNT_ALREADY_ACTIVE"); diff --git a/hybridauth/hybridauth/Hybrid/resources/index.html b/css/index.html similarity index 100% rename from hybridauth/hybridauth/Hybrid/resources/index.html rename to css/index.html diff --git a/hybridauth/hybridauth/Hybrid/thirdparty/index.html b/forms/index.html similarity index 100% rename from hybridauth/hybridauth/Hybrid/thirdparty/index.html rename to forms/index.html diff --git a/hybridauth/hybridauth/Hybrid/Auth.php b/hybridauth/Hybrid/Auth.php similarity index 97% rename from hybridauth/hybridauth/Hybrid/Auth.php rename to hybridauth/Hybrid/Auth.php index 43bdf11..c54d6cc 100644 --- a/hybridauth/hybridauth/Hybrid/Auth.php +++ b/hybridauth/Hybrid/Auth.php @@ -10,11 +10,11 @@ * * Hybrid_Auth class provide a simple way to authenticate users via OpenID and OAuth. * - * Generally, Hybrid_Auth is the only class you should instansiate and use throughout your application. + * Generally, Hybrid_Auth is the only class you should instanciate and use throughout your application. */ class Hybrid_Auth { - public static $version = "2.4.0"; + public static $version = "2.4.1"; public static $config = array(); @@ -380,15 +380,18 @@ public static function getCurrentUrl( $request_uri = true ) return ''; } + $protocol = 'http://'; + if( - isset( $_SERVER['HTTPS'] ) && ( $_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1 ) - || isset( $_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' + ( + isset( $_SERVER['HTTPS'] ) && ( $_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1 ) + ) || + ( + isset( $_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' + ) ){ $protocol = 'https://'; } - else { - $protocol = 'http://'; - } $url = $protocol . $_SERVER['HTTP_HOST']; diff --git a/hybridauth/hybridauth/Hybrid/Endpoint.php b/hybridauth/Hybrid/Endpoint.php similarity index 99% rename from hybridauth/hybridauth/Hybrid/Endpoint.php rename to hybridauth/Hybrid/Endpoint.php index aa348c3..67ee681 100644 --- a/hybridauth/hybridauth/Hybrid/Endpoint.php +++ b/hybridauth/Hybrid/Endpoint.php @@ -201,7 +201,7 @@ protected function authInit() // Init Hybrid_Auth try { - if(!class_exists("Hybrid_Storage")){ + if(!class_exists("Hybrid_Storage", false)){ require_once realpath( dirname( __FILE__ ) ) . "/Storage.php"; } diff --git a/hybridauth/hybridauth/Hybrid/Error.php b/hybridauth/Hybrid/Error.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Error.php rename to hybridauth/Hybrid/Error.php diff --git a/hybridauth/hybridauth/Hybrid/Exception.php b/hybridauth/Hybrid/Exception.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Exception.php rename to hybridauth/Hybrid/Exception.php diff --git a/hybridauth/hybridauth/Hybrid/Logger.php b/hybridauth/Hybrid/Logger.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Logger.php rename to hybridauth/Hybrid/Logger.php diff --git a/hybridauth/hybridauth/Hybrid/Provider_Adapter.php b/hybridauth/Hybrid/Provider_Adapter.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Provider_Adapter.php rename to hybridauth/Hybrid/Provider_Adapter.php diff --git a/hybridauth/hybridauth/Hybrid/Provider_Model.php b/hybridauth/Hybrid/Provider_Model.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Provider_Model.php rename to hybridauth/Hybrid/Provider_Model.php diff --git a/hybridauth/hybridauth/Hybrid/Provider_Model_OAuth1.php b/hybridauth/Hybrid/Provider_Model_OAuth1.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Provider_Model_OAuth1.php rename to hybridauth/Hybrid/Provider_Model_OAuth1.php diff --git a/hybridauth/hybridauth/Hybrid/Provider_Model_OAuth2.php b/hybridauth/Hybrid/Provider_Model_OAuth2.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Provider_Model_OAuth2.php rename to hybridauth/Hybrid/Provider_Model_OAuth2.php diff --git a/hybridauth/hybridauth/Hybrid/Provider_Model_OpenID.php b/hybridauth/Hybrid/Provider_Model_OpenID.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Provider_Model_OpenID.php rename to hybridauth/Hybrid/Provider_Model_OpenID.php diff --git a/hybridauth/hybridauth/Hybrid/Providers/AOL.php b/hybridauth/Hybrid/Providers/AOL.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Providers/AOL.php rename to hybridauth/Hybrid/Providers/AOL.php diff --git a/hybridauth/hybridauth/Hybrid/Providers/Facebook.php b/hybridauth/Hybrid/Providers/Facebook.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Providers/Facebook.php rename to hybridauth/Hybrid/Providers/Facebook.php diff --git a/hybridauth/hybridauth/Hybrid/Providers/Foursquare.php b/hybridauth/Hybrid/Providers/Foursquare.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Providers/Foursquare.php rename to hybridauth/Hybrid/Providers/Foursquare.php diff --git a/hybridauth/hybridauth/Hybrid/Providers/Google.php b/hybridauth/Hybrid/Providers/Google.php similarity index 95% rename from hybridauth/hybridauth/Hybrid/Providers/Google.php rename to hybridauth/Hybrid/Providers/Google.php index 7269492..0522ea6 100644 --- a/hybridauth/hybridauth/Hybrid/Providers/Google.php +++ b/hybridauth/Hybrid/Providers/Google.php @@ -31,7 +31,7 @@ function initialize() $this->api->token_info_url = "https://www.googleapis.com/oauth2/v2/tokeninfo"; // Google POST methods require an access_token in the header - $this->api->curl_header = array("Authorization: OAuth " . $this->access_token); + $this->api->curl_header = array("Authorization: OAuth " . $this->api->access_token); // Override the redirect uri when it's set in the config parameters. This way we prevent // redirect uri mismatches when authenticating with Google. @@ -112,16 +112,18 @@ function getUserProfile() } } } - if (count($verified->emails) == 1) { - $this->user->profile->emailVerified = $verified->emails[0]->value; - } else { - foreach ($verified->emails as $email) { - if ($email->type == 'account') { - $this->user->profile->emailVerified = $email->value; - break; - } - } - } + if (property_exists($verified, 'emails')) { + if (count($verified->emails) == 1) { + $this->user->profile->emailVerified = $verified->emails[0]->value; + } else { + foreach ($verified->emails as $email) { + if ($email->type == 'account') { + $this->user->profile->emailVerified = $email->value; + break; + } + } + } + } } $this->user->profile->phone = (property_exists($response,'phone'))?$response->phone:""; $this->user->profile->country = (property_exists($response,'country'))?$response->country:""; diff --git a/hybridauth/hybridauth/Hybrid/Providers/LinkedIn.php b/hybridauth/Hybrid/Providers/LinkedIn.php similarity index 99% rename from hybridauth/hybridauth/Hybrid/Providers/LinkedIn.php rename to hybridauth/Hybrid/Providers/LinkedIn.php index 466e7f5..b5ebb28 100644 --- a/hybridauth/hybridauth/Hybrid/Providers/LinkedIn.php +++ b/hybridauth/Hybrid/Providers/LinkedIn.php @@ -22,7 +22,7 @@ function initialize() if ( ! $this->config["keys"]["key"] || ! $this->config["keys"]["secret"] ){ throw new Exception( "Your application key and secret are required in order to connect to {$this->providerId}.", 4 ); } - if ( ! class_exists('OAuthConsumer') ) { + if ( ! class_exists('OAuthConsumer', false) ) { require_once Hybrid_Auth::$config["path_libraries"] . "OAuth/OAuth.php"; } require_once Hybrid_Auth::$config["path_libraries"] . "LinkedIn/LinkedIn.php"; diff --git a/hybridauth/hybridauth/Hybrid/Providers/Live.php b/hybridauth/Hybrid/Providers/Live.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Providers/Live.php rename to hybridauth/Hybrid/Providers/Live.php diff --git a/hybridauth/hybridauth/Hybrid/Providers/OpenID.php b/hybridauth/Hybrid/Providers/OpenID.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Providers/OpenID.php rename to hybridauth/Hybrid/Providers/OpenID.php diff --git a/hybridauth/hybridauth/Hybrid/Providers/Twitter.php b/hybridauth/Hybrid/Providers/Twitter.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Providers/Twitter.php rename to hybridauth/Hybrid/Providers/Twitter.php diff --git a/hybridauth/hybridauth/Hybrid/Providers/Vkontakte.php b/hybridauth/Hybrid/Providers/Vkontakte.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Providers/Vkontakte.php rename to hybridauth/Hybrid/Providers/Vkontakte.php diff --git a/hybridauth/hybridauth/Hybrid/Providers/Yahoo.php b/hybridauth/Hybrid/Providers/Yahoo.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Providers/Yahoo.php rename to hybridauth/Hybrid/Providers/Yahoo.php diff --git a/hybridauth/hybridauth/Hybrid/Storage.php b/hybridauth/Hybrid/Storage.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/Storage.php rename to hybridauth/Hybrid/Storage.php diff --git a/hybridauth/hybridauth/Hybrid/StorageInterface.php b/hybridauth/Hybrid/StorageInterface.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/StorageInterface.php rename to hybridauth/Hybrid/StorageInterface.php diff --git a/hybridauth/hybridauth/Hybrid/User.php b/hybridauth/Hybrid/User.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/User.php rename to hybridauth/Hybrid/User.php diff --git a/hybridauth/hybridauth/Hybrid/User_Activity.php b/hybridauth/Hybrid/User_Activity.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/User_Activity.php rename to hybridauth/Hybrid/User_Activity.php diff --git a/hybridauth/hybridauth/Hybrid/User_Contact.php b/hybridauth/Hybrid/User_Contact.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/User_Contact.php rename to hybridauth/Hybrid/User_Contact.php diff --git a/hybridauth/hybridauth/Hybrid/User_Profile.php b/hybridauth/Hybrid/User_Profile.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/User_Profile.php rename to hybridauth/Hybrid/User_Profile.php diff --git a/hybridauth/Hybrid/index.html b/hybridauth/Hybrid/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/hybridauth/Hybrid/index.html @@ -0,0 +1,10 @@ + +
+Directory access is forbidden.
+ + + \ No newline at end of file diff --git a/hybridauth/Hybrid/resources/index.html b/hybridauth/Hybrid/resources/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/hybridauth/Hybrid/resources/index.html @@ -0,0 +1,10 @@ + + +Directory access is forbidden.
+ + + \ No newline at end of file diff --git a/hybridauth/hybridauth/Hybrid/resources/openid_policy.html b/hybridauth/Hybrid/resources/openid_policy.html similarity index 100% rename from hybridauth/hybridauth/Hybrid/resources/openid_policy.html rename to hybridauth/Hybrid/resources/openid_policy.html diff --git a/hybridauth/hybridauth/Hybrid/resources/openid_realm.html b/hybridauth/Hybrid/resources/openid_realm.html similarity index 100% rename from hybridauth/hybridauth/Hybrid/resources/openid_realm.html rename to hybridauth/Hybrid/resources/openid_realm.html diff --git a/hybridauth/hybridauth/Hybrid/resources/openid_xrds.xml b/hybridauth/Hybrid/resources/openid_xrds.xml similarity index 100% rename from hybridauth/hybridauth/Hybrid/resources/openid_xrds.xml rename to hybridauth/Hybrid/resources/openid_xrds.xml diff --git a/hybridauth/hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php b/hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php similarity index 99% rename from hybridauth/hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php rename to hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php index b9d403e..9991334 100644 --- a/hybridauth/hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php +++ b/hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php @@ -170,6 +170,13 @@ abstract class BaseFacebook 'www' => 'https://www.facebook.com/', ); + /** + * The decoded response object. + * + * @var mixed + */ + protected $response; + /** * The Application ID. * @@ -451,6 +458,16 @@ public function getAccessToken() { return $this->accessToken; } + /** + * Return the response object afer the fact + * + * @return mixed + */ + public function getResponse() + { + return $this->response; + } + /** * Determines and returns the user access token, first using * the signed request if present, and then falling back on @@ -913,7 +930,7 @@ protected function _graph($path, $method = 'GET', $params = array()) { } // @codeCoverageIgnoreEnd - return $result; + return $this->response = $result; } /** diff --git a/hybridauth/hybridauth/Hybrid/thirdparty/Facebook/facebook.php b/hybridauth/Hybrid/thirdparty/Facebook/facebook.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/thirdparty/Facebook/facebook.php rename to hybridauth/Hybrid/thirdparty/Facebook/facebook.php diff --git a/hybridauth/hybridauth/Hybrid/thirdparty/Facebook/fb_ca_chain_bundle.crt b/hybridauth/Hybrid/thirdparty/Facebook/fb_ca_chain_bundle.crt similarity index 100% rename from hybridauth/hybridauth/Hybrid/thirdparty/Facebook/fb_ca_chain_bundle.crt rename to hybridauth/Hybrid/thirdparty/Facebook/fb_ca_chain_bundle.crt diff --git a/hybridauth/hybridauth/Hybrid/thirdparty/LinkedIn/LinkedIn.php b/hybridauth/Hybrid/thirdparty/LinkedIn/LinkedIn.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/thirdparty/LinkedIn/LinkedIn.php rename to hybridauth/Hybrid/thirdparty/LinkedIn/LinkedIn.php diff --git a/hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth.php b/hybridauth/Hybrid/thirdparty/OAuth/OAuth.php similarity index 99% rename from hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth.php rename to hybridauth/Hybrid/thirdparty/OAuth/OAuth.php index 1077d02..7261fa2 100644 --- a/hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth.php +++ b/hybridauth/Hybrid/thirdparty/OAuth/OAuth.php @@ -6,7 +6,7 @@ /* Generic exception class */ -if (!class_exists('OAuthException')) { +if (!class_exists('OAuthException', false)) { class OAuthException extends Exception { // pass } diff --git a/hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth1Client.php b/hybridauth/Hybrid/thirdparty/OAuth/OAuth1Client.php similarity index 89% rename from hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth1Client.php rename to hybridauth/Hybrid/thirdparty/OAuth/OAuth1Client.php index 2f2894c..66304b6 100644 --- a/hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth1Client.php +++ b/hybridauth/Hybrid/thirdparty/OAuth/OAuth1Client.php @@ -2,7 +2,7 @@ /** * HybridAuth * http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth -* (c) 2009-2014, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html +* (c) 2009-2014, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html */ // A service client for the OAuth 1/1.0a flow. @@ -13,7 +13,7 @@ class OAuth1Client{ public $authenticate_url = ""; public $request_token_url = ""; public $access_token_url = ""; - + public $request_token_method = "GET"; public $access_token_method = "GET"; @@ -31,10 +31,11 @@ class OAuth1Client{ public $http_code = ""; public $http_info = ""; + protected $response = null; - /** + /** * OAuth client constructor - */ + */ function __construct( $consumer_key, $consumer_secret, $oauth_token = null, $oauth_token_secret = null ) { $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1(); @@ -43,14 +44,14 @@ function __construct( $consumer_key, $consumer_secret, $oauth_token = null, $oau if ( $oauth_token && $oauth_token_secret ){ $this->token = new OAuthConsumer( $oauth_token, $oauth_token_secret ); - } + } } - /** + /** * Build authorize url - * - * @return string - */ + * + * @return string + */ function authorizeUrl( $token, $extras =array() ) { if ( is_array( $token ) ){ @@ -68,28 +69,28 @@ function authorizeUrl( $token, $extras =array() ) /** * Get a request_token from provider - * - * @return array a key/value array containing oauth_token and oauth_token_secret + * + * @return array a key/value array containing oauth_token and oauth_token_secret */ function requestToken( $callback = null ) { - $parameters = array(); + $parameters = array(); if ( $callback ) { - $this->redirect_uri = $parameters['oauth_callback'] = $callback; + $this->redirect_uri = $parameters['oauth_callback'] = $callback; } - $request = $this->signedRequest( $this->request_token_url, $this->request_token_method, $parameters ); + $request = $this->signedRequest( $this->request_token_url, $this->request_token_method, $parameters ); $token = OAuthUtil::parse_parameters( $request ); - $this->token = new OAuthConsumer( $token['oauth_token'], $token['oauth_token_secret'] ); + $this->token = new OAuthConsumer( $token['oauth_token'], $token['oauth_token_secret'] ); - return $token; - } + return $token; + } - /** - * Exchange the request token and secret for an access token and secret, to sign API calls. - * - * @return array array('oauth_token' => the access token, 'oauth_token_secret' => the access secret) + /** + * Exchange the request token and secret for an access token and secret, to sign API calls. + * + * @return array array('oauth_token' => the access token, 'oauth_token_secret' => the access secret) */ function accessToken( $oauth_verifier = false, $oauth_token = false ) { @@ -97,25 +98,25 @@ function accessToken( $oauth_verifier = false, $oauth_token = false ) // 1.0a if ( $oauth_verifier ) { - $parameters['oauth_verifier'] = $oauth_verifier; + $parameters['oauth_verifier'] = $oauth_verifier; } - $request = $this->signedRequest( $this->access_token_url, $this->access_token_method, $parameters ); - $token = OAuthUtil::parse_parameters( $request ); - $this->token = new OAuthConsumer( $token['oauth_token'], $token['oauth_token_secret'] ); + $request = $this->signedRequest( $this->access_token_url, $this->access_token_method, $parameters ); + $token = OAuthUtil::parse_parameters( $request ); + $this->token = new OAuthConsumer( $token['oauth_token'], $token['oauth_token_secret'] ); return $token; } - /** + /** * GET wrapper for provider apis request */ function get($url, $parameters = array(), $content_type = NULL) { return $this->api($url, 'GET', $parameters, NULL, $content_type); - } + } - /** + /** * POST wrapper for provider apis request */ function post($url, $parameters = array(), $body = NULL, $content_type = NULL, $multipart = false) @@ -123,9 +124,9 @@ function post($url, $parameters = array(), $body = NULL, $content_type = NULL, $ return $this->api($url, 'POST', $parameters, $body, $content_type, $multipart ); } - /** - * Format and sign an oauth for provider api - */ + /** + * Format and sign an oauth for provider api + */ function api( $url, $method = 'GET', $parameters = array(), $body = NULL, $content_type = NULL, $multipart = false ) { if ( strrpos($url, 'http://') !== 0 && strrpos($url, 'https://') !== 0 ) { @@ -138,12 +139,22 @@ function api( $url, $method = 'GET', $parameters = array(), $body = NULL, $conte $response = json_decode( $response ); } - return $response; - } + return $this->response = $response; + } - /** - * Make signed request - */ + /** + * Return the response object afer the fact + * + * @return mixed + */ + public function getResponse() + { + return $this->response; + } + + /** + * Make signed request + */ function signedRequest( $url, $method, $parameters, $body = NULL, $content_type = NULL, $multipart = false ) { @@ -167,14 +178,14 @@ function signedRequest( $url, $method, $parameters, $body = NULL, $content_type return $this->request( $request->get_normalized_http_url(), $method, ($multipart ? $parameters : $request->to_postdata()), $request->to_header(), $content_type, $multipart ) ; } } - - /** - * Make http request - */ + + /** + * Make http request + */ function request( $url, $method, $postfields = NULL, $auth_header = NULL, $content_type = NULL, $multipart = false ) { Hybrid_Logger::info( "Enter OAuth1Client::request( $method, $url )" ); - Hybrid_Logger::debug( "OAuth1Client::request(). dump post fields: ", serialize( $postfields ) ); + Hybrid_Logger::debug( "OAuth1Client::request(). dump post fields: ", serialize( $postfields ) ); $this->http_info = array(); $ci = curl_init(); @@ -194,11 +205,11 @@ function request( $url, $method, $postfields = NULL, $auth_header = NULL, $conte }elseif ($content_type) curl_setopt( $ci, CURLOPT_HTTPHEADER, array('Expect:', "Content-Type: $content_type") ); - + if($this->curl_proxy){ curl_setopt( $ci, CURLOPT_PROXY , $this->curl_proxy); } - + switch ($method){ case 'POST': curl_setopt( $ci, CURLOPT_POST, TRUE ); @@ -233,7 +244,7 @@ function request( $url, $method, $postfields = NULL, $auth_header = NULL, $conte curl_close ($ci); - return $response; + return $response; } /** @@ -249,5 +260,5 @@ function getHeader($ch, $header) { } return strlen($header); - } -} + } +} diff --git a/hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth2Client.php b/hybridauth/Hybrid/thirdparty/OAuth/OAuth2Client.php similarity index 94% rename from hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth2Client.php rename to hybridauth/Hybrid/thirdparty/OAuth/OAuth2Client.php index ebc3ace..e41967d 100644 --- a/hybridauth/hybridauth/Hybrid/thirdparty/OAuth/OAuth2Client.php +++ b/hybridauth/Hybrid/thirdparty/OAuth/OAuth2Client.php @@ -6,7 +6,7 @@ */ // A service client for the OAuth 2 flow. -// v0.1 +// v0.1.1 class OAuth2Client { public $api_base_url = ""; @@ -32,14 +32,15 @@ class OAuth2Client public $curl_ssl_verifypeer = false; public $curl_ssl_verifyhost = false; public $curl_header = array(); - public $curl_useragent = "OAuth/2 Simple PHP Client v0.1; HybridAuth http://hybridauth.sourceforge.net/"; + public $curl_useragent = "OAuth/2 Simple PHP Client v0.1.1; HybridAuth http://hybridauth.sourceforge.net/"; public $curl_authenticate_method = "POST"; - public $curl_proxy = null; + public $curl_proxy = null; //-- public $http_code = ""; public $http_info = ""; + protected $response = null; //-- @@ -140,10 +141,20 @@ public function api( $url, $method = "GET", $parameters = array() ) } if( $response && $this->decode_json ){ - $response = json_decode( $response ); + return $this->response = json_decode( $response ); } - return $response; + return $this->response = $response; + } + + /** + * Return the response object afer the fact + * + * @return mixed + */ + public function getResponse() + { + return $this->response; } /** diff --git a/hybridauth/hybridauth/Hybrid/thirdparty/OpenID/LightOpenID.php b/hybridauth/Hybrid/thirdparty/OpenID/LightOpenID.php similarity index 100% rename from hybridauth/hybridauth/Hybrid/thirdparty/OpenID/LightOpenID.php rename to hybridauth/Hybrid/thirdparty/OpenID/LightOpenID.php diff --git a/hybridauth/Hybrid/thirdparty/index.html b/hybridauth/Hybrid/thirdparty/index.html new file mode 100644 index 0000000..c942a79 --- /dev/null +++ b/hybridauth/Hybrid/thirdparty/index.html @@ -0,0 +1,10 @@ + + +Directory access is forbidden.
+ + + \ No newline at end of file diff --git a/hybridauth/hybridauth/config.php b/hybridauth/config.php similarity index 96% rename from hybridauth/hybridauth/config.php rename to hybridauth/config.php index 23c1a2a..06b2469 100644 --- a/hybridauth/hybridauth/config.php +++ b/hybridauth/config.php @@ -37,7 +37,7 @@ "LinkedIn" => array ( "enabled" => true, - "keys" => array ( "key" => "", "secret" => "" ) + "keys" => array ( "key" => '", "secret" => "" ) ), "Vkontakte" => array ( diff --git a/hybridauth/hybridauth/index.php b/hybridauth/index.php similarity index 81% rename from hybridauth/hybridauth/index.php rename to hybridauth/index.php index 818f6fb..09faaa8 100644 --- a/hybridauth/hybridauth/index.php +++ b/hybridauth/index.php @@ -12,8 +12,4 @@ require_once( "Hybrid/Auth.php" ); require_once( "Hybrid/Endpoint.php" ); -if (isset($_REQUEST['hauth_start'])) -{ - Hybrid_Endpoint::process(); -} -//Hybrid_Endpoint::process(); +Hybrid_Endpoint::process(); diff --git a/install/complete.php b/install/complete.php new file mode 100644 index 0000000..20a12b2 --- /dev/null +++ b/install/complete.php @@ -0,0 +1,111 @@ + + + + + + + + + + + +Please delete the installation folder. You will then be able to log in via login.php.
+ +Upgrade Script
-A secure, modern user management system based on UserCake, jQuery, and Bootstrap.
+models/db-settings.php and enter your database connection details (host, database name, username, password). When this is complete, click the button below.