|
|
|
View previous topic
::
View next topic
|
| Author |
Message |
ramon fincken Site's programmer
 Get a free globally recognized avatar It's free!
Joined: 03 Aug 2007 Posts: 256 Location: A'dam/Diemen, The Netherlands
|
Posted: Sat Nov 22, 2008 5:06 pm Post subject: [phpbb3][snipplet] Registering users from your own external script |
|
|
In addition to: http://www.mrkirkland.com/adding-a-user...al-script/
I've made some adjustments and added some more comments.
| Code: | <?php
/**
* Created on 22-nov-2008 17:10:39
*
* Phpbb3 -- register_extern.php
* @author Ramon Fincken http://www.ramonfincken.com/permalink/topic82.html
* @author Mr Kirkland http://www.mrkirkland.com/adding-a-user-to-phpbb3-from-an-external-script/
*/
define('IN_PHPBB', true);
$phpbb_root_path = './'; // Your path here
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
require($phpbb_root_path .'includes/functions_user.php');
$username = 'username_here';
$password = 'password_here'; // Do NOT encrypt !
$email = 'email_here'; // Please validate this email yourself ! Phpbb will accept non-valid emails.
// Do a check if username is allready there, same for email, otherwhise a nasty error will occur
$user_row = array(
'username' => $username,
'user_password' => md5($password), 'user_email' => $email,
'group_id' => 2, #Registered users group
'user_timezone' => '1.00',
'user_dst' => 0,
'user_lang' => 'en',
'user_type' => '0',
'user_actkey' => '',
'user_dateformat' => 'd M Y H:i',
'user_style' => 1,
'user_regdate' => time(),
);
$phpbb_user_id = user_add($user_row);
echo "New user id = ".$phpbb_user_id;
?> |
|
|
| Back to top |
|
 |
Google adsense Advertisement
|
Posted: Sat Nov 22, 2008 5:06 pm Post subject: [phpbb3][snipplet] Registering users from your own external script |
|
|
Advertisement
|
|
| Back to top |
|
 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|