[ABD]AlternateLogin(Windows Live,Facebook,OpenID)

Any abandoned MODs will be moved to this forum.

WARNING: MODs in this forum are not currently being supported or maintained by the original MOD author. Proceed at your own risk.
Forum rules
IMPORTANT: MOD Development Forum rules

WARNING: MODs in this forum are not currently being supported nor updated by the original MOD author. Proceed at your own risk.
Locked
Angelionpt
Registered User
Posts: 1
Joined: Fri Aug 12, 2011 7:05 pm

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by Angelionpt »

hi there.I am using a modified version of the style polyethylene.could you please tell me how to apply the mod in this style? if i use the default style (pro silver) it works.but i really wanna use the alternate login on my customized style. I tried to click in details and then "Available Changes prosilver
Apply these changes to this template (my template name)" and still it only works if i use the pro silver skin.
Can you help ?
User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by mjimeyg »

Angelionpt wrote:hi there.I am using a modified version of the style polyethylene.could you please tell me how to apply the mod in this style? if i use the default style (pro silver) it works.but i really wanna use the alternate login on my customized style. I tried to click in details and then "Available Changes prosilver
Apply these changes to this template (my template name)" and still it only works if i use the pro silver skin.
Can you help ?
Unfortunately individual style changes are beyond the scope of the help I can provide.
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image
troubled user
Registered User
Posts: 34
Joined: Tue Jul 26, 2011 7:06 am

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by troubled user »

hey, hows "loginwithgoogle" coming? We're waiting for it. :D :D :D
User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by mjimeyg »

troubled user wrote:hey, hows "loginwithgoogle" coming? We're waiting for it. :D :D :D
Google won't be included in this MOD because it uses OpenID, there is MOD already available for OpenID here:

https://sourceforge.net/projects/phpbb-openid/

This MOD is actually listed in the OpenID site as well. You might want to put a line of text or icon on it somewhere so people know it works with Google, Yahoo and numerous other sites.
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image
User avatar
kateland
Registered User
Posts: 198
Joined: Wed Nov 22, 2006 7:08 pm
Location: Philadelphia, PA
Contact:

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by kateland »

Great mod!! I will be trying it shortly :)
here's your love letter
you bloodletter
you disappointed every time
chiroz223
Registered User
Posts: 44
Joined: Tue Jun 01, 2010 10:28 am

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by chiroz223 »

Its not worked for me. :/
troubled user
Registered User
Posts: 34
Joined: Tue Jul 26, 2011 7:06 am

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by troubled user »

hey, my openID does not show pu. no option to enable it either!!
User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by mjimeyg »

troubled user wrote:hey, my openID does not show pu. no option to enable it either!!
mjimeyg wrote:
troubled user wrote: troubled user wrote:
hey, hows "loginwithgoogle" coming? We're waiting for it.
Google won't be included in this MOD because it uses OpenID, there is MOD already available for OpenID here:

https://sourceforge.net/projects/phpbb-openid/

This MOD is actually listed in the OpenID site as well. You might want to put a line of text or icon on it somewhere so people know it works with Google, Yahoo and numerous other sites.
OpenID has been removed due to there being an approved MOD already available.
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image
kiore
Registered User
Posts: 91
Joined: Wed Aug 26, 2009 1:11 am

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by kiore »

I have a problem when i press the "Connect with Facebook" Button Logged out or in the UCP it takes me to

Code: Select all

http://videogaymers.com/forum/alternatelogin/al_fb_connect.php
and it's just blank, mind help me with my problem?
User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by mjimeyg »

kiore wrote:I have a problem when i press the "Connect with Facebook" Button Logged out or in the UCP it takes me to

Code: Select all

http://videogaymers.com/forum/alternatelogin/al_fb_connect.php
and it's just blank, mind help me with my problem?
Is there any code in the actual file?
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image
kiore
Registered User
Posts: 91
Joined: Wed Aug 26, 2009 1:11 am

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by kiore »

mjimeyg wrote:
kiore wrote:I have a problem when i press the "Connect with Facebook" Button Logged out or in the UCP it takes me to

Code: Select all

http://videogaymers.com/forum/alternatelogin/al_fb_connect.php
and it's just blank, mind help me with my problem?
Is there any code in the actual file?
yeah there is



Code: Select all

<?php
/*
	COPYRIGHT 2009 Michael J Goonawardena

	This file is part of ConSof Alternate Login.

    ConSof Alternate Login is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ConSof Alternate Login is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ConSof Alternate Login.  If not, see <http://www.gnu.org/licenses/>.*/


