Latest News: (loading..)
Sign in to follow this  
Followers 0
anderskiel

pbpBB2 and osC shared account creation

214 posts in this topic

Here is my new one:

:

:

'<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'trans_phpbb.php">' . BOX_INFORMATION_PHPBB . '</a>').

:

:

Any idea???

Daniel

change that line to:

'<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'trans_phpbb.php">' . BOX_INFORMATION_PHPBB . '</a><br>'.

Share this post


Link to post
Share on other sites
change that line to:

'<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'trans_phpbb.php">' . BOX_INFORMATION_PHPBB . '</a><br>'.

 

Thanks Alex, it worked :D :D :D

I should have seen it by my own :blush:

 

Daniel

Share this post


Link to post
Share on other sites

Alex

 

I've added another "trans_phpbb.php" to go with another link under "Forum" in information box to send user to the portal page. Is this necessary or could I just do a direct link ?

 

so my information.php look's like this :

 

//// BOF phpBB2 Integration v1.0

'<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a><br>' .

'<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'trans_phpbb.php">' . BOX_INFORMATION_PHPBB . '</a><br>' .

'<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'trans2_phpbb.php">' . BOX_INFORMATION_PORTAL . '</a>');

//// EOF phpBB2 Integration v1.0

 

What does the trans_php file actually do ?

 

The portal_body.php you gave me for the login box works perfectly but the text "email_address" doesn't show up, where should I actually define this variable ?

Share this post


Link to post
Share on other sites
Alex

 

I've added another "trans_phpbb.php" to go with another link under "Forum" in information box to send user to the portal page. Is this necessary or could I just do a direct link ?

 

so my information.php look's like this :

 

//// BOF phpBB2 Integration v1.0

'<a href="' . tep_href_link(FILENAME_CONTACT_US) . '">' . BOX_INFORMATION_CONTACT . '</a><br>' .

'<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'trans_phpbb.php">' . BOX_INFORMATION_PHPBB . '</a><br>' .

'<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'trans2_phpbb.php">' . BOX_INFORMATION_PORTAL . '</a>');

//// EOF phpBB2 Integration v1.0

 

What does the trans_php file actually do ?

trans_phpbb.php is the 'bridge' from osC to phpBB2, and it can be used for any file in phpbb2 directory. It will send users to phpbb2/index.php if no redirect target given. In your case, using trans_phpbb.php to redirect users to phpbb2/portal.php, just add a redirect target to it:
'<a href="' . HTTP_SERVER . DIR_WS_HTTP_CATALOG . 'trans_phpbb.php?redirect=portal.php">' . BOX_INFORMATION_PORTAL . '</a>'

will do the trick. If the users are logged in with osC, trans_phpbb.php will add the session id to the url and login users to phpbb2 automatically.

 

The portal_body.php you gave me for the login box works perfectly but the text "email_address" doesn't show up, where should I actually define this variable ?
It's in the file phpbb2/templates/subSilverPlus/portal_body.tpl, find:
{L_USERNAME}:<br /><input class="text" type="text" name="username" size="15" /><br />

and replace with:

{L_USERNAME_EMAIL}:<br /><input class="text" type="text" name="email_address" size="15" /><br />

Share this post


Link to post
Share on other sites

A new problem occured.

After creating a new account in the shop I get an error message in /catalog/create_account.php

 

1062 - Duplicate entry '2' for key 1

 

insert into phpbb_users (user_id, user_active, username, user_password, user_session_time, user_session_page, user_lastvisit, user_regdate, user_level, user_posts, user_timezone, user_style, user_lang, user_dateformat, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_emailtime, user_viewemail, user_attachsig, user_allowhtml, user_allowbbcode, user_allowsmile, user_allowavatar, user_allow_pm, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_rank, user_avatar, user_avatar_type, user_email, user_icq, user_website, user_sig, user_sig_bbcode_uid, user_aim, user_yim, user_msnm, user_occ, user_interests, user_actkey, user_newpasswd) values ('2', '1', 'Daniel', 'c7c57c6fd950aacc8aaabea4ee96e7d7', '1167775131', '0', '', '1167775131', '0', '0', '0', '0', 'danish', 'D M d, Y g:i a', '0', '0', '0', '', '0', '1', '0', '1', '1', '1', '1', '1', '0', '1', '1', '0', '', '0', 'my@mail.de', '', '', '', '', '', '', '', '', '', '', '')

 

