• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP getCorrectUserSalutation函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中getCorrectUserSalutation函数的典型用法代码示例。如果您正苦于以下问题:PHP getCorrectUserSalutation函数的具体用法?PHP getCorrectUserSalutation怎么用?PHP getCorrectUserSalutation使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了getCorrectUserSalutation函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: standard_error

     $log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
     standard_error('errorsendingmail', $email_full);
 }
 $mail->ClearAddresses();
 if (validateEmail($alternative_email) && $settings['panel']['sendalternativemail'] == 1) {
     $result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int) $userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($userinfo['def_language']) . '\' AND `templategroup`=\'mails\' AND `varname`=\'pop_success_alternative_subject\'');
     $mail_subject = replace_variables($result['value'] != '' ? $result['value'] : $lng['mails']['pop_success_alternative']['subject'], $replace_arr);
     $result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int) $userinfo['adminid'] . '\' AND `language`=\'' . $db->escape($userinfo['def_language']) . '\' AND `templategroup`=\'mails\' AND `varname`=\'pop_success_alternative_mailbody\'');
     $mail_body = replace_variables($result['value'] != '' ? $result['value'] : $lng['mails']['pop_success_alternative']['mailbody'], $replace_arr);
     $_mailerror = false;
     try {
         $mail->SetFrom($admin['email'], getCorrectUserSalutation($admin));
         $mail->Subject = $mail_subject;
         $mail->AltBody = $mail_body;
         $mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
         $mail->AddAddress($idna_convert->encode($alternative_email), getCorrectUserSalutation($userinfo));
         $mail->Send();
     } catch (phpmailerException $e) {
         $mailerr_msg = $e->errorMessage();
         $_mailerror = true;
     } catch (Exception $e) {
         $mailerr_msg = $e->getMessage();
         $_mailerror = true;
     }
     if ($_mailerror) {
         $log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
         standard_error(array('errorsendingmail', $alternative_email));
     }
     $mail->ClearAddresses();
 }
 redirectTo($filename, array('page' => 'emails', 'action' => 'edit', 'id' => $id, 's' => $s));
开发者ID:Alkyoneus,项目名称:Froxlor,代码行数:31,代码来源:customer_email.php


示例2: SUM

$mail->CharSet = "UTF-8";
if (PHPMailer::ValidateAddress(Settings::Get('panel.adminmail')) !== false) {
    // set return-to address and custom sender-name, see #76
    $mail->SetFrom(Settings::Get('panel.adminmail'), Settings::Get('panel.adminmail_defname'));
    if (Settings::Get('panel.adminmail_return') != '') {
        $mail->AddReplyTo(Settings::Get('panel.adminmail_return'), Settings::Get('panel.adminmail_defname'));
    }
}
// Warn the customers at xx% traffic-usage
$result_stmt = Database::prepare("\n\tSELECT `c`.`customerid`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,\n\t`c`.`company`, `c`.`traffic`, `c`.`email`, `c`.`def_language`,\n\t`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`,\n\t(SELECT SUM(`t`.`http` + `t`.`ftp_up` + `t`.`ftp_down` + `t`.`mail`)\n\tFROM `" . TABLE_PANEL_TRAFFIC . "` `t`\n\tWHERE `t`.`customerid` = `c`.`customerid` AND `t`.`year` = :year AND `t`.`month` = :month\n\t) as `traffic_used`\n\tFROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c`\n\tLEFT JOIN `" . TABLE_PANEL_ADMINS . "` AS `a`\n\tON `a`.`adminid` = `c`.`adminid` WHERE `c`.`reportsent` <> '1'\n");
$result_data = array('year' => date("Y", $yesterday), 'month' => date("m", $yesterday));
Database::pexecute($result_stmt, $result_data);
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
    if (isset($row['traffic']) && $row['traffic'] > 0 && $row['traffic_used'] != null && $row['traffic_used'] * 100 / $row['traffic'] >= (int) Settings::Get('system.report_trafficmax')) {
        $rep_userinfo = array('name' => $row['name'], 'firstname' => $row['firstname'], 'company' => $row['company']);
        $replace_arr = array('SALUTATION' => getCorrectUserSalutation($rep_userinfo), 'NAME' => $row['name'], 'TRAFFIC' => round($row['traffic'] / 1024, 2), 'TRAFFICUSED' => round($row['traffic_used'] / 1024, 2), 'USAGE_PERCENT' => round($row['traffic_used'] * 100 / $row['traffic'], 2), 'MAX_PERCENT' => Settings::Get('system.report_trafficmax'));
        $lngfile_stmt = Database::prepare("\n\t\t\tSELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`\n\t\t\tWHERE `language` = :deflang\n\t\t");
        $lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => $row['def_language']));
        if ($lngfile !== null) {
            $langfile = $lngfile['file'];
        } else {
            $lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => Settings::Get('panel.standardlanguage')));
            $langfile = $lngfile['file'];
        }
        // include english language file (fallback)
        include_once makeCorrectFile(FROXLOR_INSTALL_DIR . '/lng/english.lng.php');
        // include admin/customer language file
        include_once makeCorrectFile(FROXLOR_INSTALL_DIR . '/' . $langfile);
        // Get mail templates from database; the ones from 'admin' are fetched for fallback
        $result2_stmt = Database::prepare("\n\t\t\tSELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`\n\t\t\tWHERE `adminid` = :adminid\n\t\t\tAND `language` = :lang\n\t\t\tAND `templategroup` = 'mails' AND `varname` = :varname\n\t\t");
        $result2_data = array('adminid' => $row['adminid'], 'lang' => $row['def_language'], 'varname' => 'trafficmaxpercent_subject');
