Jump to content

Registration, change password/email Redirects


Cirrus Soft

Recommended Posts

Registration: Overload the manage() method of \IPS\core\modules\front\system\register and perform a redirect.

Settings: Overload the _username(), _password(), and _email() methods of \IPS\core\modules\front\system\settings and perform redirects.

Login: Overload the manage() method of \IPS\core\modules\front\system\login and perform a redirect. Also make a template hook on \IPS\Theme\class_core_front_global on the userBar template and the guestCommentTeaser template to make the login links point directly to your remote login page.

Lost pass: overload the manage() method of \IPS\core\modules\front\system\lostpass and perform a redirect. 

Link to comment
Share on other sites

Thank you!  This worked well for Registration, but for password and email settings it appears to be trying to load the redirect page into the right column box using ajax.  It needs to redirect the top location.

using:  header("location: url_to_change_email");

Link to comment
Share on other sites

I'm not sure why it is also, maybe it is a new page for the latest version?  I've attached a screenshot to show you.  In this example, I've simply redirected it to a text file because otherwise, it tries to load my entire page and errors on all the included js and other files.  Here is my hook:

 

//<?php

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	exit;
}

class hook27 extends _HOOK_CLASS_
{


	/**
	 * Email
	 *
	 * @return	string
	 */
	protected function _email()
	{
      	header("location:https://www.footballreach.com/help.txt");
      	return call_user_func_array( 'parent::_email', func_get_args() );
	}
  

}

 

 

community_email.PNG

Link to comment
Share on other sites

Ideally you should be using the built in methods for handling things like this, they will automatically handle AJAX requests.

What you want to do is something like this:

//<?php

/* To prevent PHP errors (extending class does not exist) revealing path */
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
{
	exit;
}

class hook27 extends _HOOK_CLASS_
{


	/**
	 * Email
	 *
	 * @return	string
	 */
	protected function _email()
	{
      		\IPS\Output::i()->redirect( \IPS\Http\Url::external( 'https://www.footballreach.com/help.txt' ) );
	}
  

}

 

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...