本文整理汇总了PHP中User::getEmail方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getEmail方法的具体用法?PHP User::getEmail怎么用?PHP User::getEmail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类User
的用法示例。
在下文中一共展示了User::getEmail方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onConfirmEmailComplete
/**
* Adds Task for updating user email
* @param User $user
* @return bool
*/
public function onConfirmEmailComplete(\User $oUser)
{
/* Get and run the task */
$oUserHelper = $this->getUserHelper();
$task = $oUserHelper->getUpdateUserTask();
$task->call('updateUserEmail', $oUser->getId(), $oUser->getEmail());
$task->queue();
return true;
}
示例2: editUser
public function editUser(User $user)
{
$STH = $this->DBH->prepare("UPDATE Users SET login=:login, email=:email, password=:password WHERE id=:id");
$STH->bindValue(":login", $user->getLogin());
$STH->bindValue(":email", $user->getEmail());
$STH->bindValue(":password", $user->getPassword());
$STH->bindValue(":id", $user->getID());
$STH->execute();
}
示例3: login
public function login($POST)
{
$db = new DB();
$user = new User();
$user->setEmail($POST["email"]);
$user->setPassword($POST["password"]);
if ($user->getEmail() == "") {
$response["status"] = 1;
$response["msg"] = "กรุณากรอก Email";
} else {
if ($user->getPassword() == "") {
$response["status"] = 2;
$response["msg"] = "กรุณากรอก Password";
} else {
$array = array("email" => array("type" => $user->getDataType("email"), "value" => $user->getEmail()), array("type" => $user->getDataType("password"), "value" => $user->getPassword()));
$sql = "SELECT * FROM users WHERE email = ? AND password = ?";
$data = $db->query($sql, $array);
if (count($data) > 0) {
$response["status"] = 0;
$response["msg"] = "Success";
} else {
$response["status"] = -1;
$response["msg"] = "ไม่พบ Email/Password นี้ในระบบ";
}
}
}
echo json_encode($response);
}
示例4: testEmail
public function testEmail()
{
$emailTest = "fernando.moro@php.net";
$this->assertEmpty($this->user->getEmail());
$this->user->setEmail($emailTest);
$this->assertEquals($emailTest, $this->user->getEmail());
}
示例5: getEmail
/**
* @inheritdoc
*/
public function getEmail()
{
$knownEmail = $this->user->getEmail();
if (!empty($knownEmail)) {
return $knownEmail;
}
return $this->email;
}
示例6: setEmail
/**
* @param string $email
* @return bool
*/
private function setEmail($email)
{
if ($this->user->getEmail() !== $email) {
$this->user->setEmail($email);
return true;
}
return false;
}
示例7: createResetToken
public function createResetToken(User $user)
{
ResultHelper::whenEmpty($user->getEmail(), AppLabelUtil::$ERROR_USER_NO_EMAIL, HttpStatusCode::internalServerError());
$tokenHash = Hash::create("sha256", mcrypt_create_iv(64, MCRYPT_DEV_URANDOM), HASH_GENERAL_KEY);
$this->mailService->setMailHeading(array($user->getEmail() => $user->getFirstName() . " " . $user->getLastName()));
$this->mailService->setBody("Instellen van uw wachtwoord", "Beste gebruiker, gelieve de volgende link te gebruiken om uw wachtwoord in te stellen: " . URL . "#/reset/token/" . $tokenHash);
$this->mailService->sendMail();
$resetToken = $this->resetTokenFactory->createResetToken($user->getId(), $tokenHash);
$this->resetTokenDao->create($resetToken);
}
示例8: testUpdate
public function testUpdate()
{
$this->entityManager->persist($this->user);
$this->entityManager->flush();
$this->user->setUsername("Jorge Fernandez");
$this->user->setRoles(['ROLE_MANAGER', 'ROLE_ADMIN', 'ROLE_SUPER_ADMIN']);
$this->entityManager->persist($this->user);
$this->entityManager->flush();
$persistedUser = $this->userRepository->findOneBy(["email" => $this->user->getEmail()]);
$this->assertEquals($this->user, $persistedUser);
$this->assertEquals($this->user->getRoles(), $persistedUser->getRoles());
}
示例9: array
function set2(User $user)
{
//Update de todos los campos menos el id, el id se usara como el where para el update numero de filas modificadas
$parametrosSet = array();
$parametrosSet['email'] = $user->getEmail();
$parametrosSet['clave'] = $user->getClave();
$parametrosSet['alias'] = $user->getAlias();
$parametrosSet['fechaAlta'] = $user->getFechaAlta();
$parametrosSet['activo'] = $user->getActivo();
$parametrosWhere = array();
$parametrosWhere["email"] = $user->getEmail();
return $this->bd->update($this->tabla, $parametrosSet, $parametrosWhere);
}
示例10: email_notify
function email_notify($check,$check_result,$subscription) {
global $status_array;
$user = new User($subscription->getUserId());
echo 'email plugin!';
$email = new fEmail();
// This sets up fSMTP to connect to the gmail SMTP server
// with a 5 second timeout. Gmail requires a secure connection.
$smtp = new fSMTP('smtp.gmail.com', 465, TRUE, 5);
$smtp->authenticate('example@example.com', 'example');
$email->addRecipient($user->getEmail(), $user->getUsername());
// Set who the email is from
$email->setFromEmail('flourish@example.com','Tattle');
// Set the subject include UTF-8 curly quotes
$email->setSubject('Tattle : Alert for ' . $check->prepareName());
// Set the body to include a string containing UTF-8
$state = $status_array[$check_result->getStatus()];
$email->setHTMLBody("<p>$state Alert for {$check->prepareName()} </p><p>The check returned {$check_result->prepareValue()}</p><p>Warning Threshold is : ". $check->getWarn() . "</p><p>Error Threshold is : ". $check->getError() . '</p><p>View Alert Details : <a href="' . $fURL::getDomain() . '/' . CheckResult::makeURL('list',$check_result) . '">'.$check->prepareName()."</a></p>");
$email->setBody("
$state Alert for {$check->prepareName()}
The check returned {$check_result->prepareValue()}
Warning Threshold is : ". $check->getWarn() . "
Error Threshold is : ". $check->getError() . "
");
try {
$message_id = $email->send($smtp);
} catch ( fConnectivityException $e) {
fCore::debug("email send failed",FALSE);
}
}
示例11: signIn
/**
* Store User authentication data in session
*
* Also regenerates session id to prevent session fixation
*
* @param User $user
*/
public function signIn(User $user)
{
$_SESSION['HTTP_USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];
$userArray = ['id' => $user->getId(), 'email' => $user->getEmail(), 'role' => $user->getRole()];
$_SESSION['User'] = serialize($userArray);
session_regenerate_id(true);
}
示例12: checkUser
/**
* Checks a User object for a blacklisted email address
*
* @param User $user
* @return bool True on valid email
*/
public function checkUser(User $user)
{
$blacklists = $this->getBlacklists();
$whitelists = $this->getWhitelists();
// The email to check
$email = $user->getEmail();
if (!count($blacklists)) {
// Nothing to check
return true;
}
// Check for whitelisted email addresses
if (is_array($whitelists)) {
wfDebugLog('SpamBlacklist', "Excluding whitelisted email addresses from " . count($whitelists) . " regexes: " . implode(', ', $whitelists) . "\n");
foreach ($whitelists as $regex) {
if (preg_match($regex, $email)) {
// Whitelisted email
return true;
}
}
}
# Do the match
wfDebugLog('SpamBlacklist', "Checking e-mail address against " . count($blacklists) . " regexes: " . implode(', ', $blacklists) . "\n");
foreach ($blacklists as $regex) {
if (preg_match($regex, $email)) {
return false;
}
}
return true;
}
示例13: composeCommonMailtext
/**
* Generate the generic "this page has been changed" e-mail text.
*/
protected function composeCommonMailtext()
{
global $wgPasswordSender, $wgPasswordSenderName, $wgNoReplyAddress;
global $wgEnotifFromEditor, $wgEnotifRevealEditorAddress;
global $wgEnotifUseRealName, $wgRequest;
$this->composed_common = true;
if ($this->editor->isAnon()) {
$pageEditor = wfMsgForContent('enotif_anon_editor', $this->editor->getName());
} else {
$pageEditor = $wgEnotifUseRealName ? $this->editor->getRealName() : $this->editor->getName();
}
// build the subject
$this->subject = wfMessage('moodbar-enotif-subject')->params($pageEditor)->escaped();
// build the body
$targetUserName = $this->targetUser->getName();
$links = $this->buildEmailLink();
//text version, no need to escape since client will interpret it as plain text
$textBody = wfMessage('moodbar-enotif-body')->params($targetUserName, $links['feedbackPageUrl'], $links['editorTalkPageUrl'], $this->response, $links['targetUserTalkPageUrl'], $pageEditor)->text();
//html version, this is a little bit ugly as we have to make wiki link clickable in emails
$action = $wgRequest->getVal('action');
$wgRequest->setVal('action', 'render');
$htmlBody = wfMsgExt('moodbar-enotif-body', array('parse'), $targetUserName, $links['feedbackPageUrl'], $links['editorTalkPageUrl'], '<div style="margin-left:20px; margin-right:20px;">"' . $this->response . '"</div>', $links['targetUserTalkPageUrl'], $pageEditor);
$wgRequest->setVal('action', $action);
// assemble the email body
$this->body = <<<HTML
--{$this->mime_boundary}
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
{$textBody}
--{$this->mime_boundary}
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: 8bit
<html>
\t<body>
\t\t{$htmlBody}
\t</body>
</html>
--{$this->mime_boundary}--
HTML;
# Reveal the page editor's address as REPLY-TO address only if
# the user has not opted-out and the option is enabled at the
# global configuration level.
$adminAddress = new MailAddress($wgPasswordSender, $wgPasswordSenderName);
if ($wgEnotifRevealEditorAddress && $this->editor->getEmail() != '' && $this->editor->getOption('enotifrevealaddr')) {
$editorAddress = new MailAddress($this->editor);
if ($wgEnotifFromEditor) {
$this->from = $editorAddress;
} else {
$this->from = $adminAddress;
$this->replyto = $editorAddress;
}
} else {
$this->from = $adminAddress;
$this->replyto = new MailAddress($wgNoReplyAddress);
}
}
示例14: testGetEmail
public function testGetEmail()
{
$this->User->setEmail('test@norex.ca');
if ($this->User->getEmail() != 'test@norex.ca') {
$this->fail();
}
}
示例15: email_plugin_notify_master
function email_plugin_notify_master($check, $check_result, $subscription, $alt_email = false)
{
global $status_array;
$user = new User($subscription->getUserId());
$email = new fEmail();
// This sets up fSMTP to connect to the gmail SMTP server
// with a 5 second timeout. Gmail requires a secure connection.
$smtp = new fSMTP(sys_var('smtp_server'), sys_var('smtp_port'), sys_var('require_ssl') === 'true' ? TRUE : FALSE, 5);
if (sys_var('require_auth') === 'true') {
$smtp->authenticate(sys_var('smtp_user'), sys_var('smtp_pass'));
}
if ($alt_email) {
$email_address = usr_var('alt_email', $user->getUserId());
} else {
$email_address = $user->getEmail();
}
$email->addRecipient($email_address, $user->getUsername());
// Set who the email is from
$email->setFromEmail(sys_var('email_from'), sys_var('email_from_display'));
$state = $status_array[$check_result->getStatus()];
// Set the subject include UTF-8 curly quotes
if ($state == 'OK') {
$email->setSubject(str_replace('{check_name}', $check->prepareName(), sys_var('email_end_alert_subject')));
} else {
$email->setSubject(str_replace('{check_name}', $check->prepareName(), sys_var('email_subject')));
}
// Set the body to include a string containing UTF-8
$check_type = '';
if ($check->getType() == 'threshold') {
$check_type = ' Threshold';
} elseif ($check->getType() == 'predictive') {
$check_type = ' Standard Deviation';
}
$state_email_injection = $state . " Alert ";
if ($state == 'OK') {
$state_email_injection = "Everything's back to normal ";
}
// Remind : ('0' => 'OK', '1' => 'Error', '2' => 'Warning');
$state_int = $check_result->getStatus();
if ($state_int == 0) {
$color = "green";
} else {
if ($state_int == 2) {
$color = "orange";
} else {
$color = "red";
}
}
$html_body = "<p style='color:" . $color . ";'>" . $state_email_injection . "for {$check->prepareName()} </p>" . "<p>The check returned {$check_result->getValue()}</p>" . "<p>Warning" . $check_type . " is : " . $check->getWarn() . "</p>" . "<p>Error" . $check_type . " is : " . $check->getError() . "</p>" . "<p>View Alert Details : <a href='" . $GLOBALS['TATTLE_DOMAIN'] . '/' . CheckResult::makeURL('list', $check_result) . "'>" . $check->prepareName() . "</a></p>";
$email->setHTMLBody($html_body);
$email->setBody("\n {$state} Alert for {$check->prepareName()}\nThe check returned {$check_result->getValue()}\nWarning" . $check_type . " is : " . $check->getWarn() . "\nError" . $check_type . " is : " . $check->getError() . "\n ");
try {
$message_id = $email->send($smtp);
} catch (fConnectivityException $e) {
fCore::debug($e, FALSE);
fCore::debug("email send failed", FALSE);
$e->printMessage();
$e->printTrace();
}
}