How to authorize a user on the forum phpBB3 link? The link should not contain a password, in order to completely simplify the task we will leave only the username in this link (users from the main site have already been added to the phpBB3 database). Interested in how to start a user session in phpBB3. Here, for example, we have the user id from phpBB3 or the entire set of fields from the users table. What you need to do to authorize it. As far as I understand, authorization occurs in this section of the code of the ucp.php file:

$user->session_begin(); $auth->acl($user->data); ... case 'login': if ($user->data['is_registered']) { redirect(append_sid("{$phpbb_root_path}index.$phpEx")); } login_box(request_var('redirect', "index.$phpEx")); break; 

But I can't understand how to authorize a manually created user.

PS Understood it seems, after receiving session_id it is necessary to write down the session_user_id column of the sessions ID table of the required user.

    1 answer 1

    For authorization without a password in PhpBB 3, you need to use the following construction.

     global $user; $user->session_create(ID пользователя, 0, 1, 1); 
    • Thank you, I did not find such a structure anywhere, so I wrote the creation of the session myself, but perhaps I will replace it with a more correct solution) - Deadik
    • It remains only to learn how to use it, because for some reason the corresponding entry is not entered into the table with sessions ( - Deadik
    • To be more precise, an entry to the sessions table is added, but there the user is not the one I pass on to the method - Deadik
    • I tested it on the newly installed forum, it seems everything works and in the sessions that user is written under which I logged in. Maybe you have some mods installed that spoil the method? - zsiteru