// Basic setup of phpBB variables.
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

// Load include files.
include($phpbb_root_path . 'common.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_alternatelogin.' . $phpEx);	// Custom Alternate Login functions.

// Set up a new user session.
$user->session_begin();
$auth->acl($user->data);
$user->setup('ucp');
$user->add_lang('mods/alternatelogin');	// Global Alternate Login language file.
$user->add_lang('mods/info_ucp_alternatelogin');


// Make sure that Facebook login is enabled for this site.
if($config['al_fb_login'] == 0)
{
	// Inform the user that this feature is unavailable
	trigger_error(sprintf($user->lang['AL_LOGIN_UNAVAILABLE'], $user->lang['FACEBOOK']));
}


$access_token = get_fb_access_token();

//echo 'token:' . print_r($token_url);
$graph_url = "https://graph.facebook.com/me?" . $access_token;

$fb_user = json_decode(file_get_contents($graph_url));

//echo("Hello " . $fb_user->name);
//print_r($fb_user);
// Check to see if we have a valid Facebook user.
if(!$fb_user)
{
    //echo 'error';
	// Inform the user that we couldn't get their Facebook Id.
	trigger_error(sprintf($user->lang['AL_CONNECT_FAILURE'], $user->lang['FACEBOOK']));
}

// Select the user_id from the Alternate Login user data table which has the same Facebook Id.
$sql_array = array(
    'SELECT'    => 'user_id',
    'FROM'      => array(
        USERS_TABLE => 'u',
        ),
    'WHERE'     => 'al_fb_id=' . $fb_user->id,
);

$sql = $db->sql_build_query('SELECT', $sql_array);

// Execute the query.
$result = $db->sql_query($sql);

// Retrieve the row data.
$row = $db->sql_fetchrow($result);

// Free up the result handle from the query.
$db->sql_freeresult($result);