开发者ID:asemen,项目名称:Froxlor,代码行数:31,代码来源:cron_usage_report.php


示例3: array

     $def_language = $userinfo['def_language'];
     $result_stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`\n\t\t\t\t\t\t\tWHERE `adminid` = :adminid\n\t\t\t\t\t\t\tAND `language` = :lang\n\t\t\t\t\t\t\tAND `templategroup`='mails'\n\t\t\t\t\t\t\tAND `varname`='new_ftpaccount_by_customer_subject'");
     Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
     $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
     $mail_subject = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $lng['mails']['new_ftpaccount_by_customer']['subject'], $replace_arr));
     $def_language = $userinfo['def_language'];
     $result_stmt = Database::prepare("SELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`\n\t\t\t\t\t\t\tWHERE `adminid` = :adminid\n\t\t\t\t\t\t\tAND `language` = :lang\n\t\t\t\t\t\t\tAND `templategroup`='mails'\n\t\t\t\t\t\t\tAND `varname`='new_ftpaccount_by_customer_mailbody'");
     Database::pexecute($result_stmt, array("adminid" => $userinfo['adminid'], "lang" => $def_language));
     $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
     $mail_body = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $lng['mails']['new_ftpaccount_by_customer']['mailbody'], $replace_arr));
     $_mailerror = false;
     try {
         $mail->Subject = $mail_subject;
         $mail->AltBody = $mail_body;
         $mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
         $mail->AddAddress($userinfo['email'], getCorrectUserSalutation($userinfo));
         $mail->Send();
     } catch (phpmailerException $e) {
         $mailerr_msg = $e->errorMessage();
         $_mailerror = true;
     } catch (Exception $e) {
         $mailerr_msg = $e->getMessage();
         $_mailerror = true;
     }
     if ($_mailerror) {
         $log->logAction(USR_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
         standard_error('errorsendingmail', $userinfo['email']);
     }
     $mail->ClearAddresses();
 }
 redirectTo($filename, array('page' => $page, 's' => $s));
开发者ID:asemen,项目名称:Froxlor,代码行数:31,代码来源:customer_ftp.php


