Skip to content

Commit

Permalink
修正了GetGuestIP的问题,默认会读取remote_addr;
Browse files Browse the repository at this point in the history
  • Loading branch information
rainbowsoft committed Dec 12, 2024
1 parent c8c6a72 commit 1309058
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion zb_system/defend/default/external-link.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="robots" content="none" />
<meta name="viewport" content="width=device-width,viewport-fit=cover" />
<meta name="generator" content="{$option['ZC_BLOG_PRODUCT_FULL']}" />
Expand Down
4 changes: 3 additions & 1 deletion zb_system/function/c_system_common.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,9 @@ function GetGuestIP()

$user_ip = null;

if ($zbp->option['ZC_USING_CDN_GUESTIP_TYPE'] != 'REMOTE_ADDR') {
if ($zbp->option['ZC_USING_CDN_GUESTIP_TYPE'] == '') {
$user_ip = GetVars("REMOTE_ADDR", "SERVER");
} else {
$user_ip = GetVars($zbp->option['ZC_USING_CDN_GUESTIP_TYPE'], "SERVER");
}

Expand Down
4 changes: 2 additions & 2 deletions zb_system/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
Redirect302('cmd.php?act=admin');
}
?><!DOCTYPE HTML>
<html>
<html lang="<?php echo $lang['lang_bcp47']; ?>">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="ie=edge,chrome=1" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="robots" content="none" />
<meta name="viewport" content="width=device-width,viewport-fit=cover" />
<meta name="generator" content="<?php echo $option['ZC_BLOG_PRODUCT_FULL']; ?>" />
Expand Down
10 changes: 5 additions & 5 deletions zb_users/plugin/AdminColor/include.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,26 +68,26 @@ function AdminColor_Css()

list($fontsize, $leftwidth, $rightwidth, $background_positionX, $background_color) = AdminColor_GetValue();

echo '<script type="text/javascript">var lang_admincolor_closemenu2 = "' . $zbp->lang['AdminColor']['closemenu'] . '";var lang_admincolor_closemenu = "<i class=icon-caret-left-fill></i>' . $zbp->lang['AdminColor']['closemenu'] . '";var lang_admincolor_expandmenu2 = "' . $zbp->lang['AdminColor']['expandmenu'] . '";var lang_admincolor_expandmenu = "<i class=icon-caret-right-fill></i>' . $zbp->lang['AdminColor']['expandmenu'] . '"</script>' . "\r\n";
echo '<script>var lang_admincolor_closemenu2 = "' . $zbp->lang['AdminColor']['closemenu'] . '";var lang_admincolor_closemenu = "<i class=icon-caret-left-fill></i>' . $zbp->lang['AdminColor']['closemenu'] . '";var lang_admincolor_expandmenu2 = "' . $zbp->lang['AdminColor']['expandmenu'] . '";var lang_admincolor_expandmenu = "<i class=icon-caret-right-fill></i>' . $zbp->lang['AdminColor']['expandmenu'] . '"</script>' . "\r\n";

if ($zbp->Config('AdminColor')->ColorID < 10) {
Add_Filter_Plugin('Filter_Plugin_Admin_LeftMenu', 'AdminColor_Add_Button');
$hm = GetVars('admincolor_hm', 'COOKIE');
if ($hm == '1') {
echo '<style type="text/css">.left{width:36px;background-color:#ededed;}.left #leftmenu span{margin-left:11px;font-size:0;}.left #leftmenu span i{font-size:'.$fontsize.'px;}div.main,section.main{padding-left:46px;}.left #leftmenu li,.left #leftmenu a{width:'.$leftwidth.'px}';
echo '<style>.left{width:36px;background-color:#ededed;}.left #leftmenu span{margin-left:11px;font-size:0;}.left #leftmenu span i{font-size:'.$fontsize.'px;}div.main,section.main{padding-left:46px;}.left #leftmenu li,.left #leftmenu a{width:'.$leftwidth.'px}';
if ($zbp->Config('AdminColor')->ColorID == 9)
echo '.left{background-color:rgb(227, 234, 243);}';
echo '</style>';
}else{
echo '<style type="text/css">.left{width:'.$leftwidth.'px}.main{padding-left:'.$rightwidth.'px}.left #leftmenu li,.left #leftmenu a{width:'.$leftwidth.'px}</style>';
echo '<style>.left{width:'.$leftwidth.'px}.main{padding-left:'.$rightwidth.'px}.left #leftmenu li,.left #leftmenu a{width:'.$leftwidth.'px}</style>';
}
} elseif ($zbp->Config('AdminColor')->ColorID == 10) {
Add_Filter_Plugin('Filter_Plugin_Admin_LeftMenu', 'AdminColor_Add_Button');
$hm = GetVars('admincolor_hm', 'COOKIE');
if ($hm == '1') {
echo '<style type="text/css">.left{width:36px;background-color:#333333;}.left #leftmenu span{margin-left:11px;font-size:0;}.left #leftmenu span i{font-size:'.$fontsize.'px;}div.main,section.main{padding-left:46px;}body{background-position:-964px top;}.left #leftmenu #nav_admincolor2 span{margin-left:11px;}.left #leftmenu li,.left #leftmenu a{width:'.$leftwidth.'px}</style>';
echo '<style>.left{width:36px;background-color:#333333;}.left #leftmenu span{margin-left:11px;font-size:0;}.left #leftmenu span i{font-size:'.$fontsize.'px;}div.main,section.main{padding-left:46px;}body{background-position:-964px top;}.left #leftmenu #nav_admincolor2 span{margin-left:11px;}.left #leftmenu li,.left #leftmenu a{width:'.$leftwidth.'px}</style>';
}else{
echo '<style type="text/css">.left{width:'.$leftwidth.'px}.main{padding-left:'.$rightwidth.'px}body{background-position:'.$background_positionX.'px top;}.left #leftmenu li,.left #leftmenu a{width:'.$leftwidth.'px}</style>';
echo '<style>.left{width:'.$leftwidth.'px}.main{padding-left:'.$rightwidth.'px}body{background-position:'.$background_positionX.'px top;}.left #leftmenu li,.left #leftmenu a{width:'.$leftwidth.'px}</style>';
}
}

Expand Down
2 changes: 1 addition & 1 deletion zb_users/plugin/AdminColor/plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<adapted>151935</adapted>
<version>5.6</version>
<pubdate>2013-07-07</pubdate>
<modified>2021-11-30</modified>
<modified>2024-11-30</modified>
<price>0</price>
<phpver>5.2</phpver>
<advanced>
Expand Down

0 comments on commit 1309058

Please sign in to comment.