cpg1.5.34 bridged with phpbb 3.1.3 but after login no access to gallery cpg1.5.34 bridged with phpbb 3.1.3 but after login no access to gallery
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

cpg1.5.34 bridged with phpbb 3.1.3 but after login no access to gallery

Started by zorbas2, February 09, 2015, 04:20:54 PM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

zorbas2

I have the following issue when trying to bridge coppermine and phpBB3:
[error message or problem description here]

Coppermine install: http://www.zorbas.de/scripts/cpgGallery/
Bridging app install: http://www.zorbas.de/scripts/cpgGallery/
Coppermine version: cpg1.5.34
Bridging app version: phpBB 3.1.3
Test user account: testuser / usertest

BridgeManager settings:
Bridge app URL:  http://www.zorbas.de/scripts/phpBB3
Relative path to your bridge app's config file:  ../phpBB3/
Cookie name or prefix:  phpbb3
Use bridge app custom groups?:  No

When clicking on "login" in coppermine it redirects me to the board login.
After logging into the board it won't redirect me back to coppermine.
When accessing the gallery directly I am still not logged in and I can disable the bridge only by directly accessing the bridgemgr.php
I left the bridge active now ffor further testing purposes...
I hope I get help on this as my users would really appreciate the bridge!

zorbas2

One issue was obviously the cookie:
Since I changed it from phpbb3 to phpbb3_b5ygn I am logged in also in coppermine, but I still don't get redirected after logging in by the board...

phill104

The redirection is something that needs an edit to phpBB. If you search their boards the edits are detailed in a number of places.
It is a mistake to think you can solve any major problems just with potatoes.

zorbas2

I found something in the manual here: http://documentation.coppermine-gallery.net/en/bridging.htm#integrating_individual_bridge_issues_phpbb3

But this is only regarding the logout
AND in my ucp.php I am not able to find:

meta_refresh(3, append_sid("{$phpbb_root_path}index.$phpEx"));
$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a> ');


Would you please be so kind to point me to the correct posting as I can not find it??

zorbas2

Unfortunately couldn't find any help regarding the non.functional redirect when bridging. So I deactivated the bridge for now.
But I am still looking for help regarding this!!

zorbas2

One more thing:
When the bridge was still enabled I tried to send an ecard and got the following error:

09. Februar 2015 um 22:01 - While executing query 'SELECT *, username AS user_name, user_email AS user_email, user_regdate AS user_regdate, user_from AS user_location, user_website AS user_website FROM `db466936751`.phpbb3_users WHERE user_id = '2'' in bridge/udb_base.inc.php on line 413 the following error was encountered: 
Unknown column 'user_from' in 'field list'


Now as the bridge is disabled the gallery is sending no emails at all (new user registration/ecards) except the contact form. But that's another topic...

zorbas2

I am using version 1.5.34 as stated in my initial post.
I am NOT editing files. I am using the bridge manager.
However, this does not explain the error when trying to send an ecard.
I have now disabled the bridge in the bridge manager as neither redirects nor ecards would work.
What do you suggest to do to get the bridge working??

Αndré

QuoteWhile executing query 'SELECT *, username AS user_name, user_email AS user_email, user_regdate AS user_regdate, user_from AS user_location, user_website AS user_website FROM `db466936751`.phpbb3_users WHERE user_id = '2'' in bridge/udb_base.inc.php on line 413 the following error was encountered:
Unknown column 'user_from' in 'field list'


Quote from: bridge/udb_base.inc.php$sql = "SELECT *, {$this->field['username']} AS user_name, "
                . "{$this->field['email']} AS user_email, "
                . "{$this->field['regdate']} AS user_regdate, "
                . "{$this->field['location']} AS user_location, "
                . "{$this->field['website']} AS user_website "
            . "FROM  {$this->usertable} WHERE {$this->field['user_id']} = '$uid'";
        $result = cpg_db_query($sql, $this->link_id);


Quote from: bridge/phpbb3.inc.php// Table field names
            $this->field = array(
                'username' => 'username', // name of 'username' field in users table
                'user_id' => 'user_id', // name of 'id' field in users table
                'password' => 'user_password', // name of 'password' field in users table
                'email' => 'user_email', // name of 'email' field in users table
                'regdate' => 'user_regdate', // name of 'registered' field in users table
                'active' => 'user_active', // is user account active?
                'lastvisit' => 'user_lastvisit', // name of 'location' field in users table
                'location' => 'user_from', // name of 'location' field in users table
                'website' => 'user_website', // name of 'website' field in users table
                'usertbl_group_id' => 'group_id', // name of 'group id' field in users table
                'grouptbl_group_id' => 'group_id', // name of 'group id' field in groups table
                'grouptbl_group_name' => 'group_name' // name of 'group name' field in groups table
            );


This means you need to update the bridge files, as it doesn't seem to be compatible with your phpBB version.

zorbas2

Thank you for your help!!  :)
I am trying to always use the latest version of phpBB (currently 3.1.3) and cpg (currently 1.5.34)

Am I right that you want me to edit phpbb3.inc.php and add the line
'location' => 'user_from', // name of 'location' field in users table