示例4: array

     $srv_ip_stmt = Database::prepare("\n\t\t\t\t\t\t\tSELECT ip, port FROM `" . TABLE_PANEL_IPSANDPORTS . "`\n\t\t\t\t\t\t\tWHERE `id` = :defaultip\n\t\t\t\t\t\t");
     $srv_ip = Database::pexecute_first($srv_ip_stmt, array('defaultip' => Settings::Get('system.defaultip')));
     $replace_arr = array('FIRSTNAME' => $firstname, 'NAME' => $name, 'COMPANY' => $company, 'SALUTATION' => getCorrectUserSalutation(array('firstname' => $firstname, 'name' => $name, 'company' => $company)), 'USERNAME' => $loginname, 'PASSWORD' => $password, 'SERVER_HOSTNAME' => $srv_hostname, 'SERVER_IP' => isset($srv_ip['ip']) ? $srv_ip['ip'] : '', 'SERVER_PORT' => isset($srv_ip['port']) ? $srv_ip['port'] : '', 'DOMAINNAME' => $_stdsubdomain);
     // Get mail templates from database; the ones from 'admin' are fetched for fallback
     $result_stmt = Database::prepare("\n\t\t\t\t\t\t\tSELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`\n\t\t\t\t\t\t\tWHERE `adminid` = :adminid AND `language` = :deflang AND `templategroup` = 'mails' AND `varname` = 'createcustomer_subject'");
     $result = Database::pexecute_first($result_stmt, array('adminid' => $userinfo['adminid'], 'deflang' => $def_language));
     $mail_subject = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $lng['mails']['createcustomer']['subject'], $replace_arr));
     $result_stmt = Database::prepare("\n\t\t\t\t\t\t\tSELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`\n\t\t\t\t\t\t\tWHERE `adminid` = :adminid AND `language` = :deflang AND `templategroup` = 'mails' AND `varname` = 'createcustomer_mailbody'");
     $result = Database::pexecute_first($result_stmt, array('adminid' => $userinfo['adminid'], 'deflang' => $def_language));
     $mail_body = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $lng['mails']['createcustomer']['mailbody'], $replace_arr));
     $_mailerror = false;
     try {
         $mail->Subject = $mail_subject;
         $mail->AltBody = $mail_body;
         $mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
         $mail->AddAddress($email, getCorrectUserSalutation(array('firstname' => $firstname, 'name' => $name, 'company' => $company)));
         $mail->Send();
     } catch (phpmailerException $e) {
         $mailerr_msg = $e->errorMessage();
         $_mailerror = true;
     } catch (Exception $e) {
         $mailerr_msg = $e->getMessage();
         $_mailerror = true;
     }
     if ($_mailerror) {
         $log->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
         standard_error('errorsendingmail', $email);
     }
     $mail->ClearAddresses();
     $log->logAction(ADM_ACTION, LOG_NOTICE, "automatically sent password to user '" . $loginname . "'");
 }
开发者ID:mowamed,项目名称:Froxlor,代码行数:31,代码来源:admin_customers.php