// Check to see if we found a user_id with the associated Facebook Id.
if ($row)   // User is registered already, let's log him in!
{
	// Check for user ban.
	if($user->check_ban($row['user_id']))
	{
		trigger_error($user->lang['BAN_TRIGGERED_BY_USER']);
	}

	// Log user in.
	$result = $user->session_create($row['user_id'], 0, 0, 1);

	// Alert user if we failed to log them in.
	if(!$result)
	{
		trigger_error($user->lang['LOGIN_FAILURE']);
	}

        // Store the access token for use with this session.
        $sql_array = array(
            'session_fb_access_token'   => $access_token,
        );

        $sql = "UPDATE " . SESSIONS_TABLE . " SET " . $db->sql_build_array('UPDATE', $sql_array) . " WHERE session_user_id=" . $user->data['user_id'];

        $db->sql_query($sql);
        $data = array();
        // Update the stored data such as profile and signatures.  Avatar is a dynamic field and doesn't require changing.
        
        if($user->data['al_fb_profile_sync'])
        {
            
            $graph_url = "https://graph.facebook.com/me?" . $access_token;

            $fb_user = json_decode(file_get_contents($graph_url));
            
            $data['user_website']                    = (!$fb_user->website) ? '' : $fb_user->website;
            $data['user_from']                   = (!$fb_user->location->name) ? '' : $fb_user->location->name;
            $data['user_occ']                 = (!$fb_user->work[0]->employer->name) ? '' : $fb_user->work[0]->employer->name;
            $bday = explode('/', $fb_user->birthday);
            $data['user_birthday']              = sprintf('%2d-%2d-%4d', $bday[1], $bday[0], $bday[2]);

        }
        
        if($user->data['al_fb_status_sync'])
        {
            include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
            $graph_url = "https://graph.facebook.com/me/statuses?" . $access_token;

            $fb_user = json_decode(file_get_contents($graph_url));

            $signature = $fb_user->data[0]->message;
            
            $enable_bbcode                      = ($config['allow_sig_bbcode']) ? (bool) $user->optionget('sig_bbcode') : false;
            $enable_smilies                     = ($config['allow_sig_smilies']) ? (bool) $user->optionget('sig_smilies') : false;
            $enable_urls                        = ($config['allow_sig_links']) ? (bool) $user->optionget('sig_links') : false;

            $message_parser = new parse_message($signature);

            // Allowing Quote BBCode
            $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');

            $data['user_sig']                   = (string) $message_parser->message;
            $data['user_options']               = $user->data['user_options'];
            $data['user_sig_bbcode_uid']	= (string) $message_parser->bbcode_uid;
            $data['user_sig_bbcode_bitfield']	= $message_parser->bbcode_bitfield;
        }

        if($user->data['al_fb_profile_sync'] || $user->data['al_fb_status_sync'])
        {
            $sql = 'UPDATE ' . USERS_TABLE . '
                    SET ' . $db->sql_build_array('UPDATE', $data) . '
                    WHERE user_id = ' . $user->data['user_id'];
            
            $db->sql_query($sql);
        }

	trigger_error(sprintf($user->lang['LOGIN_SUCCESS'] . "<br /><br />" . sprintf($user->lang['RETURN_INDEX'], "<a href='{$phpbb_root_path}index.php'>", "</a>")));


}
else
{
	// No user was registered with the associate Facebook Id.
	// We need to see if they are anonymous.
	// If they are then that means they might want to register.
	// We will check to see if they wish to register.
	if($user->data['user_id'] == ANONYMOUS)
	{
		if(confirm_box(true))
		{
			// Most of this code comes straight out of ucp_register.php
			$message = 'TERMS_OF_USE_CONTENT';
			$title = 'TERMS_USE';

			if (empty($user->lang[$message]))
			{
				if ($user->data['is_registered'])
				{
					redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
				}

				login_box();
			}

			$template->set_filenames(array(
				'body'		=> 'ucp_agreement.html')
			);

			// Disable online list
			page_header($user->lang[$title], false);

			$s_hidden_fields = array(	'al_login' 		=> 1,
										'al_login_type'	=> AL_FACEBOOK_LOGIN,
										'al_fb_user'	=> $fb_user->id
			);

			$coppa				= (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
				if ($coppa === false && $config['coppa_enable'])
				{
					$now = getdate();
					$coppa_birthday = $user->format_date(mktime($now['hours'] + $user->data['user_dst'], $now['minutes'], $now['seconds'], $now['mon'], $now['mday'] - 1, $now['year'] - 13), $user->lang['DATE_FORMAT']);
					unset($now);

					$template->assign_vars(array(
						'L_COPPA_NO'		=> sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday),
						'L_COPPA_YES'		=> sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday),

						'U_COPPA_NO'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0' . $add_lang),
						'U_COPPA_YES'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1' . $add_lang),

						'S_SHOW_COPPA'		=> true,
						'S_HIDDEN_FIELDS'	=> build_hidden_fields($s_hidden_fields),
						'S_UCP_ACTION'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang),
					));
				}
				else
				{
					$template->assign_vars(array(
						'L_TERMS_OF_USE'	=> sprintf($user->lang['TERMS_OF_USE_CONTENT'], $config['sitename'], generate_board_url()),

						'S_SHOW_COPPA'		=> false,
						'S_REGISTRATION'	=> true,
						'S_HIDDEN_FIELDS'	=> build_hidden_fields($s_hidden_fields),
						'S_UCP_ACTION'		=> append_sid("{$phpbb_root_path}alternatelogin/al_fb_registration.$phpEx", 'mode=register' . $add_lang . $add_coppa),
						)
					);
				}

			page_footer();
		}
		else
		{
			confirm_box(false, sprintf($user->lang['AL_REGISTER_QUERY'], $user->lang['FACEBOOK']));
			// They said no so send them to the home page.
			redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
		}
	}
	else
	{
		// If they are not anonymous then we can assume they are current users wishing
		// to link their accounts.

		

		// Did we get data, if yes then the user has another account registered.
		// We need to unlink that account as well.
                $sql_array = array(
                    'al_fb_id'      => $fb_user->id,
                    'al_wl_id'      => 0,
                    'al_oi_id'      => 0,
                );

                // Prepare the query to update the users Alternate Login record.
                $sql = 'UPDATE ' . USERS_TABLE
                . " SET " . $db->sql_build_array('UPDATE', $sql_array)
                . " WHERE user_id='{$user->data['user_id']}'";


                // Execute the query.
		$result = $db->sql_query($sql);

                if(!$result)
		{
			trigger_error($user->lang['AL_PHPBB_DB_FAILURE']);
		}

                $sql_array = array(
                    'user_password' => phpbb_hash(substr(md5($fb_user->id . $config['al_fb_key'] . $config['al_fb_secret']), 0, $config['max_pass_chars'])),
                );

                $sql = "UPDATE " . USERS_TABLE .
                        " SET " . $db->sql_build_array('UPDATE', $sql_array) .
                        " WHERE user_id=" . (int)$user->data['user_id'];



		// Execute the query.
		$result = $db->sql_query($sql);

		// Tell the user if they suceeded or not.
		if(!$result)
		{
			trigger_error($user->lang['AL_PHPBB_DB_FAILURE']);
		}
		else
		{
			trigger_error(sprintf($user->lang['AL_LINK_SUCCESS'], $user->lang['FACEBOOK'], $user->lang['FACEBOOK']));
		}
	}

}

?>
User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by mjimeyg »

kiore wrote:
mjimeyg wrote:
kiore wrote:I have a problem when i press the "Connect with Facebook" Button Logged out or in the UCP it takes me to

Code: Select all

http://videogaymers.com/forum/alternatelogin/al_fb_connect.php
and it's just blank, mind help me with my problem?
Is there any code in the actual file?
yeah there is



Code: Select all

<?php
/*
	COPYRIGHT 2009 Michael J Goonawardena

	This file is part of ConSof Alternate Login.

    ConSof Alternate Login is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    ConSof Alternate Login is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with ConSof Alternate Login.  If not, see <http://www.gnu.org/licenses/>.*/


// Basic setup of phpBB variables.
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../';
$phpEx = substr(strrchr(__FILE__, '.'), 1);

// Load include files.
include($phpbb_root_path . 'common.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
include_once($phpbb_root_path . 'includes/functions_alternatelogin.' . $phpEx);	// Custom Alternate Login functions.

// Set up a new user session.
$user->session_begin();
$auth->acl($user->data);
$user->setup('ucp');
$user->add_lang('mods/alternatelogin');	// Global Alternate Login language file.
$user->add_lang('mods/info_ucp_alternatelogin');


// Make sure that Facebook login is enabled for this site.
if($config['al_fb_login'] == 0)
{
	// Inform the user that this feature is unavailable
	trigger_error(sprintf($user->lang['AL_LOGIN_UNAVAILABLE'], $user->lang['FACEBOOK']));
}


$access_token = get_fb_access_token();

//echo 'token:' . print_r($token_url);
$graph_url = "https://graph.facebook.com/me?" . $access_token;

$fb_user = json_decode(file_get_contents($graph_url));

//echo("Hello " . $fb_user->name);
//print_r($fb_user);
// Check to see if we have a valid Facebook user.
if(!$fb_user)
{
    //echo 'error';
	// Inform the user that we couldn't get their Facebook Id.
	trigger_error(sprintf($user->lang['AL_CONNECT_FAILURE'], $user->lang['FACEBOOK']));
}

// Select the user_id from the Alternate Login user data table which has the same Facebook Id.
$sql_array = array(
    'SELECT'    => 'user_id',
    'FROM'      => array(
        USERS_TABLE => 'u',
        ),
    'WHERE'     => 'al_fb_id=' . $fb_user->id,
);

$sql = $db->sql_build_query('SELECT', $sql_array);

// Execute the query.
$result = $db->sql_query($sql);

// Retrieve the row data.
$row = $db->sql_fetchrow($result);

// Free up the result handle from the query.
$db->sql_freeresult($result);

// Check to see if we found a user_id with the associated Facebook Id.
if ($row)   // User is registered already, let's log him in!
{
	// Check for user ban.
	if($user->check_ban($row['user_id']))
	{
		trigger_error($user->lang['BAN_TRIGGERED_BY_USER']);
	}

	// Log user in.
	$result = $user->session_create($row['user_id'], 0, 0, 1);

	// Alert user if we failed to log them in.
	if(!$result)
	{
		trigger_error($user->lang['LOGIN_FAILURE']);
	}

        // Store the access token for use with this session.
        $sql_array = array(
            'session_fb_access_token'   => $access_token,
        );

        $sql = "UPDATE " . SESSIONS_TABLE . " SET " . $db->sql_build_array('UPDATE', $sql_array) . " WHERE session_user_id=" . $user->data['user_id'];

        $db->sql_query($sql);
        $data = array();
        // Update the stored data such as profile and signatures.  Avatar is a dynamic field and doesn't require changing.
        
        if($user->data['al_fb_profile_sync'])
        {
            
            $graph_url = "https://graph.facebook.com/me?" . $access_token;

            $fb_user = json_decode(file_get_contents($graph_url));
            
            $data['user_website']                    = (!$fb_user->website) ? '' : $fb_user->website;
            $data['user_from']                   = (!$fb_user->location->name) ? '' : $fb_user->location->name;
            $data['user_occ']                 = (!$fb_user->work[0]->employer->name) ? '' : $fb_user->work[0]->employer->name;
            $bday = explode('/', $fb_user->birthday);
            $data['user_birthday']              = sprintf('%2d-%2d-%4d', $bday[1], $bday[0], $bday[2]);

        }
        
        if($user->data['al_fb_status_sync'])
        {
            include($phpbb_root_path . 'includes/message_parser.' . $phpEx);
            $graph_url = "https://graph.facebook.com/me/statuses?" . $access_token;

            $fb_user = json_decode(file_get_contents($graph_url));

            $signature = $fb_user->data[0]->message;
            
            $enable_bbcode                      = ($config['allow_sig_bbcode']) ? (bool) $user->optionget('sig_bbcode') : false;
            $enable_smilies                     = ($config['allow_sig_smilies']) ? (bool) $user->optionget('sig_smilies') : false;
            $enable_urls                        = ($config['allow_sig_links']) ? (bool) $user->optionget('sig_links') : false;

            $message_parser = new parse_message($signature);

            // Allowing Quote BBCode
            $message_parser->parse($enable_bbcode, $enable_urls, $enable_smilies, $config['allow_sig_img'], $config['allow_sig_flash'], true, $config['allow_sig_links'], true, 'sig');

            $data['user_sig']                   = (string) $message_parser->message;
            $data['user_options']               = $user->data['user_options'];
            $data['user_sig_bbcode_uid']	= (string) $message_parser->bbcode_uid;
            $data['user_sig_bbcode_bitfield']	= $message_parser->bbcode_bitfield;
        }

        if($user->data['al_fb_profile_sync'] || $user->data['al_fb_status_sync'])
        {
            $sql = 'UPDATE ' . USERS_TABLE . '
                    SET ' . $db->sql_build_array('UPDATE', $data) . '
                    WHERE user_id = ' . $user->data['user_id'];
            
            $db->sql_query($sql);
        }

	trigger_error(sprintf($user->lang['LOGIN_SUCCESS'] . "<br /><br />" . sprintf($user->lang['RETURN_INDEX'], "<a href='{$phpbb_root_path}index.php'>", "</a>")));


}
else
{
	// No user was registered with the associate Facebook Id.
	// We need to see if they are anonymous.
	// If they are then that means they might want to register.
	// We will check to see if they wish to register.
	if($user->data['user_id'] == ANONYMOUS)
	{
		if(confirm_box(true))
		{
			// Most of this code comes straight out of ucp_register.php
			$message = 'TERMS_OF_USE_CONTENT';
			$title = 'TERMS_USE';

			if (empty($user->lang[$message]))
			{
				if ($user->data['is_registered'])
				{
					redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
				}

				login_box();
			}

			$template->set_filenames(array(
				'body'		=> 'ucp_agreement.html')
			);

			// Disable online list
			page_header($user->lang[$title], false);

			$s_hidden_fields = array(	'al_login' 		=> 1,
										'al_login_type'	=> AL_FACEBOOK_LOGIN,
										'al_fb_user'	=> $fb_user->id
			);

			$coppa				= (isset($_REQUEST['coppa'])) ? ((!empty($_REQUEST['coppa'])) ? 1 : 0) : false;
				if ($coppa === false && $config['coppa_enable'])
				{
					$now = getdate();
					$coppa_birthday = $user->format_date(mktime($now['hours'] + $user->data['user_dst'], $now['minutes'], $now['seconds'], $now['mon'], $now['mday'] - 1, $now['year'] - 13), $user->lang['DATE_FORMAT']);
					unset($now);

					$template->assign_vars(array(
						'L_COPPA_NO'		=> sprintf($user->lang['UCP_COPPA_BEFORE'], $coppa_birthday),
						'L_COPPA_YES'		=> sprintf($user->lang['UCP_COPPA_ON_AFTER'], $coppa_birthday),

						'U_COPPA_NO'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=0' . $add_lang),
						'U_COPPA_YES'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register&coppa=1' . $add_lang),

						'S_SHOW_COPPA'		=> true,
						'S_HIDDEN_FIELDS'	=> build_hidden_fields($s_hidden_fields),
						'S_UCP_ACTION'		=> append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=register' . $add_lang),
					));
				}
				else
				{
					$template->assign_vars(array(
						'L_TERMS_OF_USE'	=> sprintf($user->lang['TERMS_OF_USE_CONTENT'], $config['sitename'], generate_board_url()),

						'S_SHOW_COPPA'		=> false,
						'S_REGISTRATION'	=> true,
						'S_HIDDEN_FIELDS'	=> build_hidden_fields($s_hidden_fields),
						'S_UCP_ACTION'		=> append_sid("{$phpbb_root_path}alternatelogin/al_fb_registration.$phpEx", 'mode=register' . $add_lang . $add_coppa),
						)
					);
				}

			page_footer();
		}
		else
		{
			confirm_box(false, sprintf($user->lang['AL_REGISTER_QUERY'], $user->lang['FACEBOOK']));
			// They said no so send them to the home page.
			redirect(append_sid("{$phpbb_root_path}index.$phpEx"));
		}
	}
	else
	{
		// If they are not anonymous then we can assume they are current users wishing
		// to link their accounts.

		

		// Did we get data, if yes then the user has another account registered.
		// We need to unlink that account as well.
                $sql_array = array(
                    'al_fb_id'      => $fb_user->id,
                    'al_wl_id'      => 0,
                    'al_oi_id'      => 0,
                );

                // Prepare the query to update the users Alternate Login record.
                $sql = 'UPDATE ' . USERS_TABLE
                . " SET " . $db->sql_build_array('UPDATE', $sql_array)
                . " WHERE user_id='{$user->data['user_id']}'";


                // Execute the query.
		$result = $db->sql_query($sql);

                if(!$result)
		{
			trigger_error($user->lang['AL_PHPBB_DB_FAILURE']);
		}

                $sql_array = array(
                    'user_password' => phpbb_hash(substr(md5($fb_user->id . $config['al_fb_key'] . $config['al_fb_secret']), 0, $config['max_pass_chars'])),
                );

                $sql = "UPDATE " . USERS_TABLE .
                        " SET " . $db->sql_build_array('UPDATE', $sql_array) .
                        " WHERE user_id=" . (int)$user->data['user_id'];



		// Execute the query.
		$result = $db->sql_query($sql);

		// Tell the user if they suceeded or not.
		if(!$result)
		{
			trigger_error($user->lang['AL_PHPBB_DB_FAILURE']);
		}
		else
		{
			trigger_error(sprintf($user->lang['AL_LINK_SUCCESS'], $user->lang['FACEBOOK'], $user->lang['FACEBOOK']));
		}
	}

}

?>
At this point all I can recommend is attempting to reinstall.
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image
Markus89
Registered User
Posts: 4
Joined: Wed Aug 17, 2011 9:13 pm

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by Markus89 »

Hi, I have read all the discussion, but I can't find a solution to this problem:

I click on the facebook login button, then I authorize the apps in facebook ,but when I return on the forum page, I can't connect to it and I have this error message:

Code: Select all

[phpBB Debug] PHP Notice: in file /alternatelogin/al_fb_connect.php on line 52: file_get_contents(https://graph.facebook.com/me?access_token=249234968443073|2.AQDDFPxLxoJ3O5mR.3600.1314216000.1-1543054992|sloKmY8ehcRyETv7S5suqhZRVVk&expires=5085) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden 
User avatar
mjimeyg
Registered User
Posts: 840
Joined: Sat Aug 29, 2009 7:38 pm
Location: London

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by mjimeyg »

Markus89 wrote:Hi, I have read all the discussion, but I can't find a solution to this problem:

I click on the facebook login button, then I authorize the apps in facebook ,but when I return on the forum page, I can't connect to it and I have this error message:

Code: Select all

[phpBB Debug] PHP Notice: in file /alternatelogin/al_fb_connect.php on line 52: file_get_contents(https://graph.facebook.com/me?access_token=249234968443073|2.AQDDFPxLxoJ3O5mR.3600.1314216000.1-1543054992|sloKmY8ehcRyETv7S5suqhZRVVk&expires=5085) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden 
Can you point me to your site?
Questions answered via forums only, no pms or emails. Thank you.

ConSof Alternate Login for phpBB

Image Image
Markus89
Registered User
Posts: 4
Joined: Wed Aug 17, 2011 9:13 pm

Re: [BETA]AlternateLogin(Windows Live,Facebook)

Post by Markus89 »

mjimeyg wrote: Can you point me to your site?
Yes :)

werules.altervista.org/forum/index.php
Locked

Return to “[3.0.x] Abandoned MODs”