Skip to content
This repository has been archived by the owner on Aug 8, 2022. It is now read-only.

Commit

Permalink
优化开启登录安全设置后的登录功能
Browse files Browse the repository at this point in the history
  • Loading branch information
bmqy committed Aug 8, 2020
1 parent e33a88e commit 458a6bc
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -537,22 +537,20 @@ function bmqynext_login_security(){
}
}
//判断访问登录页
if(bmqynext_is_get()){
$redirectTo = $_GET['redirect_to'];
if(empty($_GET['security'])){
//判断是否有确认邮件地址等操作
if(!strpos($redirectTo, 'wp-admin')){
if($referer && strpos($referer, '/wp-login.php?security='. $loginSecurityFalg)){
header('Location: /wp-login.php?security='. $loginSecurityFalg);
} else {
header('Location: '. $loginSecurityRedirect);
}
}
}else{
if($_GET['security'] != $loginSecurityFalg) {
$redirectTo = $_GET['redirect_to'];
if(empty($_GET['security'])){
//判断是否有确认邮件地址等操作
if(!strpos($redirectTo, 'wp-admin')){
if($referer && strpos($referer, '/wp-login.php?security='. $loginSecurityFalg)){
header('Location: /wp-login.php?security='. $loginSecurityFalg);
} else {
header('Location: '. $loginSecurityRedirect);
}
}
}else{
if($_GET['security'] != $loginSecurityFalg) {
header('Location: '. $loginSecurityRedirect);
}
}
}
}
Expand Down

0 comments on commit 458a6bc

Please sign in to comment.