示例5: while

     // make it two times larger than password_min_length
     $rnd = '';
     $minlength = $settings['panel']['password_min_length'];
     while (strlen($rnd) < $minlength * 2) {
         $rnd .= md5(uniqid(microtime(), 1));
     }
     $password = substr($rnd, (int) ($minlength / 2), $minlength);
 }
 if ($adminchecked) {
     $db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `password`='" . md5($password) . "'\n\t\t\t\t\t\t\t\tWHERE `loginname`='" . $user['loginname'] . "'\n\t\t\t\t\t\t\t\tAND `email`='" . $user['email'] . "'");
 } else {
     $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `password`='" . md5($password) . "'\n\t\t\t\t\t\t\t\tWHERE `loginname`='" . $user['loginname'] . "'\n\t\t\t\t\t\t\t\tAND `email`='" . $user['email'] . "'");
 }
 $rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'), $db, $settings);
 $rstlog->logAction(USR_ACTION, LOG_WARNING, "Password for user '" . $user['loginname'] . "' has been reset!");
 $replace_arr = array('SALUTATION' => getCorrectUserSalutation($user), 'USERNAME' => $user['loginname'], 'PASSWORD' => $password);
 $body = strtr($lng['pwdreminder']['body'], array('%s' => $user['firstname'] . ' ' . $user['name'], '%p' => $password));
 $def_language = $user['def_language'] != '' ? $user['def_language'] : $settings['panel']['standardlanguage'];
 $result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int) $user['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'password_reset_subject\'');
 $mail_subject = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $lng['pwdreminder']['subject'], $replace_arr));
 $result = $db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '` WHERE `adminid`=\'' . (int) $user['adminid'] . '\' AND `language`=\'' . $db->escape($def_language) . '\' AND `templategroup`=\'mails\' AND `varname`=\'password_reset_mailbody\'');
 $mail_body = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $body, $replace_arr));
 $_mailerror = false;
 try {
     $mail->Subject = $mail_subject;
     $mail->AltBody = $mail_body;
     $mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
     $mail->AddAddress($user['email'], $user['firstname'] . ' ' . $user['name']);
     $mail->Send();
 } catch (phpmailerException $e) {
     $mailerr_msg = $e->errorMessage();
开发者ID:Alkyoneus,项目名称:Froxlor,代码行数:31,代码来源:index.php


示例6: while

 * COPYING file online at http://files.froxlor.org/misc/COPYING.txt
 *
 * @copyright  (c) the authors
 * @author     Froxlor team <[email protected]> (2010-)
 * @license    GPLv2 http://files.froxlor.org/misc/COPYING.txt
 * @package    Cron
 *
 */
/**
 * report about diskusage for customers
 */
$result_stmt = Database::query("\n\tSELECT `c`.`customerid`, `c`.`adminid`, `c`.`name`, `c`.`firstname`,\n\t`c`.`company`, `c`.`diskspace`, `c`.`diskspace_used`, `c`.`email`, `c`.`def_language`,\n\t`a`.`name` AS `adminname`, `a`.`email` AS `adminmail`\n\tFROM `" . TABLE_PANEL_CUSTOMERS . "` AS `c`\n    LEFT JOIN `" . TABLE_PANEL_ADMINS . "` AS `a`\n    ON `a`.`adminid` = `c`.`adminid`\n    WHERE `c`.`diskspace` > '0' AND `c`.`reportsent` <> '2'\n");
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
    if (isset($row['diskspace']) && $row['diskspace_used'] != null && $row['diskspace_used'] > 0 && $row['diskspace_used'] * 100 / $row['diskspace'] >= (int) Settings::Get('system.report_webmax')) {
        $rep_userinfo = array('name' => $row['name'], 'firstname' => $row['firstname'], 'company' => $row['company']);
        $replace_arr = array('SALUTATION' => getCorrectUserSalutation($rep_userinfo), 'NAME' => $row['name'], 'DISKAVAILABLE' => round($row['diskspace'] / 1024, 2), 'DISKUSED' => round($row['diskspace_used'] / 1024, 2), 'USAGE_PERCENT' => round($row['diskspace_used'] * 100 / $row['diskspace'], 2), 'MAX_PERCENT' => Settings::Get('system.report_webmax'));
        $lngfile_stmt = Database::prepare("\n\t\t\tSELECT `file` FROM `" . TABLE_PANEL_LANGUAGE . "`\n\t\t\tWHERE `language` = :deflang\n\t\t");
        $lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => $row['def_language']));
        if ($lngfile !== null) {
            $langfile = $lngfile['file'];
        } else {
            $lngfile = Database::pexecute_first($lngfile_stmt, array('deflang' => Settings::Get('panel.standardlanguage')));
            $langfile = $lngfile['file'];
        }
        // include english language file (fallback)
        include_once makeCorrectFile(FROXLOR_INSTALL_DIR . '/lng/english.lng.php');
        // include admin/customer language file
        include_once makeCorrectFile(FROXLOR_INSTALL_DIR . '/' . $langfile);
        // Get mail templates from database; the ones from 'admin' are fetched for fallback
        $result2_stmt = Database::prepare("\n\t\t\tSELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`\n\t\t\tWHERE `adminid` = :adminid\n\t\t\tAND `language` = :lang\n\t\t\tAND `templategroup` = 'mails' AND `varname` = :varname\n\t\t");
        $result2_data = array('adminid' => $row['adminid'], 'lang' => $row['def_language'], 'varname' => 'diskmaxpercent_subject');
开发者ID:Git-Host,项目名称:Froxlor,代码行数:31,代码来源:cron_usage.inc.diskspace.php


