本文整理汇总了PHP中FSS_Helper::AutoLoginCreate方法的典型用法代码示例。如果您正苦于以下问题:PHP FSS_Helper::AutoLoginCreate方法的具体用法?PHP FSS_Helper::AutoLoginCreate怎么用?PHP FSS_Helper::AutoLoginCreate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FSS_Helper
的用法示例。
在下文中一共展示了FSS_Helper::AutoLoginCreate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Send
function Send()
{
$emails = $this->getAllTo();
// limit to max 15 email target addresses
if (count($emails) > 15) {
$emails = array_slice($emails, 0, 15);
}
if (strpos($this->body, "{login_code}") !== false) {
FSS_Settings::set('email_send_multiple', "multi");
}
if (FSS_Settings::Get('email_send_multiple') == "to" || FSS_Settings::Get('email_send_multiple') == "bcc") {
$mailer = $this->getMailer();
$mailer->isHTML($this->ishtml);
$mailer->setSubject($this->subject);
$mailer->setBody($this->body);
foreach ($emails as $email => $name) {
if (trim($email) == "") {
continue;
}
if (FSS_Settings::Get('email_send_multiple') == "bcc") {
$mailer->addBCC(array($email));
} else {
$mailer->addRecipient(array($email));
}
}
foreach ($this->files as $filename => $display) {
$mailer->addAttachment($display, $filename);
}
$this->debug_data['mailer'] = $mailer;
//SupportActions::DoAction("beforeEMailSend", $this->debug_data['Ticket'], $this->debug_data);
unset($this->debug_data['mailer']);
$mailer->Send();
} else {
foreach ($emails as $email => $name) {
if (trim($email) == "") {
continue;
}
$mailer = $this->getMailer();
$mailer->isHTML($this->ishtml);
$body = $this->body;
// strip and replace login code if its in the email
if (strpos($body, "{login_code}") !== false) {
// lookup user_id from email
$db = JFactory::getDBO();
$sql = "SELECT id FROM #__users WHERE email = '" . $db->escape($email) . "'";
$db->setQuery($sql);
$user_id = $db->loadResult();
if ($user_id > 1) {
$body = str_replace("{login_code}", FSS_Helper::AutoLoginCreate($user_id), $body);
} else {
$body = str_replace("{login_code}", "", $body);
}
}
$mailer->setSubject($this->subject);
$mailer->setBody($body);
$mailer->addRecipient(array($email));
foreach ($this->files as $filename => $display) {
$mailer->addAttachment($filename, $display);
}
$this->debug_data['mailer'] = $mailer;
//SupportActions::DoAction("beforeEMailSend", $this->debug_data['Ticket'], $this->debug_data);
unset($this->debug_data['mailer']);
$mailer->Send();
}
}
$this->doLog();
}