Do you have any idea?

 

Daniel

Share this post


Link to post
Share on other sites
The portal_body.php you gave me for the login box works perfectly but the text "email_address" doesn't show up, where should I actually define this variable ?
Sorry it is in phpbb2/includes/page_header.php, find:
	'L_USERNAME' => $lang['Username'],

add after:

//// BOF osCommerce phpBB2 Integration v1.0
'L_USERNAME_EMAIL' => $lang['Username_Email'],
//// EOF osCommerce phpBB2 Integration v1.0

Share this post


Link to post
Share on other sites
A new problem occured.

After creating a new account in the shop I get an error message in /catalog/create_account.php

 

1062 - Duplicate entry '2' for key 1

 

insert into phpbb_users (user_id, user_active, username, user_password, user_session_time, user_session_page, user_lastvisit, user_regdate, user_level, user_posts, user_timezone, user_style, user_lang, user_dateformat, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_emailtime, user_viewemail, user_attachsig, user_allowhtml, user_allowbbcode, user_allowsmile, user_allowavatar, user_allow_pm, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_rank, user_avatar, user_avatar_type, user_email, user_icq, user_website, user_sig, user_sig_bbcode_uid, user_aim, user_yim, user_msnm, user_occ, user_interests, user_actkey, user_newpasswd) values ('2', '1', 'Daniel', 'c7c57c6fd950aacc8aaabea4ee96e7d7', '1167775131', '0', '', '1167775131', '0', '0', '0', '0', 'danish', 'D M d, Y g:i a', '0', '0', '0', '', '0', '1', '0', '1', '1', '1', '1', '1', '0', '1', '1', '0', '', '0', 'my@mail.de', '', '', '', '', '', '', '', '', '', '', '')

 

Do you have any idea?

 

Daniel

Yup, this is the #1 user_id issue addressed in the install guide. The #1 user_id created by phpBB2 installation actually is 2, not 1. You can delete that user in database table phpbb_users and then register a new account in osC. I will revise the install guide to clear this up.

Share this post


Link to post
Share on other sites
Yup, this is the #1 user_id issue addressed in the install guide. The #1 user_id created by phpBB2 installation actually is 2, not 1. You can delete that user in database table phpbb_users and then register a new account in osC. I will revise the install guide to clear this up.

 

Alex, thank you.

I deleted the user in the database. I have seen that the admin was createt with # -1 not with 1.

Would you be so kind and advise me how to change it or to send me a new install guide.

Thanks, Daniel

Share this post


Link to post
Share on other sites
Alex, thank you.

I deleted the user in the database. I have seen that the admin was createt with # -1 not with 1.

Would you be so kind and advise me how to change it or to send me a new install guide.

Thanks, Daniel

Don't touch that user_id = -1 record, it's for guest users (Anonymous).

 

osC installation creates an account with customer_id=1, named John Doe. phpBB2 installation creates 2 accounts, one user_id=-1 for ANONYMOUS users, and the other user_id=2 for site owner with admin privilege.

 

Either you create a new account in osC prior to install this contrib, or delete that user_id=2 admin account in phpBB, will get rid of this issue.

 

If you chose to delete the user_id=2 admin account in phpBB, you would better create a new account after this contrib installed, and user_id=2 will be assigned to this new account if it's customer_id=2. You can then change that user_level to 1 to have admin privilege.

Share this post


Link to post
Share on other sites

I too was confused by this.

 

The way I do it now is to install oscommerce first, then instantly delete John Doe and create a new user which will be the root login he will get customer_id 2

 

then when you install phpbb2 it will give your admin user user_id 2 by default so no need to change anything in phpMyAdmin

Share this post


Link to post
Share on other sites
I too was confused by this.

 

The way I do it now is to install oscommerce first, then instantly delete John Doe and create a new user which will be the root login he will get customer_id 2

 

then when you install phpbb2 it will give your admin user user_id 2 by default so no need to change anything in phpMyAdmin

 

Alex, Ross,

Thankl for your assistance! I'll try it and let you know.

Daniel

Share this post


Link to post
Share on other sites

Alex

 

When I go onto the forum as a guest and click on for example the memberlist and try to click on any user - The login section comes up as it should and I fill in and click login - it then takes me back to the the forum ! is it possible for the file to remember where the user wanted to go (members profile section) instead of defaulting to main forum page ?

 

Ross

