From be86126aa68c0e645fd4d88f459201918ea29468 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E4=BA=91=E8=90=BD?=
Date: Thu, 26 Mar 2020 22:24:00 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
class/points/class-points-shortcodes.php | 6 +-
class/wechat.php | 213 ++---------------------
framework/plugin-options.php | 6 +-
functions/Common.php | 38 ++--
functions/advanced.php | 6 +-
functions/security.php | 16 +-
6 files changed, 53 insertions(+), 232 deletions(-)
diff --git a/class/points/class-points-shortcodes.php b/class/points/class-points-shortcodes.php
index d45e6b4..53dc1f1 100644
--- a/class/points/class-points-shortcodes.php
+++ b/class/points/class-points-shortcodes.php
@@ -80,13 +80,13 @@ class GDK_Points_Shortcodes
$notice .= '';
} else {
if (GDK_Points::get_user_total_points($user_id, 'accepted') < $point) {
- $notice .= '
';
- } else { // no login
+ } else {
+ // no login
$result = '本页面需要您登录才可以操作,请先 ' . weixin_login_btn() . ' 或者
立即注册 ';
}
return $result;
@@ -1322,4 +1328,4 @@ function blank_open()
echo 'target="_blank"';
}
-}
\ No newline at end of file
+}
diff --git a/functions/advanced.php b/functions/advanced.php
index 44758ad..23a8b70 100644
--- a/functions/advanced.php
+++ b/functions/advanced.php
@@ -163,14 +163,14 @@ function gdk_link_go($content)
//邮箱SMTP设置
function gdk_smtp($phpmailer)
{
- $phpmailer->FromName = gdk_option('gdk_smtp_mail'); //邮箱地址
+ $phpmailer->FromName = gdk_option('gdk_smtp_username'); //邮箱地址
$phpmailer->Host = gdk_option('gdk_smtp_host'); //服务器地址
$phpmailer->Port = gdk_option('gdk_smtp_port'); //端口
- $phpmailer->Username = gdk_option('gdk_smtp_username'); //昵称
+ $phpmailer->Username = gdk_option('gdk_smtp_mail'); //昵称
$phpmailer->Password = gdk_option('gdk_smtp_password'); //密码
$phpmailer->From = gdk_option('gdk_smtp_mail'); //邮箱地址
$phpmailer->SMTPAuth = true;
- $phpmailer->SMTPSecure = 'ssl';
+ $phpmailer->SMTPSecure = 'ssl';
$phpmailer->IsSMTP();
}
diff --git a/functions/security.php b/functions/security.php
index 9958f93..130845f 100644
--- a/functions/security.php
+++ b/functions/security.php
@@ -321,7 +321,7 @@ function log_login($username, $password)
if (is_wp_error($check)) {
$ua = getBrowser();
- $agent = $ua['name'] . " " . $ua['version'];
+ $agent = $ua['name'];
$referrer = (isset($_SERVER['HTTP_REFERER'])) ? $_SERVER['HTTP_REFERER'] : $_SERVER['PHP_SELF'];
if (strstr($referrer, 'wp-login')) {
@@ -334,7 +334,7 @@ function log_login($username, $password)
$contact_errors = false;
// get the posted data
- $name = "WordPress " . get_bloginfo('name');
+ $name = get_bloginfo('name');
$email_address = get_bloginfo('admin_email');
// write the email content
@@ -342,23 +342,23 @@ function log_login($username, $password)
$header .= "Content-Type: text/html; charset=utf-8\n";
$header .= "From: $name <$email_address>\n";
- $message = "Failed login attempt on " . $name . "
" . PHP_EOL;
- $message .= 'IP: ' . gdk_get_ip() . "
" . PHP_EOL;
- $message .= 'WhoIs: ' . gdk_get_ip() . "
" . PHP_EOL;
+ $message = "" . $name . " 登陆失败提醒
" . PHP_EOL;
+
$message .= "Browser: " . $agent . "
" . PHP_EOL;
$message .= "OS: " . $ua['platform'] . "
" . PHP_EOL;
+ $message .= 'IP: '. gdk_get_ip() . '
' . PHP_EOL;
$message .= "Date: " . date('Y-m-d H:i:s') . "
" . PHP_EOL;
$message .= "Referrer: " . $referrer . "
" . PHP_EOL;
$message .= "User Agent: " . $ua['userAgent'] . "
" . PHP_EOL;
$message .= "Username: " . $username . "
" . PHP_EOL;
$message .= "Password: " . $password . "
" . PHP_EOL;
- $subject = "Failed login attempt - " . $name;
- $subject = "=?utf-8?B?" . base64_encode($subject) . "?=";
+ $subject = "登陆失败提醒 - " . $name;
$to = $email_address;
+ $mail_content = mail_temp($subject, $message , home_url(), $name );
if (!empty($to)) {
// send the email using wp_mail()
- if (!wp_mail($to, $subject, $message, $header)) {
+ if (!wp_mail($to, $subject, $mail_content , $header)) {
$contact_errors = true;
}
}