just trying to write a quick little snippet here to check if an email address has already been used in modx revo 2.2++
I'm tying something like this:
if($_POST['email']){
$reqEmail = trim($_POST['email']);
if ($user = $modx->getObject('Profile', array('email'=>$reqEmail))){
$modx->setPlaceholder('error.message','Sorry, the email address you selected is not valid, it may already be in use.');
}else{
$modx->setPlaceholder('email',$reqEmail);
}
}
it's sort of a pre-check before someone is referred on to a registration form so I do NOT have a user ID to check against.
thoughts?
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525
I think you want 'modUserProfile' for the object rather than 'Profile,' which is for getting a Profile as a related object of some other object (e.g. User) that you don't have.
yes - it is modUserProfile .. I was trying modUserprofile ... just a matter of case.
*** Not just websites, we also create signage, banners, print, trade show displays and more! ***
Sean Kimball CLP, CLS.
Technical Director / Sr. Developer | BigBlock Studios
._______________________________________________.
Bigblock Studios
http://www.bigblockstudios.ca Web site design & development.
27-1300 King Street East. Box 167 Oshawa, Ontario L1H8J4 Canada.
phone/fax: 905-426-5525