This topic is locked

Password Reminder Probem with Multiple Email Addresses

3/1/2009 2:02:19 PM
PHPRunner General questions
M
MikeB941 author

PHPBUILD 766
Attempting to activate the Password Reminder feature and I'm running into problems using Password Reminder via their email address look up because several of our clients have multiple email addresses separated by commas in their email field.
Can the Password Reminder code be modified to first parse the supplied email database field by commas or semi-colons and then search for a matching email address within that set (sort of like a "contains" but safer in case one client's email address just happened to be a shorter version of another).
Thanks for all your help. Take Care... Mike.

M
MikeB941 author 3/1/2009

Was able to get around this problem by adding the following custom event code in Global Event>Login page>Remind password page>Before password remind sent
global $sWhere,$value,$cEmailField;

$sWhere="FIND_IN_SET(".$value.",".AddFieldWrappers($cEmailField).")>0";
Take Care... Mike.

M
MikeB941 author 4/4/2009

PHPRUNNER 5.0 Build 766
CODE CORRECTION to the above - need to check if the reminder is being looked up by Username or Email address before tampering with the where clause:
global $sWhere,$value,$cEmailField,$strSearchBy;

if($strSearchBy == "email") {

$sWhere="FIND_IN_SET(".$value.",".AddFieldWrappers($cEmailField).")>0";

}