Quantcast
Channel: phpBB.com
Viewing all articles
Browse latest Browse all 2096

[3.3.x] Support Forum • Manually insert users into PHPBB3

$
0
0
Hello,

I have installed PHPBB 3.3.14 and I want to add a user from my own register form to PHPBB.

I found out that it can be done with the following code:

Code:

define('IN_PHPBB', true);// Specify the path to you phpBB3 installation directory.$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '/home/xxx/domains/yyy.nl/public_html/forum/';$phpEx = substr(strrchr(__FILE__, '.'), 1);// The common.php file is required.include($phpbb_root_path . 'common.' . $phpEx);mail('xxx@xxx.xx', '1', '1');require($phpbb_root_path . 'includes/functions_user.' . $phpEx);mail('xxx@xxx.xx', '2', '2');$username = "Test";$user_password = "123456";$user_email = "test@test.com";$group_id = 2;// $user_type = USER_NORMAL;$user_type = 0;$user_ip = $_SERVER['REMOTE_ADDR'];$registration_time = time();mail('xxx@xxx.xx', '3', '3');$user_row = array(    'username'              => $username,    'user_password'         => phpbb_hash($user_password),    'user_email'            => $user_email,    'group_id'              => $group_id,    'user_type'             => $user_type,    'user_ip'               => $user_ip,    'user_regdate'          => $registration_time);mail('xxx@xxx.xx', '4', '4');// Register user...$user_id = user_add($user_row, false, null);
I got no error in the log files on the webserver and also no error in the console.

I only get email 1 and 2 in my mailbox as a test where the code breaks so what is wrong with the setting of the variables?

I can't figure it out, it should be a very stupid thing .......... :roll:

Kind regards,

Arie

Statistics: Posted by Arie0512 — Wed Jan 08, 2025 4:10 pm



Viewing all articles
Browse latest Browse all 2096

Trending Articles