Top Poster
#1 ramon fincken 416
#2 Site admin 3
#3 Ber|Art 2
#4 braddmark 1
#5 accentmedia 1
#6 Xarzu 1
#7 khadish 1
#8 moxxx 1
#9 nistelrock 1
#10 Justin-ServerPilot 1
[phpbb3][snipplet] Registering users from your own external script



Rating : 4.5 / 5

 
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding
Beta
Want to be notified by email when this topic gets a reply?  
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: 416
Location: A'dam/Diemen, The Netherlands

PostPosted: Sat Nov 22, 2008 5:06 pm    Post subject: [phpbb3][snipplet] Registering users from your own external script Reply with quote

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
View user's profile Send private message Visit poster's website
Google adsense
Advertisement





PostPosted: Sat Nov 22, 2008 5:06 pm    Post subject: [phpbb3][snipplet] Registering users from your own external script

Advertisement
Back to top
GravityForms
Advertisement





PostPosted: Sat Nov 22, 2008 5:06 pm    Post subject: [phpbb3][snipplet] Registering users from your own external script

Advertisement
Gravity Forms Plugin for WordPress
Back to top
khadish


Get a free globally recognized avatar
It's free!


Joined: 24 Oct 2016
Posts: 1

PostPosted: Mon Oct 24, 2016 9:00 pm    Post subject: Re: [phpbb3][snipplet] Registering users from your own external script Reply with quote

adding last comment to post from:

http://www.mrkirkland.com/adding-a-user...al-script/
Quote:


kevin says
January 15, 2014 at 6:25 pm

i using this script and it works but there is one trouble for the password integration … it hashed like phpbb_hash do but when i want to login i wont reconize my pass

its like phpbb_hash makes a random salt in the password

Greetings , kevin



Hi kevin says,

I struggled with issue you mentioned but I also solved it. It was issue in CSV file. Adding ; (semicolon) at line end solved issue. Before that solution only one password was accepted - this from last line. My CSV file format:

<username>;<password>;

I know that this response is nearly 3 years after last comment but... well... good luck feature reader:)

I needed to left answer somewhere Smile
Back to top
View user's profile Send private message
Post new topic   Reply to topic    Ramonfincken.com Forum Index -> PHP coding All times are GMT
Page 1 of 1

 
Jump to:  
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
General forums
The world of freelance
Programming
Other projects
Poll
I love gifts

Yes goodies and presents! [3]
No but I love polls ! [1]

Related google ads