Share this post


Link to post
Share on other sites

Alex

 

I'm in the process of installing "Paypal WPP Direct Payments & Express Checkout contrib" which actually creates a new user account in oscommerce based on info provided by Paypal - since your contrib has added a new field "User name" for forum purposes is this going to upset the WPP contrib when it automatically creates these new accounts ?

 

based on the information returned from Paypal, an account will automatically be created for them and the account details emailed to their email address

 

Ross

Share this post


Link to post
Share on other sites

Alex

 

a question for you, if I delete a user in oscommerce admin the synchronisation between database users get's out of whack ie "customer_id" and "user_id" don't match anymore. so it means if I login with one user in oscommerce and go into the forum it's logged in with a diff user !

 

Is there any way that when you delete a cust from oscommerce it also deletes the appropriate account in phpbb2 ? or should I just never delete any users.

 

sorry for so many queries but I'll be using this great contrib and I want it working perfectly and securely.

 

Ross

Share this post


Link to post
Share on other sites
Alex

 

a question for you, if I delete a user in oscommerce admin the synchronisation between database users get's out of whack ie "customer_id" and "user_id" don't match anymore. so it means if I login with one user in oscommerce and go into the forum it's logged in with a diff user !

 

Is there any way that when you delete a cust from oscommerce it also deletes the appropriate account in phpbb2 ? or should I just never delete any users.

 

sorry for so many queries but I'll be using this great contrib and I want it working perfectly and securely.

 

Ross

If you delete a customer account in osC, you need to delete the corresponding user in phpbb, and all his posts as well. I will include this feature in next update, which to delete customers in osC admin and clean up all corresponding records in phpbb2.

Share this post


Link to post
Share on other sites
Alex

 

I'm in the process of installing "Paypal WPP Direct Payments & Express Checkout contrib" which actually creates a new user account in oscommerce based on info provided by Paypal - since your contrib has added a new field "User name" for forum purposes is this going to upset the WPP contrib when it automatically creates these new accounts ?

Ross

I don't see any problem with that.

Share this post


Link to post
Share on other sites
Alex

 

When I go onto the forum as a guest and click on for example the memberlist and try to click on any user - The login section comes up as it should and I fill in and click login - it then takes me back to the the forum ! is it possible for the file to remember where the user wanted to go (members profile section) instead of defaulting to main forum page ?

 

Ross

phpBB2 doesn't have that feature. In the genuine phpBB2, you always get to the index page after login. Only those pages require login will send guest users to login and then send them back. I have done this with the private message and user profile pages. If you find any pages else which send users to login but not back to it, please let me know.

Share this post


Link to post
Share on other sites

Hi Alex

 

can you tell me which file I should look at when I want to change the redirect after login. As you may remember I need to change index.php to portal.php as that is my main page.

 

I've looked through login.php and changed them all in there but I'm still being sent to index.php ??

 

Thanks

 

Ross

Share this post


Link to post
Share on other sites
can you tell me which file I should look at when I want to change the redirect after login. As you may remember I need to change index.php to portal.php as that is my main page.

 

I've looked through login.php and changed them all in there but I'm still being sent to index.php ??

It's in the phpbb2/includes/page_header.php around line 75:

//
// Generate logged in/logged out status
//
if ( $userdata['session_logged_in'] )
{
  $u_login_logout = 'login.'.$phpEx.'?logout=true&sid=' . $userdata['session_id'];
$l_login_logout = $lang['Logout'] . ' [ ' . $userdata['username'] . ' ]';
}
else
{
//// BOF osCommerce phpBB2 Integration v1.0
//	$u_login_logout = 'login.'.$phpEx;
$u_login_logout = HTTPS_SERVER . DIR_WS_HTTP_CATALOG . 'login.php?redirect=index.php';
//// BOF osCommerce phpBB2 Integration v1.0
$l_login_logout = $lang['Login'];
}

you need to change that 'login.php?redirect=index.php' to something else you want.

 

hope this helps.

Share this post


Link to post
Share on other sites
Excellent that's sorted my Login, but the "logout" is still going to index.php.

hmmm....this portal stuff is really tricky... :blink:

 

Here is a try-out, in your phpbb2/login.php (the one modified by this contrib) around line 205:

			header('Location: ' .HTTPS_SERVER . DIR_WS_HTTP_CATALOG . 'logoff.php?redirect=index.php&osCsid=' . $osCsid);

