function find_by_email($email) { $finder = new AMP_System_User_Profile(AMP_dbcon()); $records = $finder->find(array('Email' => $email)); $user = array_pop($records); return new WinMember($user->id); }
function success() { $email_request = AMP_params('email'); if (!$email_request) { return false; } $finder = new AMP_System_User_Profile(AMP_dbcon()); $accounts = $finder->find(array('Email' => $email_request, 'publish' => 1, 'modin' => 20)); if (empty($accounts)) { return false; } return $this->send_password_reset(current($accounts)); }
function validate_unique_email($udm) { if (!AMP_params('btnUdmSubmit')) { return; } if (AMP_params('Email') && !AMP_params('uid')) { $finder = new AMP_System_User_Profile(AMP_dbcon()); $existing_accounts = $finder->find(array('Email' => AMP_params('Email'), 'modin' => 20)); if (!empty($existing_accounts)) { AMP_flashMessage('The email address you entered is already associated with an account and must be unique to create a new one. Are you already a member? If so <a href="forgot_password.php?login_type=content">you can recover your password here</a>.', $error = true); AMP_redirect('/form.php?id=' . $udm->instance); exit; } } }
function donation_is_unique($donation) { $finder = new AMP_System_User_Profile(AMP_dbcon()); $finder->_exact_value_fields[] = WIN_RECENT_DONATION_KEY; return !$finder->find(array(WIN_RECENT_DONATION_KEY => $donation['key']), 'AMP_System_User_Profile'); }