Redirect to profile after login with authentication plugin

Discussion forum for MOD Writers regarding MOD Development.
Locked
BrockBoland
Registered User
Posts: 2
Joined: Mon Feb 22, 2010 9:30 pm

Redirect to profile after login with authentication plugin

Post by BrockBoland » Mon Feb 22, 2010 9:39 pm

I'm new to phpBB, so I apologize if I'm posting in the wrong forum.

I'm working on a members-only forum for a client. I have written an authentication plugin to authenticate against their member database using a web service; this part works just fine.

Along the way, I referenced the defaultLDAP auth plugin and the auth plugin wiki page, and followed the convention from both: if a user is logging in and does not already have a user record, it creates a record for them.

What I would like to do (I think) is redirect new users to the profile page after login and require them to provide their location and company name. The client would like to include these two fields next to the author on each thread/comment, and since it's a small-ish and known member base and everything will only be available to other members, privacy is not a concern.

Is it possible to redirect to the profile page if they are a new user? Is this even the best way to go about it? Any suggestions are much appreciated!

User avatar
m157y
Registered User
Posts: 482
Joined: Mon Apr 30, 2007 9:39 am
Location: Russia, Moscow, Khimki
Contact:

Re: Redirect to profile after login with authentication plug

Post by m157y » Mon Feb 22, 2010 9:56 pm

at includes/ucp/ucp_register.php you'll find

Code: Select all

				$message = $message . '<br /><br />' . sprintf($user->lang['RETURN_INDEX'], '<a href="' . append_sid("{$phpbb_root_path}index.$phpEx") . '">', '</a>');
				trigger_error($message);
That's part redirects user to index. So you need change text and link.
But if you need those fields by default, maybe i'll be better add they to registration page?
m157y aka Misty
NO SUPPORT VIA PM
KarmaMOD for phpBB 3.0.x | bbAJAX
Follow me on twitter

BrockBoland
Registered User
Posts: 2
Joined: Mon Feb 22, 2010 9:30 pm

Re: Redirect to profile after login with authentication plug

Post by BrockBoland » Mon Feb 22, 2010 10:16 pm

m157y - I'll take a look at that, but I can't put it on the registration page. Like I said, the auth plugin just creates a user record for them if they don't already have one. The users are going to be instructed to login with their existing member credentials, so they won't go through the registration process.

User avatar
m157y
Registered User
Posts: 482
Joined: Mon Apr 30, 2007 9:39 am
Location: Russia, Moscow, Khimki
Contact:

Re: Redirect to profile after login with authentication plug

Post by m157y » Mon Feb 22, 2010 10:35 pm

Okay, so redirect part after registration was shown before.
But i think that users just can close this page, so you need some additional checks for it.
m157y aka Misty
NO SUPPORT VIA PM
KarmaMOD for phpBB 3.0.x | bbAJAX
Follow me on twitter

Locked

Return to “[3.0.x] MOD Writers Discussion”