Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

update to version 1.2.3

from wp svn
  • Loading branch information...
commit a735d5eae017284fa1dafa98f461f02161ac7c4f 1 parent 4343bc6
hybridauth authored
Showing with 5,644 additions and 577 deletions.
  1. BIN  assets/img/16x16/instagram.png
  2. BIN  assets/img/16x16/mailru.png
  3. BIN  assets/img/16x16/odnoklassniki.png
  4. BIN  assets/img/16x16/yandex.png
  5. BIN  assets/img/32x32/icondock/instagram.png
  6. BIN  assets/img/32x32/icondock/mailru.png
  7. BIN  assets/img/32x32/icondock/odnoklassniki.png
  8. BIN  assets/img/32x32/icondock/yandex.png
  9. BIN  assets/img/32x32/wpzoom/instagram.png
  10. BIN  assets/img/32x32/wpzoom/mailru.png
  11. BIN  assets/img/32x32/wpzoom/odnoklassniki.png
  12. BIN  assets/img/32x32/wpzoom/yandex.png
  13. +96 −21 authenticate.php
  14. +46 −13 diagnostics.php
  15. +4 −10 hybridauth/Hybrid/Auth.php
  16. +5 −5 hybridauth/Hybrid/Endpoint.php
  17. +1 −1  hybridauth/Hybrid/Error.php
  18. +2 −2 hybridauth/Hybrid/Logger.php
  19. +2 −2 hybridauth/Hybrid/Provider_Adapter.php
  20. +10 −5 hybridauth/Hybrid/Provider_Model_OAuth1.php
  21. +7 −2 hybridauth/Hybrid/Provider_Model_OAuth2.php
  22. +7 −4 hybridauth/Hybrid/Provider_Model_OpenID.php
  23. +18 −19 hybridauth/Hybrid/Providers/Facebook.php
  24. +2 −2 hybridauth/Hybrid/Providers/Foursquare.php
  25. +17 −3 hybridauth/Hybrid/Providers/Google.php
  26. +48 −0 hybridauth/Hybrid/Providers/Instagram.php
  27. +60 −52 hybridauth/Hybrid/Providers/LinkedIn.php
  28. +3 −3 hybridauth/Hybrid/Providers/Live.php
  29. +63 −0 hybridauth/Hybrid/Providers/Mailru.php
  30. +4 −4 hybridauth/Hybrid/Providers/MySpace.php
  31. +174 −0 hybridauth/Hybrid/Providers/Odnoklassniki.php
  32. +1 −1  hybridauth/Hybrid/Providers/Steam.php
  33. +222 −17 hybridauth/Hybrid/Providers/Yahoo.php
  34. +61 −0 hybridauth/Hybrid/Providers/Yandex.php
  35. +2 −2 hybridauth/Hybrid/Storage.php
  36. +205 −85 hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php
  37. +71 −4 hybridauth/Hybrid/thirdparty/Facebook/facebook.php
  38. +3,918 −119 hybridauth/Hybrid/thirdparty/Facebook/fb_ca_chain_bundle.crt
  39. +3 −3 hybridauth/Hybrid/thirdparty/LinkedIn/LinkedIn.php
  40. +14 −13 hybridauth/Hybrid/thirdparty/OAuth/OAuth.php
  41. +6 −1 hybridauth/Hybrid/thirdparty/OAuth/OAuth1Client.php
  42. +9 −1 hybridauth/Hybrid/thirdparty/OAuth/OAuth2Client.php
  43. +43 −3 hybridauth/Hybrid/thirdparty/OpenID/LightOpenID.php
  44. +7 −4 hybridauth/readme.txt
  45. +34 −15 includes/hybridauth.settings.php
  46. +43 −6 includes/plugin.auth.php
  47. +2 −2 includes/plugin.fail.php
  48. +11 −0 includes/plugin.init.php
  49. +2 −4 includes/plugin.settings.php
  50. +3 −4 includes/plugin.settings/plugin.settings.0.php
  51. +51 −43 includes/plugin.settings/plugin.settings.1.php
  52. +70 −29 includes/plugin.settings/plugin.settings.2.php
  53. +1 −1  includes/plugin.settings/plugin.settings.3.php
  54. +38 −12 includes/plugin.settings/plugin.settings.4.php
  55. +53 −18 includes/plugin.settings/plugin.settings.5.php
  56. +125 −10 includes/plugin.settings/plugin.settings.6.php
  57. +54 −20 includes/plugin.ui.php
  58. +23 −4 readme.txt
  59. +3 −8 wp-social-login.php
View
BIN  assets/img/16x16/instagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/16x16/mailru.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/16x16/odnoklassniki.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/16x16/yandex.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/32x32/icondock/instagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/32x32/icondock/mailru.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/32x32/icondock/odnoklassniki.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/32x32/icondock/yandex.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/32x32/wpzoom/instagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/32x32/wpzoom/mailru.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/32x32/wpzoom/odnoklassniki.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  assets/img/32x32/wpzoom/yandex.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
117 authenticate.php
@@ -1,5 +1,5 @@
<?php
- session_start();
+ @ session_start();
// let display a loading message. should be better than a white screen
if( isset( $_GET["provider"] ) && ! isset( $_GET["redirect_to_provider"] )){
@@ -8,20 +8,44 @@
$_SESSION["HA::STORE"] = ARRAY();
?>
+<html>
+<head>
+<script>
+function init() {
+ setTimeout( function(){window.location.href = window.location.href + "&redirect_to_provider=true"}, 750 );
+}
+</script>
+<style>
+html {
+ background: #f9f9f9;
+}
+#wsl {
+ background: #fff;
+ color: #333;
+ font-family: sans-serif;
+ margin: 2em auto;
+ padding: 1em 2em;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ border: 1px solid #dfdfdf;
+ max-width: 700px;
+ font-size: 14px;
+}
+</style>
+</head>
+<body onload="init();">
+<div id="wsl">
<table width="100%" border="0">
<tr>
- <td align="center" height="200px" valign="middle"><img src="assets/img/loading.gif" /></td>
- </tr>
- <tr>
- <td align="center"><br /><h3>Loading...</h3><br /></td>
- </tr>
+ <td align="center" height="40px"><br /><br />Contacting <b><?php echo ucfirst( $provider ) ; ?></b>, please wait...</td>
+ </tr>
<tr>
- <td align="center">Contacting <b><?php echo ucfirst( $provider ) ; ?></b>, please wait...</td>
+ <td align="center" height="80px" valign="middle"><img src="assets/img/loading.gif" /></td>
</tr>
-</table>
-<script>
- setTimeout( function(){window.location.href = window.location.href + "&redirect_to_provider=true"}, 750 );
-</script>
+</table>
+</div>
+</body>
+</html>
<?php
die();
} // end display loading
@@ -67,6 +91,7 @@
// if facebook
if( strtolower( $provider ) == "facebook" ){
+ $config["providers"][$provider]["scope"] = "email, user_about_me, user_birthday, user_hometown, user_website";
$config["providers"][$provider]["display"] = "popup";
}
@@ -80,6 +105,8 @@
if( get_option( 'wsl_settings_development_mode_enabled' ) ){
$profile = $adapter->getUserProfile( $provider );
}
+
+ if( get_option( 'wsl_settings_use_popup' ) == 1 || ! get_option( 'wsl_settings_use_popup' ) ){
?>
<html>
<head>
@@ -98,6 +125,36 @@ function init() {
</body>
</html>
<?php
+ }
+ elseif( get_option( 'wsl_settings_use_popup' ) == 2 ){
+ $redirect_to = site_url();
+
+ if( isset( $_REQUEST[ 'redirect_to' ] ) ){
+ $redirect_to = urldecode( $_REQUEST[ 'redirect_to' ] );
+ }
+
+ if ( strpos( $redirect_to, 'wp-login') ){
+ $redirect_to = site_url();
+ }
+?>
+<html>
+<head>
+<script>
+function init() {
+ document.loginform.submit();
+}
+</script>
+</head>
+<body onload="init();">
+<form name="loginform" method="post" action="<?php echo site_url( 'wp-login.php', 'login_post' ); ?>">
+ <input type="hidden" id="redirect_to" name="redirect_to" value="<?php echo $redirect_to ?>">
+ <input type="hidden" id="provider" name="provider" value="<?php echo $provider ?>">
+ <input type="hidden" id="action" name="action" value="wordpress_social_login">
+</form>
+</body>
+</html>
+<?php
+ }
}
catch( Exception $e ){
$message = "Unspecified error!";
@@ -126,15 +183,37 @@ function init() {
padding: 50px;
}
</style>
+<style>
+html {
+ background: #f9f9f9;
+}
+#wsl {
+ background: #fff;
+ color: #333;
+ font-family: sans-serif;
+ margin: 2em auto;
+ padding: 1em 2em;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ border: 1px solid #dfdfdf;
+ max-width: 700px;
+ font-size: 14px;
+}
+</style>
+<div id="wsl">
<table width="100%" border="0">
<tr>
- <td align="center"><br /><br /><img src="assets/img/alert.png" /></td>
+ <td align="center"><br /><img src="assets/img/alert.png" /></td>
</tr>
<tr>
- <td align="center"><br /><br /><h3>Something bad happen!</h3><br /></td>
+ <td align="center"><br /><h4>Something bad happen!</h4><br /></td>
</tr>
<tr>
- <td align="center">&nbsp;<?php echo $message ; ?></td>
+ <td align="center">
+ <p style="line-height: 1;padding: 8px;background-color: #FFEBE8;border:1px solid #CC0000;border-radius: 3px;padding: 10px;text-align:center;">
+ <?php echo $message ; ?>
+ </p>
+ </td>
</tr>
<?php
@@ -145,7 +224,7 @@ function init() {
<td align="center">
<div style="padding: 5px;margin: 5px;background: none repeat scroll 0 0 #F5F5F5;border-radius:3px;">
<div id="bug_report">
- <form method="post" action="http://hybridauth.sourceforge.net/reports/index.php?product=wp-plugin&v=1.1.7">
+ <form method="post" action="http://hybridauth.sourceforge.net/reports/index.php?product=wp-plugin&v=<?php echo $_SESSION["wsl::plugin"] ?>">
<table width="90%" border="0">
<tr>
<td align="left" valign="top">
@@ -155,12 +234,7 @@ function init() {
<hr />
<h3>HybridAuth</h3>
- <pre style="width:800px;"><?php print_r( array( $config, $hybridauth, $adapter, $profile ) ) ?></pre>
-
- <hr />
-
- <h3>SERVER</h3>
- <pre style="width:800px;"><?php print_r( $_SERVER ) ?></pre>
+ <pre style="width:800px;"><?php print_r( array( $config, $hybridauth, $adapter, $profile ) ) ?></pre>
</td>
</tr>
<tr>
@@ -188,6 +262,7 @@ function init() {
?>
</table>
+</div>
<?php
// diplay error and RIP
die();
View
59 diagnostics.php
@@ -1,5 +1,18 @@
-<?php
-session_start();
+<?php
+ if ( isset( $_REQUEST['xhrurl'] ) ) {
+ $testing = @ $_REQUEST['xhrurl'];
+
+ if ( $testing == "http://www.example.com" ) {
+ echo "<b style='color:green;'>OK!</b><br />The rewrite rules on your server appear to be setup correctly for this plugin to work.";
+ }
+ else{
+ echo sprintf( '<b style="color:red;">FAIL!</b><br />Expected "http://www.example.com", received "%s".', $testing );
+ }
+
+ die();
+ }
+
+ session_start();
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
@@ -8,6 +21,7 @@
<style>
html{background:#f9f9f9;}body{background:#fff;color:#333;font-family:sans-serif;margin:2em auto;width:600px;padding:1em 2em;-moz-border-radius:11px;-khtml-border-radius:11px;-webkit-border-radius:11px;border-radius:11px;border:1px solid #dfdfdf;}a{color:#2583ad;text-decoration:none;}a:hover{color:#d54e21;}h1{border-bottom:1px solid #dadada;clear:both;color:#666;font:24px Georgia,"Times New Roman",Times,serif;margin:5px 0 0 -4px;padding:0;padding-bottom:7px;}h2{font-size:16px;}p,li,dd,dt{padding-bottom:2px;font-size:12px;line-height:18px;}code,.code{font-size:13px;}ul,ol,dl{padding:5px 5px 5px 22px;}a img{border:0;}abbr{border:0;font-variant:normal;}#logo{margin:6px 0 14px 0;border-bottom:none;text-align:center;}.step{margin:20px 0 15px;}.step,th{text-align:left;padding:0;}.submit input,.button,.button-secondary{font-family:sans-serif;text-decoration:none;font-size:14px!important;line-height:16px;padding:6px 12px;cursor:pointer;border:1px solid #bbb;color:#464646;-moz-border-radius:15px;-khtml-border-radius:15px;-webkit-border-radius:15px;border-radius:15px;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-khtml-box-sizing:content-box;box-sizing:content-box;}.button:hover,.button-secondary:hover,.submit input:hover{color:#000;border-color:#666;}.button,.submit input,.button-secondary{background:#f2f2f2 url(../images/white-grad.png) repeat-x scroll left top;}.button:active,.submit input:active,.button-secondary:active{background:#eee url(../images/white-grad-active.png) repeat-x scroll left top;}textarea{border:1px solid #bbb;-moz-border-radius:3px;-khtml-border-radius:3px;-webkit-border-radius:3px;border-radius:3px;}.form-table{border-collapse:collapse;margin-top:1em;width:100%;}.form-table td{margin-bottom:9px;padding:10px;border-bottom:8px solid #fff;font-size:12px;}.form-table th{font-size:13px;text-align:left;padding:16px 10px 10px 10px;border-bottom:8px solid #fff;width:130px;vertical-align:top;}.form-table tr{background:#f3f3f3;}.form-table code{line-height:18px;font-size:18px;}.form-table p{margin:4px 0 0 0;font-size:11px;}.form-table input{line-height:20px;font-size:15px;padding:2px;}.form-table th p{font-weight:normal;}#error-page{margin-top:50px;}#error-page p{font-size:12px;line-height:18px;margin:25px 0 20px;}#error-page code,.code{font-family:Consolas,Monaco,monospace;}#pass-strength-result{background-color:#eee;border-color:#ddd!important;border-style:solid;border-width:1px;margin:5px 5px 5px 1px;padding:5px;text-align:center;width:200px;display:none;}#pass-strength-result.bad{background-color:#ffb78c;border-color:#ff853c!important;}#pass-strength-result.good{background-color:#ffec8b;border-color:#fc0!important;}#pass-strength-result.short{background-color:#ffa0a0;border-color:#f04040!important;}#pass-strength-result.strong{background-color:#c3ff88;border-color:#8dff1c!important;}.message{border:1px solid #e6db55;padding:.3em .6em;margin:5px 0 15px;background-color:#ffffe0;}
</style>
+ <script src="../../../wp-admin/load-scripts.php?c=1&amp;load=jquery"></script>
</head>
<body>
<h1 style="text-align:center;">WordPress Social Login Requirements Test</h1>
@@ -15,18 +29,37 @@
<br />
<h5>1. URL Rewrite</h5>
- <p>
-<?php
- $testing = @ $_REQUEST['url'];
-
- if ( $testing == "http://www.example.com" ) {
- echo "<b style='color:green;'>OK!</b><br />The rewrite rules on your server appear to be setup correctly for this plugin to work.";
- }
- else{
- echo sprintf( '<b style="color:red;">FAIL!</b><br />Expected "http://www.example.com", received "%s".', $testing );
+ <p id="urlrewrite">
+<?php
+ if ( isset( $_REQUEST['url'] ) ) {
+ $testing = @ $_REQUEST['url'];
+
+ if ( $testing == "http://www.example.com" ) {
+ echo "<b style='color:green;'>OK!</b><br />The rewrite rules on your server appear to be setup correctly for this plugin to work.";
+ }
+ else{
+ echo sprintf( '<b style="color:red;">FAIL!</b><br />Expected "http://www.example.com", received "%s".', $testing );
+ }
+ }
+ else{
+ ?>
+ &nbsp;<i style="color:blue">Testing...</i> (If this "testing" seems to take forever to load, use this <a href="diagnostics.php?url=http://www.example.com">direct link</a>.)
+
+ <script>
+ jQuery(document).ready(function($) {
+ $("#urlrewrite").load( "diagnostics.php?xhrurl=http://www.example.com" );
+ });
+ </script>
+ <?php
}
?>
</p>
+ <div style="background-color: #FFFFE0;border:1px solid #E6DB55; border-radius: 3px;padding:5px;font-size: 12px;">
+ <b>What do I do if the Rewrite Diagnostics fail?</b>
+ <p>
+ If you get a 403 and 404 on the Rewrite Diagnostics test, request your hosting provider whitelist your domain on mod_security. This problem has been encountered with Host Gator* and **GoDaddy.
+ </p>
+ </div>
<h5>2. PHP Version</h5>
<p>
@@ -51,7 +84,7 @@
<b style='color:red;'>FAIL!</b><br />PHP Sessions are not working correctly or this page has been accessed directly.
- <div style="background-color: #FFFFE0;border:1px solid #E6DB55; border-radius: 3px;padding: 15px;font-size: 12px;">
+ <div style="background-color: #FFFFE0;border:1px solid #E6DB55; border-radius: 3px;padding:5px;font-size: 12px;">
If you see an error <strong>"Warning: session_start..."</strong>, then
there is a problem with your PHP server that will prevent this plugin from working with PHP sessions. Sometimes PHP session do not work because of a file permissions problem. The solution is to make a trouble ticket with your web host.
@@ -117,7 +150,7 @@
echo "<b style='color:green;'>OK!</b><br />REGISTER_GLOBALS = OFF. [http://php.net/manual/en/security.globals.php]";
}
?>
- </p>
+ </p>
</body>
</html>
View
14 hybridauth/Hybrid/Auth.php
@@ -2,7 +2,7 @@
/*!
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
-* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/
/**
@@ -14,7 +14,7 @@
*/
class Hybrid_Auth
{
- public static $version = "2.1.0-dev";
+ public static $version = "2.1.1-dev";
public static $config = array();
@@ -111,13 +111,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.');
- }
-
- // OAuth PECL extension is not compatible with this library
- if( extension_loaded('oauth') ) {
- Hybrid_Logger::error('Hybridauth Library not compatible with installed PECL OAuth extension. Please disable it.');
- throw new Exception('Hybridauth Library not compatible with installed PECL OAuth extension. Please disable it.');
- }
+ }
// session.name
if( session_name() != "PHPSESSID" ){
@@ -389,7 +383,7 @@ public static function getCurrentUrl( $request_uri = true )
$protocol = 'http://';
}
- $url = $protocol . $_SERVER['SERVER_NAME'];
+ $url = $protocol . $_SERVER['HTTP_HOST'];
// use port if non default
$url .=
View
10 hybridauth/Hybrid/Endpoint.php
@@ -2,7 +2,7 @@
/*!
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
-* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/
/**
@@ -128,10 +128,10 @@ public static function processAuthStart()
# if REQUESTed hauth_idprovider is wrong, session not created, etc.
if( ! $hauth ) {
- Hybrid_Logger::error( "Endpoint: Invalide parameter on hauth_start!" );
+ Hybrid_Logger::error( "Endpoint: Invalid parameter on hauth_start!" );
header( "HTTP/1.0 404 Not Found" );
- die( "Invalide parameter! Please return to the login page and try again." );
+ die( "Invalid parameter! Please return to the login page and try again." );
}
try {
@@ -161,12 +161,12 @@ public static function processAuthDone()
$hauth = Hybrid_Auth::setup( $provider_id );
if( ! $hauth ) {
- Hybrid_Logger::error( "Endpoint: Invalide parameter on hauth_done!" );
+ Hybrid_Logger::error( "Endpoint: Invalid parameter on hauth_done!" );
$hauth->adapter->setUserUnconnected();
header("HTTP/1.0 404 Not Found");
- die( "Invalide parameter! Please return to the login page and try again." );
+ die( "Invalid parameter! Please return to the login page and try again." );
}
try {
View
2  hybridauth/Hybrid/Error.php
@@ -2,7 +2,7 @@
/*!
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
-* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/
/**
View
4 hybridauth/Hybrid/Logger.php
@@ -2,7 +2,7 @@
/*!
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
-* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/
/**
@@ -15,7 +15,7 @@ function __construct()
// if debug mode is set to true, then check for the writable log file
if ( Hybrid_Auth::$config["debug_mode"] ){
if ( ! file_exists( Hybrid_Auth::$config["debug_file"] ) ){
- throw new Exception( "'debug_mode' is set to 'true', but no log file path 'debug_file' given.", 1 );
+ throw new Exception( "'debug_mode' is set to 'true', but the file " . Hybrid_Auth::$config['debug_file'] . " in 'debug_file' does not exit.", 1 );
}
if ( ! is_writable( Hybrid_Auth::$config["debug_file"] ) ){
View
4 hybridauth/Hybrid/Provider_Adapter.php
@@ -2,7 +2,7 @@
/*!
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
-* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/
/**
@@ -90,7 +90,7 @@ function factory( $id, $params = NULL )
// --------------------------------------------------------------------
/**
- * Hybrid_Provider_Adapter::login(), prepare the user session and the authentification request
+ * Hybrid_Provider_Adapter::login(), prepare the user session and the authentication request
* for index.php
*/
function login()
View
15 hybridauth/Hybrid/Provider_Model_OAuth1.php
@@ -82,6 +82,11 @@ function initialize()
else{
$this->api = new OAuth1Client( $this->config["keys"]["key"], $this->config["keys"]["secret"] );
}
+
+ // Set curl proxy if exist
+ if( isset( Hybrid_Auth::$config["proxy"] ) ){
+ $this->api->curl_proxy = Hybrid_Auth::$config["proxy"];
+ }
}
// --------------------------------------------------------------------
@@ -98,11 +103,11 @@ function loginBegin()
// check the last HTTP status code returned
if ( $this->api->http_code != 200 ){
- throw new Exception( "Authentification failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus( $this->api->http_code ), 5 );
+ throw new Exception( "Authentication failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus( $this->api->http_code ), 5 );
}
if ( ! isset( $tokens["oauth_token"] ) ){
- throw new Exception( "Authentification failed! {$this->providerId} returned an invalid oauth token.", 5 );
+ throw new Exception( "Authentication failed! {$this->providerId} returned an invalid oauth token.", 5 );
}
$this->token( "request_token" , $tokens["oauth_token"] );
@@ -123,7 +128,7 @@ function loginFinish()
$oauth_verifier = (array_key_exists('oauth_verifier',$_REQUEST))?$_REQUEST['oauth_verifier']:"";
if ( ! $oauth_token || ! $oauth_verifier ){
- throw new Exception( "Authentification failed! {$this->providerId} returned an invalid oauth verifier.", 5 );
+ throw new Exception( "Authentication failed! {$this->providerId} returned an invalid oauth verifier.", 5 );
}
// request an access token
@@ -134,12 +139,12 @@ function loginFinish()
// check the last HTTP status code returned
if ( $this->api->http_code != 200 ){
- throw new Exception( "Authentification failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus( $this->api->http_code ), 5 );
+ throw new Exception( "Authentication failed! {$this->providerId} returned an error. " . $this->errorMessageByStatus( $this->api->http_code ), 5 );
}
// we should have an access_token, or else, something has gone wrong
if ( ! isset( $tokens["oauth_token"] ) ){
- throw new Exception( "Authentification failed! {$this->providerId} returned an invalid access token.", 5 );
+ throw new Exception( "Authentication failed! {$this->providerId} returned an invalid access token.", 5 );
}
// we no more need to store requet tokens
View
9 hybridauth/Hybrid/Provider_Model_OAuth2.php
@@ -75,6 +75,11 @@ function initialize()
$this->api->access_token_expires_in = $this->token( "expires_in" );
$this->api->access_token_expires_at = $this->token( "expires_at" );
}
+
+ // Set curl proxy if exist
+ if( isset( Hybrid_Auth::$config["proxy"] ) ){
+ $this->api->curl_proxy = Hybrid_Auth::$config["proxy"];
+ }
}
// --------------------------------------------------------------------
@@ -99,7 +104,7 @@ function loginFinish()
// check for errors
if ( $error ){
- throw new Exception( "Authentification failed! {$this->providerId} returned an error: $error", 5 );
+ throw new Exception( "Authentication failed! {$this->providerId} returned an error: $error", 5 );
}
// try to authenicate user
@@ -114,7 +119,7 @@ function loginFinish()
// check if authenticated
if ( ! $this->api->access_token ){
- throw new Exception( "Authentification failed! {$this->providerId} returned an invalid access token.", 5 );
+ throw new Exception( "Authentication failed! {$this->providerId} returned an invalid access token.", 5 );
}
// store tokens
View
11 hybridauth/Hybrid/Provider_Model_OpenID.php
@@ -33,8 +33,11 @@ function initialize()
// include LightOpenID lib
require_once Hybrid_Auth::$config["path_libraries"] . "OpenID/LightOpenID.php";
-
- $this->api = new LightOpenID( parse_url( Hybrid_Auth::$config["base_url"], PHP_URL_HOST) );
+
+ // An error was occurring when proxy wasn't set. Not sure where proxy was meant to be set/initialized.
+ Hybrid_Auth::$config['proxy'] = isset(Hybrid_Auth::$config['proxy'])?Hybrid_Auth::$config['proxy']:'';
+
+ $this->api = new LightOpenID( parse_url( Hybrid_Auth::$config["base_url"], PHP_URL_HOST), Hybrid_Auth::$config["proxy"] );
}
// --------------------------------------------------------------------
@@ -86,12 +89,12 @@ function loginFinish()
{
# if user don't garant acess of their data to your site, halt with an Exception
if( $this->api->mode == 'cancel'){
- throw new Exception( "Authentification failed! User has canceled authentication!", 5 );
+ throw new Exception( "Authentication failed! User has canceled authentication!", 5 );
}
# if something goes wrong
if( ! $this->api->validate() ){
- throw new Exception( "Authentification failed. Invalid request recived!", 5 );
+ throw new Exception( "Authentication failed. Invalid request recived!", 5 );
}
# fetch recived user data
View
37 hybridauth/Hybrid/Providers/Facebook.php
@@ -15,9 +15,7 @@
class Hybrid_Providers_Facebook extends Hybrid_Provider_Model
{
// default permissions, and alot of them. You can change them from the configuration by setting the scope to what you want/need
- public $scope = "email, user_about_me, user_birthday, user_hometown, user_website";
-
- public $display = "page";
+ public $scope = "email, user_about_me, user_birthday, user_hometown, user_website, read_stream, offline_access, publish_stream, read_friendlists";
/**
* IDp wrappers initializer
@@ -28,25 +26,17 @@ function initialize()
throw new Exception( "Your application id and secret are required in order to connect to {$this->providerId}.", 4 );
}
- // override requested scope
- if( isset( $this->config["scope"] ) && ! empty( $this->config["scope"] ) ){
- $this->scope = $this->config["scope"];
- }
-
- // override requested display
- if( isset( $this->config["display"] ) && ! empty( $this->config["display"] ) ){
- $this->display = $this->config["display"];
- }
-
- if ( ! class_exists('FacebookApiException') ) {
+ if ( ! class_exists('FacebookApiException', false) ) {
require_once Hybrid_Auth::$config["path_libraries"] . "Facebook/base_facebook.php";
require_once Hybrid_Auth::$config["path_libraries"] . "Facebook/facebook.php";
}
$this->api = new Facebook( ARRAY( 'appId' => $this->config["keys"]["id"], 'secret' => $this->config["keys"]["secret"] ) );
- if ( $this->token("access_token") ) {
- $access_token = $this->api->extendedAccessToken( $this->token("access_token") );
+ if ( $this->token("access_token") ) {
+ $this->api->setAccessToken( $this->token("access_token") );
+ $this->api->setExtendedAccessToken();
+ $access_token = $this->api->getAccessToken();
if( $access_token ){
$this->token("access_token", $access_token );
@@ -66,8 +56,17 @@ function initialize()
*/
function loginBegin()
{
+ $parameters = array("scope" => $this->scope, "redirect_uri" => $this->endpoint, "display" => "page");
+ $optionals = array("scope", "redirect_uri", "display");
+
+ foreach ($optionals as $parameter){
+ if( isset( $this->config[$parameter] ) && ! empty( $this->config[$parameter] ) ){
+ $parameters[$parameter] = $this->config[$parameter];
+ }
+ }
+
// get the login url
- $url = $this->api->getLoginUrl( array( 'scope' => $this->scope, 'display' => $this->display, 'redirect_uri' => $this->endpoint ) );
+ $url = $this->api->getLoginUrl( $parameters );
// redirect to facebook
Hybrid_Auth::redirect( $url );
@@ -80,12 +79,12 @@ function loginFinish()
{
// in case we get error_reason=user_denied&error=access_denied
if ( isset( $_REQUEST['error'] ) && $_REQUEST['error'] == "access_denied" ){
- throw new Exception( "Authentification failed! The user denied your request.", 5 );
+ throw new Exception( "Authentication failed! The user denied your request.", 5 );
}
// try to get the UID of the connected user from fb, should be > 0
if ( ! $this->api->getUser() ){
- throw new Exception( "Authentification failed! {$this->providerId} returned an invalide user id.", 5 );
+ throw new Exception( "Authentication failed! {$this->providerId} returned an invalid user id.", 5 );
}
// set user as logged in
View
4 hybridauth/Hybrid/Providers/Foursquare.php
@@ -35,7 +35,7 @@ function getUserProfile()
$data = $this->api->api( "users/self" );
if ( ! isset( $data->response->user->id ) ){
- throw new Exception( "User profile request failed! {$this->providerId} returned an invalide response.", 6 );
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
}
$data = $data->response->user;
@@ -45,7 +45,7 @@ function getUserProfile()
$this->user->profile->lastName = $data->lastName;
$this->user->profile->displayName = trim( $this->user->profile->firstName . " " . $this->user->profile->lastName );
$this->user->profile->photoURL = $data->photo;
- $this->user->profile->profileURL = $data->canonicalUrl;
+ $this->user->profile->profileURL = "https://www.foursquare.com/user/" . $data->id;
$this->user->profile->gender = $data->gender;
$this->user->profile->city = $data->homeCity;
$this->user->profile->email = $data->contact->email;
View
20 hybridauth/Hybrid/Providers/Google.php
@@ -33,7 +33,16 @@ function initialize()
*/
function loginBegin()
{
- Hybrid_Auth::redirect( $this->api->authorizeUrl( array( "scope" => $this->scope, "access_type" => "offline" ) ) );
+ $parameters = array("scope" => $this->scope, "access_type" => "offline");
+ $optionals = array("scope", "access_type", "redirect_uri", "approval_prompt", "hd");
+
+ foreach ($optionals as $parameter){
+ if( isset( $this->config[$parameter] ) && ! empty( $this->config[$parameter] ) ){
+ $parameters[$parameter] = $this->config[$parameter];
+ }
+ }
+
+ Hybrid_Auth::redirect( $this->api->authorizeUrl( $parameters ) );
}
/**
@@ -48,7 +57,7 @@ function getUserProfile()
$response = $this->api->api( "https://www.googleapis.com/oauth2/v1/userinfo" );
if ( ! isset( $response->id ) || isset( $response->error ) ){
- throw new Exception( "User profile request failed! {$this->providerId} returned an invalide response.", 6 );
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
}
$this->user->profile->identifier = (property_exists($response,'id'))?$response->id:"";
@@ -82,7 +91,12 @@ function getUserContacts()
// refresh tokens if needed
$this->refreshToken();
- $response = $this->api->api( "https://www.google.com/m8/feeds/contacts/default/full?alt=json&max-results=500" );
+ if( ! isset( $this->config['contacts_param'] ) ){
+ $this->config['contacts_param'] = array( "max-results" => 500 );
+ }
+
+ $response = $this->api->api( "https://www.google.com/m8/feeds/contacts/default/full?"
+ . http_build_query( array_merge( array('alt' => 'json'), $this->config['contacts_param'] ) ) );
if( ! $response ){
return ARRAY();
View
48 hybridauth/Hybrid/Providers/Instagram.php
@@ -0,0 +1,48 @@
+<?php
+/*!
+* HybridAuth
+* http://hybridauth.sourceforge.net | https://github.com/hybridauth/hybridauth
+* (c) 2009-2011 HybridAuth authors | hybridauth.sourceforge.net/licenses.html
+*/
+
+/**
+* Hybrid_Providers_Instagram (By Sebastian Lasse - https://github.com/sebilasse)
+*/
+class Hybrid_Providers_Instagram extends Hybrid_Provider_Model_OAuth2
+{
+ // default permissions
+ public $scope = "basic";
+
+ /**
+ * IDp wrappers initializer
+ */
+ function initialize()
+ {
+ parent::initialize();
+
+ // Provider api end-points
+ $this->api->api_base_url = "https://api.instagram.com/v1/";
+ $this->api->authorize_url = "https://api.instagram.com/oauth/authorize/";
+ $this->api->token_url = "https://api.instagram.com/oauth/access_token";
+ }
+
+ /**
+ * load the user profile from the IDp api client
+ */
+ function getUserProfile(){
+ $data = $this->api->api("users/self/" );
+
+ if ( $data->meta->code != 200 ){
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalide response.", 6 );
+ }
+
+ $this->user->profile->identifier = $data->data->id;
+ $this->user->profile->displayName = $data->data->full_name ? $data->data->full_name : $data->data->username;
+ $this->user->profile->description = $data->data->bio;
+ $this->user->profile->photoURL = $data->data->profile_picture;
+
+ $this->user->profile->webSiteURL = $data->data->website;
+
+ return $this->user->profile;
+ }
+}
View
112 hybridauth/Hybrid/Providers/LinkedIn.php
@@ -2,7 +2,7 @@
/*!
* HybridAuth
* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
-* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/
/**
@@ -15,18 +15,18 @@
class Hybrid_Providers_LinkedIn extends Hybrid_Provider_Model
{
/**
- * IDp wrappers initializer
+ * IDp wrappers initializer
*/
- function initialize()
+ 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 );
- }
+ }
require_once Hybrid_Auth::$config["path_libraries"] . "OAuth/OAuth.php";
- require_once Hybrid_Auth::$config["path_libraries"] . "LinkedIn/LinkedIn.php";
-
- $this->api = new LinkedIn( array( 'appKey' => $this->config["keys"]["key"], 'appSecret' => $this->config["keys"]["secret"], 'callbackUrl' => $this->endpoint ) );
+ require_once Hybrid_Auth::$config["path_libraries"] . "LinkedIn/LinkedIn.php";
+
+ $this->api = new LinkedIn( array( 'appKey' => $this->config["keys"]["key"], 'appSecret' => $this->config["keys"]["secret"], 'callbackUrl' => $this->endpoint ) );
if( $this->token( "access_token_linkedin" ) ){
$this->api->setTokenAccess( $this->token( "access_token_linkedin" ) );
@@ -34,27 +34,27 @@ function initialize()
}
/**
- * begin login step
+ * begin login step
*/
function loginBegin()
{
- // send a request for a LinkedIn access token
- $response = $this->api->retrieveTokenRequest();
+ // send a request for a LinkedIn access token
+ $response = $this->api->retrieveTokenRequest();
- if( isset( $response['success'] ) && $response['success'] === TRUE ){
- $this->token( "oauth_token", $response['linkedin']['oauth_token'] );
- $this->token( "oauth_token_secret", $response['linkedin']['oauth_token_secret'] );
+ if( isset( $response['success'] ) && $response['success'] === TRUE ){
+ $this->token( "oauth_token", $response['linkedin']['oauth_token'] );
+ $this->token( "oauth_token_secret", $response['linkedin']['oauth_token_secret'] );
# redirect user to LinkedIn authorisation web page
Hybrid_Auth::redirect( LINKEDIN::_URL_AUTH . $response['linkedin']['oauth_token'] );
- }
+ }
else{
- throw new Exception( "Authentification failed! {$this->providerId} returned an invalid Token.", 5 );
- }
+ throw new Exception( "Authentication failed! {$this->providerId} returned an invalid Token.", 5 );
+ }
}
/**
- * finish login step
+ * finish login step
*/
function loginFinish()
{
@@ -62,25 +62,25 @@ function loginFinish()
$oauth_verifier = $_REQUEST['oauth_verifier'];
if ( ! $oauth_verifier ){
- throw new Exception( "Authentification failed! {$this->providerId} returned an invalid Token.", 5 );
+ throw new Exception( "Authentication failed! {$this->providerId} returned an invalid Token.", 5 );
}
$response = $this->api->retrieveTokenAccess( $oauth_token, $this->token( "oauth_token_secret" ), $oauth_verifier );
- if( isset( $response['success'] ) && $response['success'] === TRUE ){
+ if( isset( $response['success'] ) && $response['success'] === TRUE ){
$this->deleteToken( "oauth_token" );
$this->deleteToken( "oauth_token_secret" );
- $this->token( "access_token_linkedin", $response['linkedin'] );
- $this->token( "access_token" , $response['linkedin']['oauth_token'] );
- $this->token( "access_token_secret" , $response['linkedin']['oauth_token_secret'] );
+ $this->token( "access_token_linkedin", $response['linkedin'] );
+ $this->token( "access_token" , $response['linkedin']['oauth_token'] );
+ $this->token( "access_token_secret" , $response['linkedin']['oauth_token_secret'] );
// set user as logged in
$this->setUserConnected();
- }
+ }
else{
- throw new Exception( "Authentification failed! {$this->providerId} returned an invalid Token.", 5 );
- }
+ throw new Exception( "Authentication failed! {$this->providerId} returned an invalid Token.", 5 );
+ }
}
/**
@@ -90,41 +90,49 @@ function getUserProfile()
{
try{
// http://developer.linkedin.com/docs/DOC-1061
- $response = $this->api->profile('~:(id,first-name,last-name,public-profile-url,picture-url,date-of-birth,phone-numbers,summary)');
+ $response = $this->api->profile('~:(id,first-name,last-name,public-profile-url,picture-url,email-address,date-of-birth,phone-numbers,summary)');
}
catch( LinkedInException $e ){
throw new Exception( "User profile request failed! {$this->providerId} returned an error: $e", 6 );
}
if( isset( $response['success'] ) && $response['success'] === TRUE ){
- $data = @ new SimpleXMLElement( $response['linkedin'] );
+ $data = @ new SimpleXMLElement( $response['linkedin'] );
if ( ! is_object( $data ) ){
- throw new Exception( "User profile request failed! {$this->providerId} returned an invalide xml data.", 6 );
- }
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalid xml data.", 6 );
+ }
$this->user->profile->identifier = (string) $data->{'id'};
$this->user->profile->firstName = (string) $data->{'first-name'};
- $this->user->profile->lastName = (string) $data->{'last-name'};
+ $this->user->profile->lastName = (string) $data->{'last-name'};
$this->user->profile->displayName = trim( $this->user->profile->firstName . " " . $this->user->profile->lastName );
- $this->user->profile->photoURL = (string) $data->{'picture-url'};
- $this->user->profile->profileURL = (string) $data->{'public-profile-url'};
- $this->user->profile->description = (string) $data->{'summary'};
+ $this->user->profile->email = (string) $data->{'email-address'};
+ $this->user->profile->emailVerified = (string) $data->{'email-address'};
- $this->user->profile->phone = (string) $data->{'phone-numbers'}->{'phone-number'}->{'phone-number'};
+ $this->user->profile->photoURL = (string) $data->{'picture-url'};
+ $this->user->profile->profileURL = (string) $data->{'public-profile-url'};
+ $this->user->profile->description = (string) $data->{'summary'};
- if( $data->{'date-of-birth'} ) {
- $this->user->profile->birthDay = (string) $data->{'date-of-birth'}->day;
- $this->user->profile->birthMonth = (string) $data->{'date-of-birth'}->month;
- $this->user->profile->birthYear = (string) $data->{'date-of-birth'}->year;
- }
+ if( $data->{'phone-numbers'} && $data->{'phone-numbers'}->{'phone-number'} ){
+ $this->user->profile->phone = (string) $data->{'phone-numbers'}->{'phone-number'}->{'phone-number'};
+ }
+ else{
+ $this->user->profile->phone = null;
+ }
+
+ if( $data->{'date-of-birth'} ){
+ $this->user->profile->birthDay = (string) $data->{'date-of-birth'}->day;
+ $this->user->profile->birthMonth = (string) $data->{'date-of-birth'}->month;
+ $this->user->profile->birthYear = (string) $data->{'date-of-birth'}->year;
+ }
return $this->user->profile;
}
else{
throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
- }
+ }
}
/**
@@ -132,7 +140,7 @@ function getUserProfile()
*/
function getUserContacts()
{
- try{
+ try{
$response = $this->api->profile('~/connections:(id,first-name,last-name,picture-url,public-profile-url,summary)');
}
catch( LinkedInException $e ){
@@ -143,7 +151,7 @@ function getUserContacts()
return ARRAY();
}
- $connections = new SimpleXMLElement( $response['linkedin'] );
+ $connections = new SimpleXMLElement( $response['linkedin'] );
$contacts = ARRAY();
@@ -156,7 +164,7 @@ function getUserContacts()
$uc->photoURL = (string) $connection->{'picture-url'};
$uc->description = (string) $connection->{'summary'};
- $contacts[] = $uc;
+ $contacts[] = $uc;
}
return $contacts;
@@ -175,10 +183,10 @@ function setUserStatus( $status )
if( isset( $status[1] ) && ! empty( $status[1] ) ) $parameters["comment"] = $status[1]; // post comment
if( isset( $status[2] ) && ! empty( $status[2] ) ) $parameters["submitted-url"] = $status[2]; // post url
if( isset( $status[3] ) && ! empty( $status[3] ) ) $parameters["submitted-image-url"] = $status[3]; // post picture url
- if( isset( $status[4] ) && ! empty( $status[4] ) ) $private = $status[4]; // true or false
+ if( isset( $status[4] ) && ! empty( $status[4] ) ) $private = $status[4]; // true or false
}
else{
- $parameters["comment"] = $status;
+ $parameters["comment"] = $status;
}
try{
@@ -195,18 +203,18 @@ function setUserStatus( $status )
}
/**
- * load the user latest activity
+ * load the user latest activity
* - timeline : all the stream
- * - me : the user activity only
+ * - me : the user activity only
*/
function getUserActivity( $stream )
{
- try{
+ try{
if( $stream == "me" ){
- $response = $this->api->updates( '?type=SHAR&scope=self&count=25' );
- }
+ $response = $this->api->updates( '?type=SHAR&scope=self&count=25' );
+ }
else{
- $response = $this->api->updates( '?type=SHAR&count=25' );
+ $response = $this->api->updates( '?type=SHAR&count=25' );
}
}
catch( LinkedInException $e ){
@@ -221,7 +229,7 @@ function getUserActivity( $stream )
$activities = ARRAY();
- foreach( $updates->update as $update ) {
+ foreach( $updates->update as $update ) {
$person = $update->{'update-content'}->person;
$share = $update->{'update-content'}->person->{'current-share'};
View
6 hybridauth/Hybrid/Providers/Live.php
@@ -31,9 +31,9 @@ function initialize()
parent::initialize();
// Provider api end-points
- $this->api->api_base_url = "https://apis.live.net/v5.0/";
- $this->api->authorize_url = "https://oauth.live.com/authorize";
- $this->api->token_url = 'https://oauth.live.com/token';
+ $this->api->api_base_url = 'https://apis.live.net/v5.0/';
+ $this->api->authorize_url = 'https://login.live.com/oauth20_authorize.srf';
+ $this->api->token_url = 'https://login.live.com/oauth20_token.srf';
$this->api->curl_authenticate_method = "GET";
}
View
63 hybridauth/Hybrid/Providers/Mailru.php
@@ -0,0 +1,63 @@
+<?php
+/*!
+* HybridAuth
+* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
+*
+* Provider writed by xbreaker | https://github.com/xbreaker/hybridauth
+*/
+
+/**
+ * Hybrid_Providers_Mailru provider adapter based on OAuth2 protocol
+ *
+ */
+class Hybrid_Providers_Mailru extends Hybrid_Provider_Model_OAuth2
+{
+ /**
+ * IDp wrappers initializer
+ */
+ function initialize()
+ {
+ parent::initialize();
+
+ // Provider apis end-points
+ $this->api->api_base_url = "http://www.appsmail.ru/platform/api";
+ $this->api->authorize_url = "https://connect.mail.ru/oauth/authorize";
+ $this->api->token_url = "https://connect.mail.ru/oauth/token";
+ $this->api->sign_token_name = "session_key";
+ }
+
+ /**
+ * load the user profile from the IDp api client
+ */
+ function getUserProfile()
+ {
+ $sig = md5( "client_id=" . $this->api->client_id . "format=jsonmethod=users.getInfosecure=1session_key=". $this->api->access_token . $this->api->client_secret );
+ $response = $this->api->api( "?format=json&client_id=" . $this->api->client_id . "&method=users.getInfo&secure=1&sig=" .$sig);
+ if ( ! isset( $response[0]->uid ) ){
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalide response.", 6 );
+ }
+
+ $response = $response[0];
+
+ $this->user->profile->identifier = (property_exists($response,'uid'))?$response->uid:"";
+ $this->user->profile->firstName = (property_exists($response,'first_name'))?$response->first_name:"";
+ $this->user->profile->lastName = (property_exists($response,'last_name'))?$response->last_name:"";
+ $this->user->profile->displayName = (property_exists($response,'nick'))?$response->nick:"";
+ $this->user->profile->photoURL = (property_exists($response,'pic'))?$response->pic:"";
+ $this->user->profile->profileURL = (property_exists($response,'link'))?$response->link:"";
+ $this->user->profile->gender = (property_exists($response,'sex'))?$response->sex:"";
+ $this->user->profile->email = (property_exists($response,'email'))?$response->email:"";
+ $this->user->profile->emailVerified = (property_exists($response,'email'))?$response->email:"";
+
+ if( property_exists($response,'birthday') ){
+ list($birthday_day, $birthday_month, $birthday_year) = explode( '.', $response->birthday );
+
+ $this->user->profile->birthDay = (int) $birthday_day;
+ $this->user->profile->birthMonth = (int) $birthday_month;
+ $this->user->profile->birthYear = (int) $birthday_year;
+ }
+
+ return $this->user->profile;
+ }
+}
View
8 hybridauth/Hybrid/Providers/MySpace.php
@@ -34,7 +34,7 @@ public function getCurrentUserId()
$response = $this->api->get( 'http://api.myspace.com/v1/user.json' );
if ( ! isset( $response->userId ) ){
- throw new Exception( "User id request failed! {$this->providerId} returned an invalide response." );
+ throw new Exception( "User id request failed! {$this->providerId} returned an invalid response." );
}
return $response->userId;
@@ -50,7 +50,7 @@ function getUserProfile()
$data = $this->api->get( 'http://api.myspace.com/v1/users/' . $userId . '/profile.json' );
if ( ! is_object( $data ) ){
- throw new Exception( "User profile request failed! {$this->providerId} returned an invalide response.", 6 );
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
}
$this->user->profile->identifier = $userId;
@@ -78,7 +78,7 @@ function getUserContacts()
$response = $this->api->get( "http://api.myspace.com/v1/users/" . $userId . "/friends.json" );
if ( ! is_object( $response ) ){
- throw new Exception( "User profile request failed! {$this->providerId} returned an invalide response.", 6 );
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
}
$contacts = ARRAY();
@@ -134,7 +134,7 @@ function getUserActivity( $stream )
}
if ( ! is_object( $response ) ){
- throw new Exception( "User profile request failed! {$this->providerId} returned an invalide response.", 6 );
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
}
$activities = ARRAY();
View
174 hybridauth/Hybrid/Providers/Odnoklassniki.php
@@ -0,0 +1,174 @@
+<?php
+/*!
+* HybridAuth
+* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
+*/
+
+/**
+ * Hybrid_Providers_Odnoklassniki provider adapter based on OAuth2 protocol
+ *
+ */
+class Hybrid_Providers_Odnoklassniki extends Hybrid_Provider_Model_OAuth2
+{
+ /**
+ * IDp wrappers initializer
+ */
+ function initialize()
+ {
+ parent::initialize();
+
+ // Provider apis end-points
+ $this->api->api_base_url = "http://api.odnoklassniki.ru/fb.do";
+ $this->api->authorize_url = "http://www.odnoklassniki.ru/oauth/authorize";
+ $this->api->token_url = "http://api.odnoklassniki.ru/oauth/token.do";
+ $this->api->sign_token_name = "access_token";
+ }
+
+ private function request( $url, $params=false, $type="GET" )
+ {
+ Hybrid_Logger::info( "Enter OAuth2Client::request( $url )" );
+ Hybrid_Logger::debug( "OAuth2Client::request(). dump request params: ", serialize( $params ) );
+
+ if( $type == "GET" ){
+ $url = $url . ( strpos( $url, '?' ) ? '&' : '?' ) . http_build_query( $params );
+ }
+
+ $this->http_info = array();
+ $ch = curl_init();
+
+ curl_setopt($ch, CURLOPT_URL , $url );
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1 );
+ curl_setopt($ch, CURLOPT_TIMEOUT , $this->curl_time_out );
+ curl_setopt($ch, CURLOPT_USERAGENT , $this->curl_useragent );
+ curl_setopt($ch, CURLOPT_CONNECTTIMEOUT , $this->curl_connect_time_out );
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER , $this->curl_ssl_verifypeer );
+ curl_setopt($ch, CURLOPT_HTTPHEADER , $this->curl_header );
+ if($this->curl_proxy){
+ curl_setopt( $ch, CURLOPT_PROXY , $this->curl_proxy);
+ }
+ if( $type == "POST" ){
+ curl_setopt($ch, CURLOPT_POST, 1);
+ if($params) curl_setopt( $ch, CURLOPT_POSTFIELDS, $params );
+ }
+ $response = curl_exec($ch);
+ Hybrid_Logger::debug( "OAuth2Client::request(). dump request info: ", serialize( curl_getinfo($ch) ) );
+ Hybrid_Logger::debug( "OAuth2Client::request(). dump request result: ", serialize( $response ) );
+
+ $this->http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
+ $this->http_info = array_merge($this->http_info, curl_getinfo($ch));
+
+ curl_close ($ch);
+
+ return $response;
+ }
+
+ private function parseRequestResult( $result )
+ {
+ if( json_decode( $result ) ) return json_decode( $result );
+
+ parse_str( $result, $ouput );
+
+ $result = new StdClass();
+
+ foreach( $ouput as $k => $v )
+ $result->$k = $v;
+
+ return $result;
+ }
+
+ function authodnoklass( $code )
+ {
+ $params = array(
+ "client_id" => $this->api->client_id,
+ "client_secret" => $this->api->client_secret,
+ "grant_type" => "authorization_code",
+ "redirect_uri" => $this->api->redirect_uri,
+ "code" => $code
+ );
+
+ $response = $this->request( $this->api->token_url, http_build_query($params, '', '&'), $this->api->curl_authenticate_method );
+
+ $response = $this->parseRequestResult( $response );
+
+ if( ! $response || ! isset( $response->access_token ) ){
+ throw new Exception( "The Authorization Service has return: " . $response->error );
+ }
+
+ if( isset( $response->access_token ) ) $this->api->access_token = $response->access_token;
+ if( isset( $response->refresh_token ) ) $this->api->refresh_token = $response->refresh_token;
+ if( isset( $response->expires_in ) ) $this->api->access_token_expires_in = $response->expires_in;
+
+ // calculate when the access token expire
+ $this->api->access_token_expires_at = time() + $response->expires_in;
+
+ return $response;
+ }
+
+ function loginFinish()
+ {
+ $error = (array_key_exists('error',$_REQUEST))?$_REQUEST['error']:"";
+
+ // check for errors
+ if ( $error ){
+ throw new Exception( "Authentification failed! {$this->providerId} returned an error: $error", 5 );
+ }
+
+ // try to authenicate user
+ $code = (array_key_exists('code',$_REQUEST))?$_REQUEST['code']:"";
+
+ try{
+ $this->authodnoklass( $code );
+ }
+ catch( Exception $e ){
+ throw new Exception( "User profile request failed! {$this->providerId} returned an error: $e", 6 );
+ }
+
+ // check if authenticated
+ if ( ! $this->api->access_token ){
+ throw new Exception( "Authentification failed! {$this->providerId} returned an invalid access token.", 5 );
+ }
+
+ // store tokens
+ $this->token( "access_token" , $this->api->access_token );
+ $this->token( "refresh_token", $this->api->refresh_token );
+ $this->token( "expires_in" , $this->api->access_token_expires_in );
+ $this->token( "expires_at" , $this->api->access_token_expires_at );
+
+ // set user connected locally
+ $this->setUserConnected();
+ }
+
+ /**
+ * load the user profile from the IDp api client
+ */
+ function getUserProfile()
+ {
+ $sig = md5('application_key=' . $this->config['keys']['key'] . 'method=users.getCurrentUser' . md5($this->api->access_token . $this->api->client_secret));
+ $response = $this->api->api( '?application_key=' . $this->config['keys']['key'] . '&method=users.getCurrentUser&sig=' .$sig);
+ if ( ! isset( $response->uid ) ){
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalide response.", 6 );
+ }
+
+ $this->user->profile->identifier = (property_exists($response,'uid'))?$response->uid:"";
+ $this->user->profile->firstName = (property_exists($response,'first_name'))?$response->first_name:"";
+ $this->user->profile->lastName = (property_exists($response,'last_name'))?$response->last_name:"";
+ $this->user->profile->displayName = (property_exists($response,'name'))?$response->name:"";
+ $this->user->profile->photoURL = (property_exists($response,'pic_1'))?$response->pic_1:"";
+ $this->user->profile->photoBIG = (property_exists($response,'pic_2'))?$response->pic_2:"";
+ $this->user->profile->profileURL = (property_exists($response,'link'))?$response->link:"";
+ $this->user->profile->gender = (property_exists($response,'gender'))?$response->gender:"";
+ $this->user->profile->email = (property_exists($response,'email'))?$response->email:"";
+ $this->user->profile->emailVerified = (property_exists($response,'email'))?$response->email:"";
+
+ if( property_exists($response,'birthday') ){
+ list($birthday_year, $birthday_month, $birthday_day) = explode( '-', $response->birthday );
+
+ $this->user->profile->birthDay = (int) $birthday_day;
+ $this->user->profile->birthMonth = (int) $birthday_month;
+ $this->user->profile->birthYear = (int) $birthday_year;
+ }
+
+ return $this->user->profile;
+ }
+}
View
2  hybridauth/Hybrid/Providers/Steam.php
@@ -1,5 +1,5 @@
<?php
class Hybrid_Providers_Steam extends Hybrid_Provider_Model_OpenID
{
- var $openidIdentifier = "http://steamcommunity.com/openid/id/";
+ var $openidIdentifier = "http://steamcommunity.com/openid";
}
View
239 hybridauth/Hybrid/Providers/Yahoo.php
@@ -1,32 +1,237 @@
<?php
-//!! planned to be replaced Y! openid by the oauth1 adapter soon
-
/*!
* HybridAuth
-* http://hybridauth.sourceforge.net | https://github.com/hybridauth/hybridauth
-* (c) 2009-2011 HybridAuth authors | hybridauth.sourceforge.net/licenses.html
+* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
*/
+/**
+ * Yahoo OAuth Class
+ *
+ * @package HybridAuth providers package
+ * @author Lukasz Koprowski <azram19@gmail.com>
+ * @version 0.2
+ * @license BSD License
+ */
+
/**
-* Hybrid_Providers_Yahoo provider adapter based on OAuth1 protocol
-*
-* http://hybridauth.sourceforge.net/userguide/IDProvider_info_Yahoo.html
-*/
-class Hybrid_Providers_Yahoo extends Hybrid_Provider_Model_OpenID
+ * Hybrid_Providers_Yahoo - Yahoo provider adapter based on OAuth1 protocol
+ */
+class Hybrid_Providers_Yahoo extends Hybrid_Provider_Model_OAuth1
{
- var $openidIdentifier = "https://open.login.yahooapis.com/openid20/www.yahoo.com/xrds";
+ function initialize()
+ {
+ parent::initialize();
+
+ // Provider api end-points
+ $this->api->api_base_url = 'http://social.yahooapis.com/v1/';
+ $this->api->authorize_url = 'https://api.login.yahoo.com/oauth/v2/request_auth';
+ $this->api->request_token_url = 'https://api.login.yahoo.com/oauth/v2/get_request_token';
+ $this->api->access_token_url = 'https://api.login.yahoo.com/oauth/v2/get_token';
+ }
+
+ function getUserProfile()
+ {
+ $userId = $this->getCurrentUserId();
+
+ $parameters = array();
+ $parameters['format'] = 'json';
+
+ $response = $this->api->get( 'user/' . $userId . '/profile', $parameters );
+
+ if ( ! isset( $response->profile ) ){
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalid response.", 6 );
+ }
+
+ $data = $response->profile;
+
+ $this->user->profile->identifier = (property_exists($data,'guid'))?$data->guid:"";
+ $this->user->profile->firstName = (property_exists($data,'givenName'))?$data->givenName:"";
+ $this->user->profile->lastName = (property_exists($data,'familyName'))?$data->familyName:"";
+ $this->user->profile->displayName = (property_exists($data,'nickname'))?trim( $data->nickname ):"";
+ $this->user->profile->profileURL = (property_exists($data,'profileUrl'))?$data->profileUrl:"";
+ $this->user->profile->gender = (property_exists($data,'gender'))?$data->gender:"";
+
+ if( $this->user->profile->gender == "F" ){
+ $this->user->profile->gender = "female";
+ }
+
+ if( $this->user->profile->gender == "M" ){
+ $this->user->profile->gender = "male";
+ }
+
+ if( isset($data->emails) ){
+ $email = "";
+ foreach( $data->emails as $v ){
+ if( isset($v->primary) && $v->primary ) {
+ $email = (property_exists($v,'handle'))?$v->handle:"";
+
+ break;
+ }
+ }
+
+ $this->user->profile->email = $email;
+ $this->user->profile->emailVerified = $email;
+ }
+
+ $this->user->profile->age = (property_exists($data,'displayAge'))?$data->displayAge:"";
+ $this->user->profile->photoURL = (property_exists($data,'image'))?$data->image->imageUrl:"";
+
+ $this->user->profile->address = (property_exists($data,'location'))?$data->location:"";
+ $this->user->profile->language = (property_exists($data,'lang'))?$data->lang:"";
+
+ return $this->user->profile;
+ }
/**
- * finish login step
+ * load the user contacts
+ */
+ function getUserContacts()
+ {
+ $userId = $this->getCurrentUserId();
+
+ $parameters = array();
+ $parameters['format'] = 'json';
+ $parameters['count'] = 'max';
+
+ $response = $this->api->get('user/' . $userId . '/contacts', $parameters);
+
+ if ( $this->api->http_code != 200 )
+ {
+ throw new Exception( 'User contacts request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus( $this->api->http_code ) );
+ }
+
+ if ( !$response->contacts->contact && ( $response->errcode != 0 ) )
+ {
+ return array();
+ }
+
+ $contacts = array();
+
+ foreach( $response->contacts->contact as $item ) {
+ $uc = new Hybrid_User_Contact();
+
+ $uc->identifier = $this->selectGUID( $item );
+ $uc->email = $this->selectEmail( $item->fields );
+ $uc->displayName = $this->selectName( $item->fields );
+ $uc->photoURL = $this->selectPhoto( $item->fields );
+
+ $contacts[] = $uc;
+ }
+
+ return $contacts;
+ }
+
+ /**
+ * return the user activity stream
*/
- function loginFinish()
+ function getUserActivity( $stream )
+ {
+ $userId = $this->getCurrentUserId();
+
+ $parameters = array();
+ $parameters['format'] = 'json';
+ $parameters['count'] = 'max';
+
+ $response = $this->api->get('user/' . $userId . '/updates', $parameters);
+
+ if( ! $response->updates || $this->api->http_code != 200 )
+ {
+ throw new Exception( 'User activity request failed! ' . $this->providerId . ' returned an error: ' . $this->errorMessageByStatus( $this->api->http_code ) );
+ }
+
+ $activities = array();
+
+ foreach( $response->updates as $item ){
+ $ua = new Hybrid_User_Activity();
+
+ $ua->id = (property_exists($item,'collectionID'))?$item->collectionID:"";
+ $ua->date = (property_exists($item,'lastUpdated'))?$item->lastUpdated:"";
+ $ua->text = (property_exists($item,'loc_longForm'))?$item->loc_longForm:"";
+
+ $ua->user->identifier = (property_exists($item,'profile_guid'))?$item->profile_guid:"";
+ $ua->user->displayName = (property_exists($item,'profile_nickname'))?$item->profile_nickname:"";
+ $ua->user->profileURL = (property_exists($item,'profile_profileUrl'))?$item->profile_profileUrl:"";
+ $ua->user->photoURL = (property_exists($item,'profile_displayImage'))?$item->profile_displayImage:"";
+
+ $activities[] = $ua;
+ }
+
+ if( $stream == "me" ){
+ $userId = $this->getCurrentUserId();
+ $my_activities = array();
+
+ foreach( $activities as $a ){
+ if( $a->user->identifier == $userId ){
+ $my_activities[] = $a;
+ }
+ }
+
+ return $my_activities;
+ }
+
+ return $activities;
+ }
+
+ //--
+
+ function select($vs, $t)
{
- parent::loginFinish();
+ foreach( $vs as $v ){
+ if( $v->type == $t ) {
+ return $v;
+ }
+ }
- $this->user->profile->emailVerified = $this->user->profile->email;
+ return NULL;
+ }
- // restore the user profile
- Hybrid_Auth::storage()->set( "hauth_session.{$this->providerId}.user", $this->user );
+ function selectGUID( $v )
+ {
+ return (property_exists($v,'id'))?$v->id:"";
+ }
+
+ function selectName( $v )
+ {
+ $s = $this->select($v, 'name');
+
+ if( ! $s ){
+ $s = $this->select($v, 'nickname');
+ return ($s)?$s->value:"";
+ } else {
+ return ($s)?$s->value->givenName . " " . $s->value->familyName:"";
+ }
+ }
+
+ function selectNickame( $v )
+ {
+ $s = $this->select($v, 'nickname');
+ return ($s)?$s:"";
}
-}
+ function selectPhoto( $v )
+ {
+ $s = $this->select($v, 'guid');
+ return ($s)?(property_exists($s,'image')):"";
+ }
+
+ function selectEmail( $v )
+ {
+ $s = $this->select($v, 'email');
+ return ($s)?$s->value:"";
+ }
+
+ public function getCurrentUserId()
+ {
+ $parameters = array();
+ $parameters['format'] = 'json';
+
+ $response = $this->api->get( 'me/guid', $parameters );
+
+ if ( ! isset( $response->guid->value ) ){
+ throw new Exception( "User id request failed! {$this->providerId} returned an invalid response." );
+ }
+
+ return $response->guid->value;
+ }
+}
View
61 hybridauth/Hybrid/Providers/Yandex.php
@@ -0,0 +1,61 @@
+<?php
+/*!
+* HybridAuth
+* http://hybridauth.sourceforge.net | http://github.com/hybridauth/hybridauth
+* (c) 2009-2012, HybridAuth authors | http://hybridauth.sourceforge.net/licenses.html
+*
+* Provider writed by xbreaker | https://github.com/xbreaker/hybridauth
+*/
+
+/**
+ * Hybrid_Providers_Yandex provider adapter based on OAuth2 protocol
+ *
+ */
+class Hybrid_Providers_Yandex extends Hybrid_Provider_Model_OAuth2
+{
+ /**
+ * IDp wrappers initializer
+ */
+ function initialize()
+ {
+ parent::initialize();
+
+ // Provider apis end-points
+ $this->api->api_base_url = "https://login.yandex.ru/info";
+ $this->api->authorize_url = "https://oauth.yandex.ru/authorize";
+ $this->api->token_url = "https://oauth.yandex.ru/token";
+
+ $this->api->sign_token_name = "oauth_token";
+ }
+
+ /**
+ * load the user profile from the IDp api client
+ */
+ function getUserProfile()
+ {
+ $response = $this->api->api( "?format=json" );
+ if ( ! isset( $response->id ) ){
+ throw new Exception( "User profile request failed! {$this->providerId} returned an invalide response.", 6 );
+ }
+
+ $this->user->profile->identifier = (property_exists($response,'id'))?$response->id:"";
+ $this->user->profile->firstName = (property_exists($response,'real_name'))?$response->real_name:"";
+ $this->user->profile->lastName = (property_exists($response,'family_name'))?$response->family_name:"";
+ $this->user->profile->displayName = (property_exists($response,'display_name'))?$response->display_name:"";
+ $this->user->profile->photoURL = 'http://upics.yandex.net/'. $this->user->profile->identifier .'/normal';
+ $this->user->profile->profileURL = "";
+ $this->user->profile->gender = (property_exists($response,'sex'))?$response->sex:"";
+ $this->user->profile->email = (property_exists($response,'default_email'))?$response->default_email:"";
+ $this->user->profile->emailVerified = (property_exists($response,'default_email'))?$response->default_email:"";
+
+ if( property_exists($response,'birthday') ){
+ list($birthday_year, $birthday_month, $birthday_day) = explode( '-', $response->birthday );
+
+ $this->user->profile->birthDay = (int) $birthday_day;
+ $this->user->profile->birthMonth = (int) $birthday_month;
+ $this->user->profile->birthYear = (int) $birthday_year;
+ }
+
+ return $this->user->profile;
+ }
+}
View
4 hybridauth/Hybrid/Storage.php
@@ -40,7 +40,7 @@ public function get($key)
{
$key = strtolower( $key );
- if( isset( $_SESSION["HA::STORE"][$key] ) ){
+ if( isset( $_SESSION["HA::STORE"], $_SESSION["HA::STORE"][$key] ) ){
return unserialize( $_SESSION["HA::STORE"][$key] );
}
@@ -63,7 +63,7 @@ function delete($key)
{
$key = strtolower( $key );
- if( isset( $_SESSION["HA::STORE"][$key] ) ){
+ if( isset( $_SESSION["HA::STORE"], $_SESSION["HA::STORE"][$key] ) ){
unset( $_SESSION["HA::STORE"][$key] );
}
}
View
290 hybridauth/Hybrid/thirdparty/Facebook/base_facebook.php
@@ -1,6 +1,4 @@
<?php
-// Modified
-
/**
* Copyright 2011 Facebook, Inc.
*
@@ -122,7 +120,12 @@ public function __toString() {
/**
* Version.
*/
- const VERSION = '3.1.1';
+ const VERSION = '3.2.2';
+
+ /**
+ * Signed Request Algorithm.
+ */
+ const SIGNED_REQUEST_ALGORITHM = 'HMAC-SHA256';
/**
* Default options for curl.
@@ -131,7 +134,7 @@ public function __toString() {
CURLOPT_CONNECTTIMEOUT => 10,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
- CURLOPT_USERAGENT => 'facebook-php-3.1',
+ CURLOPT_USERAGENT => 'facebook-php-3.2',
);
/**
@@ -148,12 +151,12 @@ public function __toString() {
* Maps aliases to Facebook domains.
*/
public static $DOMAIN_MAP = array(
- 'api' => 'https://api.facebook.com/',
- 'api_video' => 'https://api-video.facebook.com/',
- 'api_read' => 'https://api-read.facebook.com/',
- 'graph' => 'https://graph.facebook.com/',
+ 'api' => 'https://api.facebook.com/',
+ 'api_video' => 'https://api-video.facebook.com/',
+ 'api_read' => 'https://api-read.facebook.com/',
+ 'graph' => 'https://graph.facebook.com/',
'graph_video' => 'https://graph-video.facebook.com/',
- 'www' => 'https://www.facebook.com/',
+ 'www' => 'https://www.facebook.com/',
);
/**