示例7: sendMail

    /**
     * Mail notifications
     */
    public function sendMail($customerid = -1, $template_subject = null, $default_subject = null, $template_body = null, $default_body = null)
    {
        global $mail, $theme;
        // Some checks are to be made here in the future
        if ($customerid != -1) {
            // Get e-mail message for customer
            $usr_stmt = Database::prepare('
				SELECT `name`, `firstname`, `company`, `email`
				FROM `' . TABLE_PANEL_CUSTOMERS . '` WHERE `customerid` = :customerid');
            $usr = Database::pexecute_first($usr_stmt, array('customerid' => $customerid));
            $replace_arr = array('FIRSTNAME' => $usr['firstname'], 'NAME' => $usr['name'], 'COMPANY' => $usr['company'], 'SALUTATION' => getCorrectUserSalutation($usr), 'SUBJECT' => $this->Get('subject', true));
        } else {
            $replace_arr = array('SUBJECT' => $this->Get('subject', true));
        }
        $tpl_seldata = array('adminid' => $this->userinfo['adminid'], 'lang' => $this->userinfo['def_language'], 'tplsubject' => $template_subject);
        $result_stmt = Database::prepare("\n\t\t\tSELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`\n\t\t\tWHERE `adminid`= :adminid\n\t\t\tAND `language`= :lang\n\t\t\tAND `templategroup`= 'mails' AND `varname`= :tplsubject");
        $result = Database::pexecute_first($result_stmt, $tpl_seldata);
        $mail_subject = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $default_subject, $replace_arr));
        unset($tpl_seldata['tplsubject']);
        $tpl_seldata['tplmailbody'] = $template_body;
        $result_stmt = Database::prepare("\n\t\t\tSELECT `value` FROM `" . TABLE_PANEL_TEMPLATES . "`\n\t\t\tWHERE `adminid`= :adminid\n\t\t\tAND `language`= :lang\n\t\t\tAND `templategroup`= 'mails' AND `varname`= :tplmailbody");
        $result = Database::pexecute_first($result_stmt, $tpl_seldata);
        $mail_body = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $default_body, $replace_arr));
        if ($customerid != -1) {
            $_mailerror = false;
            try {
                $mail->SetFrom(Settings::Get('ticket.noreply_email'), Settings::Get('ticket.noreply_name'));
                $mail->Subject = $mail_subject;
                $mail->AltBody = $mail_body;
                $mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
                $mail->AddAddress($usr['email'], $usr['firstname'] . ' ' . $usr['name']);
                $mail->Send();
            } catch (phpmailerException $e) {
                $mailerr_msg = $e->errorMessage();
                $_mailerror = true;
            } catch (Exception $e) {
                $mailerr_msg = $e->getMessage();
                $_mailerror = true;
            }
            if ($_mailerror) {
                $rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'ticket_class'));
                $rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
                standard_error('errorsendingmail', $usr['email']);
            }
            $mail->ClearAddresses();
        } else {
            $admin_stmt = Database::prepare("\n\t\t\t\tSELECT `name`, `email` FROM `" . TABLE_PANEL_ADMINS . "`\n\t\t\t\tWHERE `adminid` = :adminid");
            $admin = Database::pexecute_first($admin_stmt, array('adminid' => $this->userinfo['adminid']));
            $_mailerror = false;
            try {
                $mail->SetFrom(Settings::Get('ticket.noreply_email'), Settings::Get('ticket.noreply_name'));
                $mail->Subject = $mail_subject;
                $mail->AltBody = $mail_body;
                $mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
                $mail->AddAddress($admin['email'], $admin['name']);
                $mail->Send();
            } catch (phpmailerException $e) {
                $mailerr_msg = $e->errorMessage();
                $_mailerror = true;
            } catch (Exception $e) {
                $mailerr_msg = $e->getMessage();
                $_mailerror = true;
            }
            if ($_mailerror) {
                $rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'ticket_class'));
                $rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
                standard_error('errorsendingmail', $admin['email']);
            }
            $mail->ClearAddresses();
        }
    }
