External registration

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
denvy
Registered User
Posts: 6
Joined: Mon Apr 27, 2015 8:00 pm

External registration

Post by denvy » Mon Apr 27, 2015 8:18 pm

Hi all, this is my first post and started to explore the phpBB world and was looking for some advice on something I was looking to do. I have built a Laravel app which is my main site, I have installed phpBB on a subdomain at a different server location. Both working fine separately, registration on phpBB I want disabled and accounts to be only created and disabled through my main site, when account is created or deleted.

My question is how do I
1. Send a newly created account on main site to phpBB
2. Delete account on main site to phpBB

I found these but they seem to be answering different questions. These are for authenticating.
https://wiki.phpbb.com/Authentication_providers
and
viewtopic.php?p=4016875#p4016875

At the present moment in time, I am not too concerned with authentication and session login between the two apps. All I want is to be able to send created and deleted accounts to phpBB and for now happy for users have to login when visiting phpBB.

Can someone kindly please advise me how this can be achieved, creating and deleting accounts via external requests?

User avatar
Wolfsblvt
Registered User
Posts: 632
Joined: Sun Oct 26, 2014 9:12 pm
Location: Solingen, Germany
Name: Clemens H.
Contact:

Re: External registration

Post by Wolfsblvt » Mon Apr 27, 2015 9:53 pm

You mean you want to create an account in your phpBB board when someone registers on your main site?
If you have a specific extension request and you are willing to pay for, you can write me a PM.
My extensions (Trending: @Mention SystemAdvanced PollsUser Online Time)

»Du kamst zu uns. Deine Stimme kam. Du zeigtest uns die Sterne. Sie funkelten. Wir konnten sehen.«

denvy
Registered User
Posts: 6
Joined: Mon Apr 27, 2015 8:00 pm

Re: External registration

Post by denvy » Mon Apr 27, 2015 10:00 pm

Wolfsblvt wrote:You mean you want to create an account in your phpBB board when someone registers on your main site?
Hi thanks for getting back to me yes that's right

User avatar
Wolfsblvt
Registered User
Posts: 632
Joined: Sun Oct 26, 2014 9:12 pm
Location: Solingen, Germany
Name: Clemens H.
Contact:

Re: External registration

Post by Wolfsblvt » Mon Apr 27, 2015 11:20 pm

There is a function called user_add(), wich can be used to add a user to phpBB.

A sample function how a call to this method could loke like can be seen in this test framework method.

You need the real objects from container thought, not the mocks, but I think you can get an overview how you could use that method,
If you have a specific extension request and you are willing to pay for, you can write me a PM.
My extensions (Trending: @Mention SystemAdvanced PollsUser Online Time)

»Du kamst zu uns. Deine Stimme kam. Du zeigtest uns die Sterne. Sie funkelten. Wir konnten sehen.«

denvy
Registered User
Posts: 6
Joined: Mon Apr 27, 2015 8:00 pm

Re: External registration

Post by denvy » Mon Apr 27, 2015 11:39 pm

thanks for that, I think I need a little more guidance how this works. Where would this piece of code reside on my Laravel app or in phpBB root folder? In order to send a request from my app to phpBB must I include necessary phpBB files such?

At the moment I am struggling how to make the initial connection between my app and phpBB, this is before creating a user.

Can you advise how this is done? I'm trying to include all the files as explained here http://mrkirkland.com/adding-a-user-to- ... al-script/
but no matter what i have tried results all in errors about including necessary files

User avatar
Wolfsblvt
Registered User
Posts: 632
Joined: Sun Oct 26, 2014 9:12 pm
Location: Solingen, Germany
Name: Clemens H.
Contact:

Re: External registration

Post by Wolfsblvt » Tue Apr 28, 2015 12:20 am

On Laravel, I would say. Otherwise it would be a bit more complicated.
What you also could do is check on phpBB side regularly for new users on your app, but that would not redirect your users directly to phpBB, that's the other way round.

And yes, if you make that connection, you need to include files to setup phpBB at the beginning.
I would guess it should be very similar to the lines on top of each php file

Code: Select all

define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup(); 
You should modify this (for example the root path) to your need, and try maybe that.

But I am not so far into integrating phpBB, so I can just guess, and this is all I can give you for this topic :-/
If you have a specific extension request and you are willing to pay for, you can write me a PM.
My extensions (Trending: @Mention SystemAdvanced PollsUser Online Time)

»Du kamst zu uns. Deine Stimme kam. Du zeigtest uns die Sterne. Sie funkelten. Wir konnten sehen.«

denvy
Registered User
Posts: 6
Joined: Mon Apr 27, 2015 8:00 pm

Re: External registration

Post by denvy » Tue Apr 28, 2015 12:54 am

Thanks for your help anyway. I tried that and the error came up with "Call to a member function header() on null " as soon as the session code is added along with "You must use the request class or request_var() to access input data." in the PHP log, I was hoping that there would be an easy way of accessing the app externally. But seems like that it is not. I see alot of threads where people struggled but none with full solutions.

denvy
Registered User
Posts: 6
Joined: Mon Apr 27, 2015 8:00 pm

Re: External registration

Post by denvy » Tue Apr 28, 2015 1:30 am

Excellent!! After 12 hours of searching, hit the jackpot. One post talking about why phpBB wouldn't co-operate when trying to connect externally. As soon as I added the code bam, everything's working along with several other functions such as checking for user too etc. The rest should be easy to code hopefully.

Right back to coding but bed time for now. Thanks Wolfsblvt for your help

User avatar
Lumpy Burgertushie
Registered User
Posts: 63196
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: External registration

Post by Lumpy Burgertushie » Tue Apr 28, 2015 3:38 pm

please supply a link to the jackpot you hit.


thanks,
robert
I am available for custom work on a donation basis. Please send me a PM with your needs.
Premium phpBB 3.2 Styles by PlanetStyles.net

New phpbb 3.0 support site

guypat
Registered User
Posts: 35
Joined: Thu Jan 28, 2016 8:30 pm

Re: External registration

Post by guypat » Fri Feb 05, 2016 10:42 pm

denvy wrote:Excellent!! After 12 hours of searching, hit the jackpot. One post talking about why phpBB wouldn't co-operate when trying to connect externally. As soon as I added the code bam, everything's working along with several other functions such as checking for user too etc.
What "code barn" ??? Please share the link to the post that helped you....

User avatar
austin881
Registered User
Posts: 269
Joined: Wed Jan 30, 2008 9:58 pm
Location: Boise, Idaho, USA
Name: Austin Maddox
Contact:

Re: External registration

Post by austin881 » Wed Feb 24, 2016 7:06 am

A poem for denvy
denvy was a member for just one day
He hit the jackpot and ran away

Joined: 27 Apr 2015, 14:00
Last active: 28 Apr 2015, 17:44

denvy... Please share the link to the post that helped you!
Available for paid phpBB help! PM me.

My Extensions/MODS: 475 Narius Categorized Smilies for phpBB3, Simplified & Compacted All-Members page, Flash Animated Cumulus Tag Cloud, "Hello" Name Tag of Newest User, AWS S3
phpBB portfolio: chevy truck forum, chevy astro van forum

Cohaven
Registered User
Posts: 1
Joined: Wed Oct 18, 2017 2:53 pm

Re: External registration

Post by Cohaven » Wed Oct 18, 2017 2:56 pm

Not sure if this is the thread he was talking about, but it helped me:
viewtopic.php?f=71&t=2287546

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: bonelifer, posey and 9 guests

cron