Author |
Message |
Lucifix
Regular
Joined: Mar 11, 2005
Posts: 67
|
Posted:
Sat Feb 12, 2011 1:49 pm |
|
Did anyone try to integrated Facebook connect in Ravennuke yet? So that guest could register to Ravennuke from Facebook account? |
|
|
|
|
nuken
RavenNuke(tm) Development Team
Joined: Mar 11, 2007
Posts: 2024
Location: North Carolina
|
Posted:
Sat Feb 12, 2011 1:56 pm |
|
i have a mod that uses the Janrain Engage api to allow your users to use several different social network sites to register as a member to your site. You can download it here http://trickedoutnews.com/download-file-90.html and see it in action on my site. |
_________________ Only registered users can see links on this board! Get registered or login! |
|
|
|
Lucifix
|
Posted:
Sat Feb 12, 2011 4:05 pm |
|
Hmm... this looks promising, but I can't register on your site to download plugin. After hitting button Continue nothing happened. (Firefox, Chrome or IE)
Edit: I succeded by disabling java script |
|
|
|
|
nuken
|
Posted:
Sun Feb 13, 2011 12:37 am |
|
Sorry about that. I updated my jQuery version and it had a conflict with the validate plugin. All is fixed now. |
|
|
|
|
Lucifix
|
Posted:
Sun Feb 13, 2011 3:23 am |
|
As I can see this MOD will only insert in register form informations based on Facebook or other account. User will still have to activate account from activation email which is on of the most important reason why I would like to activate Facebook connect. |
|
|
|
|
nuken
|
Posted:
Sun Feb 13, 2011 7:01 am |
|
No, they do not have to activate the account by email. It should auto activate the account and log them in once they confirm the information. |
|
|
|
|
montego
Site Admin
Joined: Aug 29, 2004
Posts: 9457
Location: Arizona
|
Posted:
Mon Feb 21, 2011 7:43 am |
|
Any chance this is making its way into an upcoming RN release nuken? I'd love that to be an option within the core. |
_________________ Only registered users can see links on this board! Get registered or login!
Only registered users can see links on this board! Get registered or login! |
|
|
|
Lucifix
|
Posted:
Mon Feb 21, 2011 7:59 am |
|
I've successfully integrated Facebook Connect to RavenNuke. I've used Facebook PHP SDK and some javascript:
https://github.com/facebook/php-sdk/
If you're interesting I can post tutorial here? |
|
|
|
|
prekill
Worker
Joined: Oct 22, 2005
Posts: 201
|
Posted:
Mon Feb 21, 2011 5:14 pm |
|
Lucifix, this will be great! |
|
|
|
|
prekill
|
Posted:
Sat Apr 23, 2011 12:37 pm |
|
<bump>
Any new with this? |
|
|
|
|
prekill
|
Posted:
Thu May 12, 2011 2:45 am |
|
|
|
|
prekill
|
Posted:
Sat Jun 04, 2011 7:40 am |
|
|
|
|
prekill
|
Posted:
Wed Jul 13, 2011 1:59 pm |
|
...lol this is a sad case already! |
|
|
|
|
kenno
Worker
Joined: Jul 26, 2009
Posts: 117
Location: Scunthorpe, UK
|
Posted:
Mon Jul 18, 2011 4:18 pm |
|
Have you tried contacting him on his site ?, this is listed in his postings in his forum profile http://www.slo-foto.net/
Let us know how you get on
Mark |
|
|
|
|
jlajax
Ardent RavenCMS Supporter
Joined: Oct 12, 2006
Posts: 244
Location: Jacksonville, Florida
|
Posted:
Thu Apr 17, 2014 10:22 am |
|
nuken wrote: | i have a mod that uses the Janrain Engage api to allow your users to use several different social network sites to register as a member to your site. You can download it here http://trickedoutnews.com/download-file-90.html and see it in action on my site. |
This link led to a dead link. I am very interested in social integration and login. I obviously have not spent enough time in these forums of late. |
|
|
|
|
nuken
|
Posted:
Thu Apr 17, 2014 10:26 am |
|
Janrain changed their code so the mod stopped working. I had intentions of making a new one just never found the spare time. Someone else had a working facebook login for RavenNuke. It should be somewhere in the forums. |
|
|
|
|
rovshan
Hangin' Around
Joined: Nov 26, 2005
Posts: 40
|
Posted:
Fri Nov 20, 2015 9:45 am |
|
Only registered users can see links on this board! Get registered or login!
I think hybridauth best solution to integrate in RN.
Here is I did something but did not finish yet, if someone interested in please publish your idea.
## Wrapper for the HybridAuth PHP library.
## See http://hybridauth.sourceforge.net/ for more info on HybridAuth.
Based on idea taken from Only registered users can see links on this board! Get registered or login!
<?php
## Impetus Games OAuth Plugin.
## Wrapper for the HybridAuth PHP library.
## See http://hybridauth.sourceforge.net/ for more info on HybridAuth.
//session_start();
require_once 'mainfile.php';
include_once('hybridauth/Hybrid/Auth.php');
include_once('hybridauth/Hybrid/Logger.php');
include_once('hybridauth/Hybrid/Endpoint.php');
include_once('hybridauth/Hybrid/Exception.php');
//function smarty_function_oauth($params, &$template) {
$hybrid_auth_config = dirname(__FILE__) . '/hybridauth/config.php';
//$hybrid_auth_config = 'hybridauth/config.php';
// Clear session and return.
if(isset($_GET['clearsession'])) {
oauth_clear_session();
header('Location: ' . $_SERVER['HTTP_REFERER']);
exit();
}
// Init (clear session), then do login.
if(isset($_GET['initlogin'])) {
oauth_clear_session();
$_SESSION['oauth_return_to'] = $_SERVER['HTTP_REFERER'];
header('Location: ' . oauth_get_current_uri() . '?dologin=' . $_GET['initlogin']);
//echo 'Location: ' . oauth_get_current_uri() . '?dologin=' . $_GET['initlogin'].'';
//die ();
exit();
}
// Step 1: Start process, clear session, logout, check valid provider, etc.
// Step 3: After login, request user data and save to DB.
if(isset($_GET['dologin'])) {
$config = include($hybrid_auth_config);
$provider = $_GET['dologin'];
//echo '/ '.$hybrid_auth_config.' / '.$config.' /// '.$provider.'';
//die();
if(array_key_exists($provider, $config['providers']) && $config['providers'][$provider]['enabled']) {
try {
$_SESSION['oauth_provider'] = $provider;
// Authenticate with OAuth provider
$hybridauth = new Hybrid_Auth($hybrid_auth_config);
$adapter = $hybridauth->authenticate($provider);
// Get user data from OAuth provider and save it to DB
$user_profile = $adapter->getUserProfile();
$_SESSION['oauth_db_id'] = oauth_update_db($provider, $user_profile);
// save user data and redirect home
$_SESSION['oauth_user_id'] = $user_profile->identifier;
$_SESSION['oauth_user_name'] = $user_profile->displayName;
$_SESSION['oauth_first_name'] = $user_profile->firstName;
$_SESSION['oauth_last_name'] = '';
$_SESSION['oauth_display_name'] = $user_profile->firstName;
if(isset($user_profile->lastName) && !empty($user_profile->lastName)) {
$_SESSION['oauth_display_name'] .= " " . $user_profile->lastName;
$_SESSION['oauth_last_name'] = $user_profile->lastName;
}
oauth_redirect_home('signed-in');
}
catch(Exception $ex) {
oauth_redirect_home('auth-error', $ex->getMessage());
}
}
else {
$_SESSION['oauth_return_to'] = $_SERVER['HTTP_REFERER'];
oauth_redirect_home('auth-error', 'Invalid OAuth provider: ' . $provider);
}
}
// Step 2: Start the HybridAuth authentication "background process"
if(isset($_REQUEST['hauth_start']) || isset($_REQUEST['hauth_done'])) {
try {
Hybrid_Endpoint::process();
}
catch(Exception $ex) {
$_SESSION['oauth_status'] = 'auth-error';
$_SESSION['oauth_error_msg'] = 'Authentication process failed, trying to restart';
header('Location: ' . oauth_get_current_uri() . '?dologin=' . $_SESSION['oauth_provider']);
}
exit();
}
echo 'no way';
//die("You must not call this script directly without parameters.");
//}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* Clear all oauth_* values in session and globally logout via HybridAuth. */
function oauth_clear_session() {
global $hybrid_auth_config ;
/* clear OAuth session variables */
foreach($_SESSION as $k => $v) {
if(strpos($k, "oauth_") === 0) {
unset($_SESSION[$k]);
}
}
$_SESSION['oauth_session_cleared'] = true;
/* Clear HybridAuth */
$hybrid = new Hybrid_Auth($hybrid_auth_config);
$hybrid->logoutAllProviders();
}
/* Redirect to $_SESSION['return_to'], if set, or home (/) otherwise. */
function oauth_redirect_home($status, $error = null) {
$_SESSION['oauth_status'] = $status;
if($error)
$_SESSION['oauth_error_msg'] = $error;
else
unset($_SESSION['oauth_error_msg']);
header('Location: ' . (isset($_SESSION['oauth_return_to']) ? $_SESSION['oauth_return_to'] : '/'));
exit();
}
/* Update user info in database. */
function oauth_update_db($provider, $data) {
global $db ;
//$config = include($hybrid_auth_config);
$config = include('hybridauth/config.php');
if(!array_key_exists('db_table', $config) || empty($config['db_table']))
return;
$users_tab = $config['db_table'];
//echo ''.$users_tab.''; die();
//$db = cmsms()->GetDb();
// first check whether user exists in DB already
//echo ' /what// '.$data->identifier.' ///';
//$sql = "SELECT * FROM " . $users_tab . " WHERE provider = '$provider' AND uid = ?";
$sql = 'SELECT * FROM ' . $users_tab . ' WHERE provider = \'' .$provider. '\' AND uid = \'' .$data->identifier. '\' ';
$result = $db->sql_query($sql);
// $result = $db->Execute($sql, array($data->identifier));
if(!$result)
die("Failed to select record db ");
//echo 'NET'; die ();
if($db->sql_numrows($result) == 0) {
// insert new record into DB
// $sql = "INSERT INTO " . $users_tab . " (provider, uid, display_name, first_name, last_name, email) VALUES ('$provider', '$data->identifier', '$data->displayName', '$data->firstName', '$data->lastName', '$data->email')";
$db->sql_query('INSERT INTO ' . $users_tab . ' (provider, uid, display_name, first_name, last_name, email) VALUES (\'' . $provider . '\', \'' . $data->identifier . '\', \'' . $data->displayName . '\', \'' . $data->firstName . '\', \'' . $data->lastName . '\', \'' . $data->email . '\')');
// if(!$db->Execute($sql, array($data->identifier, $data->displayName, $data->firstName, $data->lastName, $data->email)))
if(!$db)
die("Failed to insert into db");
} else {
// update existing record in DB
$db->sql_query('UPDATE ' . $users_tab . ' SET display_name = \'' . $data->displayName . '\', \'' . $data->firstName . '\', last_name = \'' . $data->lastName . '\', email = \'' . $data->email . '\' WHERE provider = \'' .$provider. '\' AND uid = \'' .$data->identifier. '\' ');
//if(!$db->Execute($sql, array($data->displayName, $data->firstName, $data->lastName, $data->email, $data->identifier)))
if(!$db)
//die("Failed to update database: " . $db->ErrorMsg());
die("Failed to update db");
}
// query ID (primary key) of this DB record
$sql = 'SELECT id FROM ' . $users_tab . ' WHERE provider = \'' .$provider. '\' AND uid = \'' .$data->identifier. '\' ';
//$result = $db->Execute($sql, array($data->identifier));
$result = $db->sql_query($sql);
$row = $db->sql_fetchrow($result);
$fields = $row['id'];
if(!$result)
// die("Failed to select from database: " . $db->ErrorMsg());
die("Failed to select id from db ");
return $fields;
}
/* Build the full URI path to the currently requested page. */
function oauth_get_current_uri() {
return 'http' . (oauth_is_https() ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . strtok($_SERVER['REQUEST_URI'], '?');
}
?> |
|
|
|
|
|