开发者ID:Git-Host,项目名称:Froxlor,代码行数:74,代码来源:class.ticket.php


示例8: sendMail

 /**
  * Mail notifications
  */
 public function sendMail($customerid = -1, $template_subject = null, $default_subject = null, $template_body = null, $default_body = null)
 {
     global $mail;
     // Some checks are to be made here in the future
     if ($customerid != -1) {
         // Get e-mail message for customer
         $usr = $this->db->query_first('SELECT `name`, `firstname`, `company`, `email`
                            FROM `' . TABLE_PANEL_CUSTOMERS . '` 
                            WHERE `customerid` = "' . (int) $customerid . '"');
         $replace_arr = array('FIRSTNAME' => $usr['firstname'], 'NAME' => $usr['name'], 'COMPANY' => $usr['company'], 'SALUTATION' => getCorrectUserSalutation($usr), 'SUBJECT' => $this->Get('subject', true));
     } else {
         $replace_arr = array('SUBJECT' => $this->Get('subject', true));
     }
     $result = $this->db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
                             WHERE `adminid`=\'' . (int) $this->userinfo['adminid'] . '\' 
                             AND `language`=\'' . $this->db->escape($this->userinfo['def_language']) . '\' 
                             AND `templategroup`=\'mails\' 
                             AND `varname`=\'' . $template_subject . '\'');
     $mail_subject = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $default_subject, $replace_arr));
     $result = $this->db->query_first('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
                             WHERE `adminid`=\'' . (int) $this->userinfo['adminid'] . '\' 
                             AND `language`=\'' . $this->db->escape($this->userinfo['def_language']) . '\' 
                             AND `templategroup`=\'mails\' 
                             AND `varname`=\'' . $template_body . '\'');
     $mail_body = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $default_body, $replace_arr));
     if ($customerid != -1) {
         $_mailerror = false;
         try {
             $mail->SetFrom($this->settings['ticket']['noreply_email'], $this->settings['ticket']['noreply_name']);
             $mail->Subject = $mail_subject;
             $mail->AltBody = $mail_body;
             $mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
             $mail->AddAddress($usr['email'], $usr['firstname'] . ' ' . $usr['name']);
             $mail->Send();
         } catch (phpmailerException $e) {
             $mailerr_msg = $e->errorMessage();
             $_mailerror = true;
         } catch (Exception $e) {
             $mailerr_msg = $e->getMessage();
             $_mailerror = true;
         }
         if ($_mailerror) {
             $rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'ticket_class'), $this->db, $this->settings);
             $rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
             standard_error('errorsendingmail', $usr['email']);
         }
         $mail->ClearAddresses();
     } else {
         $admin = $this->db->query_first("SELECT `name`, `email` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid`='" . (int) $this->userinfo['adminid'] . "'");
         $_mailerror = false;
         try {
             $mail->SetFrom($this->settings['ticket']['noreply_email'], $this->settings['ticket']['noreply_name']);
             $mail->Subject = $mail_subject;
             $mail->AltBody = $mail_body;
             $mail->MsgHTML(str_replace("\n", "<br />", $mail_body));
             $mail->AddAddress($admin['email'], $admin['name']);
             $mail->Send();
         } catch (phpmailerException $e) {
             $mailerr_msg = $e->errorMessage();
             $_mailerror = true;
         } catch (Exception $e) {
             $mailerr_msg = $e->getMessage();
             $_mailerror = true;
         }
         if ($_mailerror) {
             $rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'ticket_class'), $this->db, $this->settings);
             $rstlog->logAction(ADM_ACTION, LOG_ERR, "Error sending mail: " . $mailerr_msg);
             standard_error('errorsendingmail', $admin['email']);
         }
         $mail->ClearAddresses();
     }
 }
开发者ID:Alkyoneus,项目名称:Froxlor,代码行数:75,代码来源:class.ticket.php