Do the same thing as you did to the login redirect target, I think it will work. Let me know if it didn't. ;)

Share this post


Link to post
Share on other sites

can any one help me I seem to be getting this error message when try to register.

 

insert into phpbb_users (user_id, user_active, username, user_password, user_session_time, user_session_page, user_lastvisit, user_regdate, user_level, user_posts, user_timezone, user_style, user_lang, user_dateformat, user_new_privmsg, user_unread_privmsg, user_last_privmsg, user_emailtime, user_viewemail, user_attachsig, user_allowhtml, user_allowbbcode, user_allowsmile, user_allowavatar, user_allow_pm, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_rank, user_avatar, user_avatar_type, user_email, user_icq, user_website, user_sig, user_sig_bbcode_uid, user_aim, user_yim, user_msnm, user_occ, user_interests, user_actkey, user_newpasswd) values ('3', '1', 'OptimalKiller', 'c19db471ac6e12cdcff7816477d1222d', '1169076903', '0', '', '1169076903', '0', '0', '0', '0', 'danish', 'D M d, Y g:i a', '0', '0', '0', '', '0', '1', '0', '1', '1', '1', '1', '1', '0', '1', '1', '0', '', '0', 'optimalkiller@optimalkiller.com', '', '', '', '', '', '', '', '', '', '', '')

 

[TEP STOP]

 

it seem to register my details under custerms database but nothing is listed in the phpbb users table. Also can seem one explain about the user id value as I'm not sure whoch one to delete. any help would be appreciated.

Share this post


Link to post
Share on other sites

problem fixed

 

The "Out of range value adjusted for column ..." mysql errors are due to MySQL 5 running with a strict sql-mode.

 

 

You need to edit /etc/my.cnf and change sql-mode to something like:

 

sql-mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

 

Problem now fixed. still need help with this user thing!!!!

Share this post


Link to post
Share on other sites

Do you mean within this block ? :

 

//// BOF phpBB2 Integration v1.0

$login_action = 'action=process';

if( isset($HTTP_GET_VARS['redirect']) ) {

$forward_to = $HTTP_SERVER_VARS['QUERY_STRING'];

if( preg_match("/redirect=([a-z0-9\.#\/\?&=\+\-_]+)/si", $forward_to, $forward_matches) ) {

$forward_to = $forward_matches[0];

$forward_match = explode('&', $forward_to);

if(count($forward_match) > 1) {

for($i = 1; $i < count($forward_match); $i++) {

if( !ereg("sid=", $forward_match[$i]) ) {

if( $forward_page != '' ) $forward_page .= '&';

$forward_page .= $forward_match[$i];

}

}

$forward_page = $forward_match[0] . '&' . $forward_page;

} else $forward_page = $forward_match[0];

}

$forward_page = str_replace('?', '&', $forward_page);

$login_action = $login_action . '&' . $forward_page;

}

//// EOF phpBB2 Integration v1.0

 

I know your telling me it's tricky !!! I've been at it since christmas lol but I really appreciate your help - I've pestered you alot sorry. I will leave you alone soon I promise ;)

Share this post


Link to post
Share on other sites
Do you mean within this block ? :

 

//// BOF phpBB2 Integration v1.0

$login_action = 'action=process';

if( isset($HTTP_GET_VARS['redirect']) ) {

$forward_to = $HTTP_SERVER_VARS['QUERY_STRING'];

if( preg_match("/redirect=([a-z0-9\.#\/\?&=\+\-_]+)/si", $forward_to, $forward_matches) ) {

$forward_to = $forward_matches[0];

$forward_match = explode('&', $forward_to);

if(count($forward_match) > 1) {

for($i = 1; $i < count($forward_match); $i++) {

if( !ereg("sid=", $forward_match[$i]) ) {

if( $forward_page != '' ) $forward_page .= '&';

$forward_page .= $forward_match[$i];

}

}

$forward_page = $forward_match[0] . '&' . $forward_page;

} else $forward_page = $forward_match[0];

}

$forward_page = str_replace('?', '&', $forward_page);

$login_action = $login_action . '&' . $forward_page;

}

//// EOF phpBB2 Integration v1.0

 

I know your telling me it's tricky !!! I've been at it since christmas lol but I really appreciate your help - I've pestered you alot sorry. I will leave you alone soon I promise ;)

wrong file man..... try phpbb2/login.php...... :(

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0