Jump to content

Redirect to members profile when logging in


Buschiq

Recommended Posts

One feature I would really like to see is the ability to redirect members directly to their profiles when logging in. Perhaps not useful to everyone, but for those of us who run social communitys (meeting new friends, dating etc) it would be a treat! 

I want to be able to choose where a member is directed when they log in or register, if it's to the forums, to their profile or to some specific page.

I use Pages as my starting page and when they log in or register there, that's where they end up and that's not really the best choice. 

Thanks ^_^

Link to comment
Share on other sites

Create a simple app and add a memberSync extension with this code.

	/**
	 * Member has logged on
	 *
	 * @param	\IPS\Member	$member		Member that logged in
	 * @param	\IPS\Http\Url	$redirectUrl	The URL to send the user back to
	 * @return	void
	 */
	public function onLogin( $member, $returnUrl )
	{
		\IPS\Output::i()->redirect( member->url() );
	}
Link to comment
Share on other sites

The above works, but has the potential to cause problems with Nexus / Commerce check-out if you create an account during the check-out process.  

The best bet may be to overload \IPS\Member::memberSync, analyze the $params variable passed to it and alter it as required before it's sent to app memberSync extensions.

Link to comment
Share on other sites

19 hours ago, Aiwa said:

Create a simple app and add a memberSync extension with this code.


	/**
	 * Member has logged on
	 *
	 * @param	\IPS\Member	$member		Member that logged in
	 * @param	\IPS\Http\Url	$redirectUrl	The URL to send the user back to
	 * @return	void
	 */
	public function onLogin( $member, $returnUrl )
	{
		\IPS\Output::i()->redirect( member->url() );
	}

If I knew how, I would. But thanks! :thumbsup:

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...