I was also searching on the coppermine-gallery.net website if there is a central location to find the latest bridge files - no luck. Or am I missing something here??

Αndré

If the bridge files aren't included in the Coppermine package, you may find them here in the bridge or bridge contributions board.

zorbas2

Thanks André,

That's where I probably found them.
But what you mean by
Quote from: AndréIf the bridge files aren't included in the Coppermine package ...
I was checking the 'cpg1.5 bridging' forum right now and as I did not find the files right away I ask myself is the following:
Why is there not a 'sticky' topic for those files at the top of the forum?? That would make it much easier to always find the latest bridge files...

And regarding my question: Should I add now the line you mentioned to my phpbb3.inc.php ??

Αndré

You don't need to add that line, but adjust it, so it matches your phpBB database. Obviously something changed, as the field was either renamed, moved or removed.

zorbas2

In my database (phpBB  3.1.3)

in the table
'prefix_users' there is no field anymore corresponding to 'location'

However, this field is found now in the table
'prefix_profile_fields_data' named as 'pf_phpbb_location'

What I would have to do in this case?
Maybe someone is willing to adapt the phpbb.inc.php to the phpBB 3.1.x version? It seems quite a lot has changed...
And there is still the redirect issue also...

phill104

Again, the redirect has to be done by editing the phpBB files, not the Coppermine files. That is something better asked over at the phpBB forums as we do not know their code.

I'll try and do an install of phpBB locally tomorrow and see what changes there are.
It is a mistake to think you can solve any major problems just with potatoes.

zorbas2

Quote from: Phill Luckhurst on February 14, 2015, 01:35:11 PMAgain, the redirect has to be done by editing the phpBB files, not the Coppermine files.
Got that. In ucp.php as I understood...

Quote from: Phill Luckhurst on February 14, 2015, 01:35:11 PMI'll try and do an install of phpBB locally tomorrow and see what changes there are.
That would be great!!

Quote from: Phill Luckhurst on February 14, 2015, 01:35:11 PMThat is something better asked over at the phpBB forums as we do not know their code.
I will do so...

Αndré

Phill, according to this post, some field names have changed and some fields have been moved to a new table. Unfortunately the user hasn't posted more details what exactly has been changed, but maybe this can be found somewhere in the release notes of phpBB 3.1.


Quote from: Phill Luckhurst on February 14, 2015, 01:35:11 PM
I'll try and do an install of phpBB locally tomorrow and see what changes there are.
I'll do this now and post what I found out when I finish my work today.

Αndré

The file install/convertors/convert_phpbb20.php contains a map of new -> old (table +) field names, e.g.
Quotearray(
            'target'      => PROFILE_FIELDS_DATA_TABLE,
            'primary'      => 'users.user_id',
            'query_first'   => array(
               array('target', $convert->truncate_statement . PROFILE_FIELDS_DATA_TABLE),
            ),

            array('user_id',            'users.user_id',               'phpbb_user_id'),
            array('pf_phpbb_occupation',   'users.user_occ',               array('function1' => 'phpbb_set_encoding')),
            array('pf_phpbb_interests',      'users.user_interests',            array('function1' => 'phpbb_set_encoding')),
            array('pf_phpbb_location',      'users.user_from',               array('function1' => 'phpbb_set_encoding')),
            array('pf_phpbb_icq',         'users.user_icq',               array('function1' => 'phpbb_set_encoding')),
            array('pf_phpbb_wlm',         'users.user_msnm',               array('function1' => 'phpbb_set_encoding')),
            array('pf_phpbb_yahoo',         'users.user_yim',               array('function1' => 'phpbb_set_encoding')),
            array('pf_phpbb_aol',         'users.user_aim',               array('function1' => 'phpbb_set_encoding')),
            array('pf_phpbb_website',      'users.user_website',            'validate_website'),

            'where'         => 'users.user_id <> -1',
         ),

Αndré

The current code in udb_base.inc.php doesn't support joining other tables. But as neither user_location nor user_website is used anywhere in the rest of the Coppermine code (at least I haven't found a direct access to it), we can simply replace
                'location' => 'user_from', // name of 'location' field in users table
                'website' => 'user_website', // name of 'website' field in users table

with
                'location' => "''", // name of 'location' field in users table
                'website' => "''", // name of 'website' field in users table


This should fix the error message when bridged to phpBB 3.1 and should also work with phpBB 3.0. If somebody can verify that it works for both, I'll update the bridge file accordingly.

zorbas2


zorbas2

I changed the lines in my phpbb3.inc.php as you suggested and did the following:
- uploaded edited phpbb3.inc.php
- enabled bridging
- logged out.
- Logging in at coppermine --> got redirected to phpbb. Logged in there. --> No redirect back to cpg
- Manually went back to cpg and I was logged in.
- Tried to send an ecard --> Message that the card was send and no errors anymore. BUT the card was not received in the end!!
- Tried to send a contact mail --> Received it immediately.
- Disabled bridge
- Checked registration settings and group settings --> nothing changed as I can see.
- Tried again to send an ecard --> Message that the card was send and no errors anymore. BUT the card was not received in the end!! And this was working before enabling the bridge!!

Dunno watodo now...