本文整理汇总了PHP中UserAccount::emailExists方法的典型用法代码示例。如果您正苦于以下问题:PHP UserAccount::emailExists方法的具体用法?PHP UserAccount::emailExists怎么用?PHP UserAccount::emailExists使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UserAccount
的用法示例。
在下文中一共展示了UserAccount::emailExists方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processchangeemailAction
function processchangeemailAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(TRUE);
$session = SessionWrapper::getInstance();
$this->_translate = Zend_Registry::get("translate");
$formvalues = $this->_getAllParams();
if (!isArrayKeyAnEmptyString('email', $formvalues)) {
$user = new UserAccount();
$user->populate(decode($formvalues['id']));
// debugMessage($user->toArray());
if ($user->emailExists($formvalues['email'])) {
$session->setVar(ERROR_MESSAGE, sprintf($this->_translate->translate("profile_email_unique_error"), $formvalues['email']));
return false;
}
# save new username
$user->setEmail2($formvalues['email']);
$user->setActivationKey($user->generateActivationKey());
$user->save();
$user->sendNewEmailNotification($formvalues['email']);
$user->sendOldEmailNotification($formvalues['email']);
$view = new Zend_View();
$url = $this->view->serverUrl($this->view->baseUrl('profile/view/id/' . encode($user->getID())));
$usecase = '1.11';
$module = '1';
$type = USER_CHANGE_EMAIL;
$details = "Email change request for <a href='" . $url . "' class='blockanchor'>" . $user->getName() . "</a> from " . $user->getEmail() . " to " . $user->getEmail2();
$browser = new Browser();
$audit_values = $session->getVar('browseraudit');
$audit_values['module'] = $module;
$audit_values['usecase'] = $usecase;
$audit_values['transactiontype'] = $type;
$audit_values['userid'] = $session->getVar('userid');
$audit_values['url'] = $url;
$audit_values['transactiondetails'] = $details;
$audit_values['status'] = "Y";
// debugMessage($audit_values);
$this->notify(new sfEvent($this, $type, $audit_values));
$successmessage = "A request to change your login email has been recieved. <br />To complete this process check your new email Inbox and click on the activation link sent. ";
$this->_redirect($this->view->baseUrl('index/updatesuccess/successmessage/' . encode($successmessage)));
}
}
示例2: checkemailAction
function checkemailAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$formvalues = $this->_getAllParams();
$email = trim($formvalues['email']);
// debugMessage($formvalues);
$user = new UserAccount();
if (!isArrayKeyAnEmptyString('userid', $formvalues)) {
$user->populate($formvalues['userid']);
}
if ($user->emailExists($email)) {
echo '1';
} else {
echo '0';
}
}