User RecoverPassword check

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
andyrav
User
Posts: 664

User RecoverPassword check

Post by andyrav »

Hi
when doing a recover password I would like the system to check if the users account is still active before sending a email and pop up a message to say "contact system admin" then return to login page when click on on

Tried this but didnt work

    // User RecoverPassword event
    public function userRecoverPassword($rs)
    {
        // Return false to abort
		if ($rs['Activated'] = 'N') {
			$this->ErrorMessage("Your account has not been activated.");
			 return FALSE;
		}
        return true;
    }

any ideas

thanks


mobhar
User
Posts: 11905

Post by mobhar »

Try this revised version:

// User RecoverPassword event
public function userRecoverPassword($rs)
{
    // Return false to abort
    if ($rs['Activated'] == 'N') {
        $this->setFailureMessage("Your account has not been activated.");
        return false;
    }
    return true;
}

andyrav
User
Posts: 664

Post by andyrav »

using the following

public function userRecoverPassword($rs)
    {
        // Return false to abort
		if ($rs['Activated'] == 'N') {
			$this->setFailureMessage("Your account has not been activated.");
		}	else { 
			return true;
		}
    }

does not give me a error message i just get the following
You will receive password recovery instructions shortly if your email address is registered.
any ideas?

thanks


mobhar
User
Posts: 11905

Post by mobhar »

You need to add return false; below the error message, see the code I posted above.


andyrav
User
Posts: 664

Post by andyrav »

Updated but would not show the message

if ($rs['Activated'] == 'N') {
	$this->setFailureMessage("Your account has not been activated.");
		return false;
}

andyrav
User
Posts: 664

Post by andyrav »

The function is working as it is not sending the email, just not displacing the message


arbei
User
Posts: 9787

Post by arbei »

Are you using modal dialog so the page is not redirected back to the login page like normal non-modal page?


andyrav
User
Posts: 664

Post by andyrav »

Tired both. Nether work. Would prefer model with a error message lf posslsible.
Thanks


Post Reply