示例9: array

						SELECT `firstname`, `name`, `company`, `email`  FROM `' . TABLE_PANEL_CUSTOMERS . "`\n\t\t\t\t\t\tWHERE `adminid` = :adminid");
                    Database::pexecute($result, array('adminid' => $userinfo['adminid']));
                }
            } else {
                standard_error('noreceipientsgiven');
            }
            $subject = $_POST['subject'];
            $message = wordwrap($_POST['message'], 70);
            if (!empty($message)) {
                $mailcounter = 0;
                $mail->Body = $message;
                $mail->Subject = $subject;
                while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
                    $row['firstname'] = isset($row['firstname']) ? $row['firstname'] : '';
                    $row['company'] = isset($row['company']) ? $row['company'] : '';
                    $mail->AddAddress($row['email'], getCorrectUserSalutation(array('firstname' => $row['firstname'], 'name' => $row['name'], 'company' => $row['company'])));
                    $mail->From = $userinfo['email'];
                    $mail->FromName = (isset($userinfo['firstname']) ? $userinfo['firstname'] . ' ' : '') . $userinfo['name'];
                    if (!$mail->Send()) {
                        if ($mail->ErrorInfo != '') {
                            $mailerr_msg = $mail->ErrorInfo;
                        } else {
                            $mailerr_msg = $row['email'];
                        }
                        $log->logAction(ADM_ACTION, LOG_ERR, 'Error sending mail: ' . $mailerr_msg);
                        standard_error('errorsendingmail', $row['email']);
                    }
                    $mailcounter++;
                    $mail->ClearAddresses();
                }
                redirectTo($filename, array('page' => $page, 's' => $s, 'action' => 'showsuccess', 'sentitems' => $mailcounter));
开发者ID:fritz-net,项目名称:Froxlor,代码行数:31,代码来源:admin_message.php


示例10: empty

                    $rstlog = FroxlorLogger::getInstanceOf(array('loginname' => 'password_reset'));
                    $rstlog->logAction(USR_ACTION, LOG_WARNING, "User '" . $user['loginname'] . "' requested a link for setting a new password.");
                    // Set together our activation link
                    $protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https';
                    // this can be a fixed value to avoid potential exploiting by modifying headers
                    $host = Settings::Get('system.hostname');
                    // $_SERVER['HTTP_HOST'];
                    $port = $_SERVER['SERVER_PORT'] != 80 ? ':' . $_SERVER['SERVER_PORT'] : '';
                    // there can be only one script to handle this so we can use a fixed value here
                    $script = "/index.php";
                    // $_SERVER['SCRIPT_NAME'];
                    if (Settings::Get('system.froxlordirectlyviahostname') == 0) {
                        $script = makeCorrectFile("/" . basename(__DIR__) . "/" . $script);
                    }
                    $activationlink = $protocol . '://' . $host . $port . $script . '?action=resetpwd&resetcode=' . $activationcode;
                    $replace_arr = array('SALUTATION' => getCorrectUserSalutation($user), 'USERNAME' => $user['loginname'], 'LINK' => $activationlink);
                    $body = strtr($lng['pwdreminder']['body'], array('%s' => $user['firstname'] . ' ' . $user['name'], '%a' => $activationlink));
                    $def_language = $user['def_language'] != '' ? $user['def_language'] : Settings::Get('panel.standardlanguage');
                    $result_stmt = Database::prepare('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
						WHERE `adminid`= :adminid
						AND `language`= :lang
						AND `templategroup`=\'mails\'
						AND `varname`=\'password_reset_subject\'');
                    Database::pexecute($result_stmt, array("adminid" => $user['adminid'], "lang" => $def_language));
                    $result = $result_stmt->fetch(PDO::FETCH_ASSOC);
                    $mail_subject = html_entity_decode(replace_variables($result['value'] != '' ? $result['value'] : $lng['pwdreminder']['subject'], $replace_arr));
                    $result_stmt = Database::prepare('SELECT `value` FROM `' . TABLE_PANEL_TEMPLATES . '`
						WHERE `adminid`= :adminid
						AND `language`= :lang
						AND `templategroup`=\'mails\'
						AND `varname`=\'password_reset_mailbody\'');
开发者ID:Git-Host,项目名称:Froxlor,代码行数:31,代码来源:index.php



注:本文中的getCorrectUserSalutation函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP getCount函数代码示例发布时间:2022-05-15
下一篇:
PHP getCookie函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap