mirror of
https://github.com/e107inc/e107.git
synced 2025-08-24 15:13:04 +02:00
Updated Hybridauth from v2.9.6 to v3.1.1
This commit is contained in:
72
index.php
72
index.php
@@ -47,9 +47,9 @@
|
||||
|
||||
|
||||
define('e_SINGLE_ENTRY', TRUE);
|
||||
|
||||
|
||||
$_E107['single_entry'] = true; // TODO - notify class2.php
|
||||
|
||||
|
||||
define('ROOT', dirname(__FILE__));
|
||||
set_include_path(ROOT.PATH_SEPARATOR.get_include_path());
|
||||
|
||||
@@ -75,22 +75,22 @@
|
||||
// -----------------------------------------
|
||||
|
||||
$sql->db_Mark_Time("Start regular eFront Class");
|
||||
|
||||
|
||||
$front = eFront::instance();
|
||||
$front->init()
|
||||
->run();
|
||||
|
||||
|
||||
$request = $front->getRequest();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// If not already done - define legacy constants
|
||||
$request->setLegacyQstring();
|
||||
$request->setLegacyPage();
|
||||
|
||||
|
||||
|
||||
$inc = $front->isLegacy();
|
||||
|
||||
$inc = $front->isLegacy();
|
||||
if($inc)
|
||||
{
|
||||
// last chance to set legacy env
|
||||
@@ -103,7 +103,7 @@
|
||||
include($inc);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$response = $front->getResponse();
|
||||
if(e_AJAX_REQUEST)
|
||||
{
|
||||
@@ -113,8 +113,8 @@
|
||||
exit;
|
||||
}
|
||||
$response->sendMeta();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// -------------- Experimental -----------------
|
||||
|
||||
@@ -122,26 +122,16 @@
|
||||
|
||||
if(vartrue($_GET['provider']) && !isset($_SESSION['E:SOCIAL']) && e107::getPref('social_login_active', false) && (e_ADMIN_AREA !== true))
|
||||
{
|
||||
require_once(e_HANDLER."hybridauth/Hybrid/Auth.php");
|
||||
|
||||
$config = array(
|
||||
"base_url" => SITEURL.$HANDLERS_DIRECTORY."hybridauth/",
|
||||
"providers" => e107::getPref('social_login', array())
|
||||
);
|
||||
|
||||
// print_a($config);
|
||||
// $params = array("hauth_return_to" => e_SELF);
|
||||
|
||||
$hybridauth = new Hybrid_Auth($config);
|
||||
|
||||
$hybridauth = e107::getHybridAuth();
|
||||
|
||||
$prov = (!isset($config['providers'][$_GET['provider']])) ? "Facebook" : $_GET['provider'];
|
||||
|
||||
|
||||
$adapter = $hybridauth->authenticate( $prov);
|
||||
$user_profile = $adapter->getUserProfile();
|
||||
|
||||
|
||||
$adapter = $hybridauth->authenticate($prov);
|
||||
$user_profile = $adapter->getUserProfile();
|
||||
|
||||
$prov_id = $prov."_".$user_profile->identifier;
|
||||
|
||||
|
||||
if($user_profile->identifier >0)
|
||||
{
|
||||
if (!$sql->select("user", "*", "user_xup = '".$prov_id."' ")) // New User
|
||||
@@ -149,7 +139,7 @@
|
||||
$user_join = time();
|
||||
$user_pass = md5($user_profile->identifier.$user_join);
|
||||
$user_loginname = "xup_".$user_profile->identifier;
|
||||
|
||||
|
||||
$insert = array(
|
||||
'user_name' => $user_profile->displayName,
|
||||
'user_email' => $user_profile->email,
|
||||
@@ -159,26 +149,26 @@
|
||||
'user_join' => $user_join,
|
||||
'user_xup' => $prov_id
|
||||
);
|
||||
|
||||
|
||||
if($newid = $sql->insert('user',$insert,true))
|
||||
{
|
||||
e107::getEvent()->trigger('usersup', $insert);
|
||||
e107::getEvent()->trigger('usersup', $insert);
|
||||
if(!USERID)
|
||||
{
|
||||
require_once(e_HANDLER.'login.php');
|
||||
$usr = new userlogin($user_loginname, $user_pass, 'signup', '');
|
||||
$usr = new userlogin($user_loginname, $user_pass, 'signup', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
else // Existing User.
|
||||
else // Existing User.
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
// echo "CHECKING";
|
||||
$_SESSION['E:SOCIAL'] = (array) $user_profile;
|
||||
$_SESSION['E:SOCIAL'] = (array) $user_profile;
|
||||
echo "USERNAME=".USERNAME;
|
||||
echo "<br />USEREMAIL=".USEREMAIL;
|
||||
echo "<br />USERIMAGE=".USERIMAGE;
|
||||
@@ -187,11 +177,11 @@
|
||||
|
||||
|
||||
// -------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
include_once(HEADERF);
|
||||
eFront::instance()->getResponse()->send('default', false, true);
|
||||
include_once(FOOTERF);
|
||||
|
Reference in New Issue
Block a user