首页 > 解决方案 > PHPBB3 外部注册 - 获得电子邮件确认

问题描述

我正在尝试将我的演示产品与我的论坛集成,目前我正在注册页面。

目前我可以毫无问题地创建新用户,但我的论坛设置被设置为向用户发送带有确认链接的电子邮件,但是外部注册页面没有这样做,它只是添加它们。

我进行了广泛的搜索,但无法找到有关该主题的任何未过时的信息。

目前,我有 - (这只是一个粗略的代码,一旦我完成了成功注册后发送电子邮件确认的功能目标,我打算整理一下)

define('IN_PHPBB', true);          
global $db;                 
global $config;            
global $user;              
global $auth;                                  
global $cache;           
global $template;           
global $phpbb_root_path;               
global $phpEx;             
global $phpbb_container;              
global $phpbb_root_path, $phpEx, $user, $auth, $cache, $db, $config, $template, $table_prefix;           
global $request;              
global $phpbb_dispatcher;           
global $symfony_request;                
global $phpbb_filesystem;                   

$phpbb_root_path = '../forum/';  // forum directory path here            
$phpEx = 'php';            
//include($phpbb_root_path . 'common.' . $phpEx);             

include($phpbb_root_path.'common.php');              

// Start session management             
$user->session_begin();              
$auth->acl($user->data);                          
$user->setup();                 

require($phpbb_root_path .'includes/functions_user.php');                 

$user_actkey = md5(rand(0, 100) . time());                 
$user_actkey = substr($user_actkey, 0, rand(6, 10));             
$username = 'MyUserName111';            
$password = 'MyPassword11'; // Dont encrypt the password!            
$email = 'email@test.com';            
$request->enable_super_globals();             

$user_row = array(              
'username' => $username,           
'user_password' => md5($password),              
'user_email' => $email,               
'group_id' => 7, #Registered users group              
'user_timezone' => 'UTC',            
'user_lang' => 'en',            
'user_type' => '1',            
'user_ip' => $_SERVER['REMOTE_ADDR'],         
'user_actkey' => $user_actkey,          
'user_dateformat' => 'D M d, Y g:i a',         
'user_style' => 2,            
'user_colour' => 'BFBFFF',           
'user_inactive_reason' => 1,           
'user_regdate' => time(),            
'user_new' => 1,              
'user_eth_address' => "0x0"            

);            
$request->disable_super_globals();          
$phpbb_user_id = user_add($user_row);           

标签: phpphpbb3

解决方案


推荐阅读