Use login credentials for PHPBB2 on my site

I am currently using the PHPBB2 forum to section one of my sites, and I would like to expand this site (add new pages, scripts, etc.). I would like to restrict access to these pages to users already registered in the PHPBB2 forum.

In fact, if only members of a particular membership group could access these pages, that would be great.

Is there a way to use the same credentials to log in to the rest of my site and check which groups the members are from?

thanks

(by the way, these pages are in PHP)

+3
source share
3 answers

PHPBB, , , , , , .

cookie :

$_COOKIE["phpbb2mysql_data"]

, , . , cookie:

a:2:{s:11:"autologinid";s:0:"";s:6:"userid";s:1:"3";}

"3", PHPBB.

, user_id:

 $goo = unserialize($_COOKIE["phpbb2mysql_data"]);
 $extracted_id = $goo["userid"];

( epochwolf, cookie)

, , . phpbb_user_group ( phpbb_ ).

, - . , - :

SELECT pug.user_id FROM phpbb_user_group pug 
 LEFT JOIN phpbb_groups g 
 ON pug.group_id=g.group_id
 WHERE pug.user_id='$extracted_id'
 AND g.group_name='Foo';

, , Foo.

+1

PHPBB2 . , .

PHPBB2, :

PHPBB2, , PHPBB2 . PHPBB2 , PHPBB2 . , .

! , .

+1

phpBB 2. , md5() .

phpBB3, () .

0

Source: https://habr.com/ru/post/1704492/


All Articles