Skip to content

Commit

Permalink
v2.8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
icret committed Jan 19, 2024
1 parent a1e8059 commit fe237dd
Show file tree
Hide file tree
Showing 58 changed files with 1,932 additions and 2,343 deletions.
595 changes: 343 additions & 252 deletions admin/admin.inc.php

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions admin/filer.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@
<meta name="keywords" content="<?php echo $config['keywords']; ?>" />
<meta name="description" content="<?php echo $config['description']; ?>" />
<link rel="shortcut icon" href="<?php static_cdn(); ?>/favicon.ico" type="image/x-icon" />
<link href="<?php static_cdn(); ?>/public/static/zui/css/zui.min.css" rel="stylesheet">
<script src="<?php static_cdn(); ?>/public/static/zui/lib/jquery/jquery-3.6.0.min.js"></script>
<script src="<?php static_cdn(); ?>/public/static/zui/js/zui.min.js"></script>
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/zui/css/zui.min.css">
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/zui/lib/jquery/jquery-3.6.0.min.js"></script>
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/zui/js/zui.min.js"></script>
<style type="text/css">
body {
font-size: 14px;
Expand Down
197 changes: 197 additions & 0 deletions admin/inc.check.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
<?php

/** 禁止直接访问 */
defined('APP_ROOT') ?: exit;

// 开启 DEBUG 2023-04-03
if (!ini_get('display_errors')) {
ini_set('display_errors', 'On');
}
error_reporting(E_ALL);

// 检查当前PHP版本是否大于7.0
if (PHP_VERSION < 7) {
echo '
new $.zui.Messager("当前PHP版本<7.0, 部分功能受限!",{
type: "primary", // 定义颜色主题
time:2000
}).show();
';
}

// 扩展检测
$expand = array('fileinfo', 'iconv', 'gd', 'mbstring', 'openssl',);
foreach ($expand as $val) {
if (!extension_loaded($val)) {
echo '
new $.zui.Messager("扩展:' . $val . '- 未安装,可能导致图片上传失败! 请尽快修复。",{
type: "black", // 定义颜色主题
icon: "exclamation-sign", // 定义消息图标
time:2200
}).show();
';
}
}

// 检测是否修改默认密码
if ($config['password'] === '7676aaafb027c825bd9abab78b234070e702752f625b752e55e55b48e607e358') {
echo '
new $.zui.Messager("请修改默认密码,否则会有泄露风险! ",{
type: "warning", // 定义颜色主题
time:2400
}).show();
';
}

// 检测是否局域网访问
if (is_local($config['domain']) || is_local($config['imgurl'])) {
echo '
new $.zui.Messager("当前使用局域网,可能会导致外网访问异常!",{
type: "black", // 定义颜色主题
time:2600
}).show();
';
}

// 检测是否存在.user.ini
if (file_exists(APP_ROOT . '/.user.ini')) {
echo '
new $.zui.Messager("请关闭防跨目录读写或删除.user.ini文件",{
type: "danger", // 定义颜色主题
time:2700
}).show();
';
}

// 检测是否存在 IP数据库文件 ip2region.xdb
if (!file_exists(APP_ROOT . '/app/ip2region/ip2region.xdb')) {
echo '
new $.zui.Messager("IP 数据库不存在, 请在系统信息中查看 Ip2region",{
type: "danger", // 定义颜色主题
time:2900
}).show();
';
}

// 检查当前版本与GitHub版本
if (getVersion() !== APP_VERSION) {
echo '
new $.zui.Messager("当前版本与GitHub不一致,请检查当前是否最新版本!",{
type: "danger", // 定义颜色主题
time:3100
}).show();
';
}

// 检测是否开启登录上传
if ($config['mustLogin']) {
echo '
$.zui.browser.tip("请注意: 当前已开启登录上传,游客不能上传图片!");
';
}

// 检测水印图片是否存在
if (!is_file(APP_ROOT . $config['waterImg'])) {
echo '
new $.zui.Messager("水印图片不存在,请检测路径或者文件是否存在!",{
type: "danger", // 定义颜色主题
time:3300
}).show();
';
}

// 检测水印字体是否存在
if (!is_file(APP_ROOT . $config['textFont'])) {
echo '
new $.zui.Messager("水印字体不存在,请检测路径或者文件是否存在!",{
type: "danger", // 定义颜色主题
time:3500
}).show();
';
}

// 检测监黄接口是否可以访问
if ($config['checkImg'] !== 0) {

if ($config['checkImg'] === 1) {

if (!@IP_URL_Ping('api.moderatecontent.com', 80, 1)) {
echo '
new $.zui.Messager("moderatecontent 鉴黄接口无法ping通! ",{
type: "warning", // 定义颜色主题
time:3700
}).show();
';
}
}

if ($config['checkImg'] === 2) {

$ip = parse_url($config['nsfwjs_url'])['host'];
$port = parse_url($config['nsfwjs_url'])['port'];

if (filter_var($ip, FILTER_VALIDATE_IP)) {
if (!@IP_URL_Ping($ip, $port, 1)) {
echo '
new $.zui.Messager("' . $ip . $port . ' 鉴黄接口无法ping通! ",{
type: "warning", // 定义颜色主题
time:3700
}).show();
';
}
} else {
if (!@IP_URL_Ping($ip, 80, 1)) {
echo '
new $.zui.Messager("' . $ip . ' 鉴黄接口无法ping通! ",{
type: "warning", // 定义颜色主题
time:3700
}).show();
';
}
}
}
}

if (!function_exists('fastcgi_finish_request')) {
echo '
new $.zui.Messager("开启 fastcgi_finish_request 处理数据会更快喔!",{
type: "primary", // 定义颜色主题
time:3900
}).show();
';
}

// FTP检测
if ($config['ftp_status']) {

if (!extension_loaded('ftp')) { // 检测FTP扩展是否开启
echo '
new $.zui.Messager("FTP 错误: FTP 扩展未开启, 无法使用远程附件",{
type: "info", // 定义颜色主题
time:4000
}).show();
';
} else {
// 登录FTP
require_once APP_ROOT . '/app/Ftp.php';
try {
$ftp = new Ftp;

if ($config['ftp_ssl'] === 1) {
$ftp->sslConnect($config['ftp_host'], $config['ftp_port'], $config['ftp_time']);
} else {
$ftp->connect($config['ftp_host'], $config['ftp_port'], $config['ftp_time']);
}

$ftp->login($config['ftp_user'], $config['ftp_pass']);
$ftp->pasv($config['ftp_pasv']);
} catch (FtpException $e) {
echo '
new $.zui.Messager("FTP 错误:' . $e->getMessage() . '",{
type: "info", // 定义颜色主题
time:4300
}).show();
';
}
}
}
11 changes: 6 additions & 5 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
write_login_log($_POST['user'], $_POST['password'], $login["messege"]);
}
?>
<link href="<?php static_cdn(); ?>/public/static/login.css" rel="stylesheet">
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/login.css">
<!-- 忘记密码 -->
<div class="modal fade" id="fogot">
<div class="modal-dialog ">
Expand Down Expand Up @@ -128,8 +128,7 @@
<h2>登录</h2>
<label for="account" class="col-sm-2"></label>
<input type="text" name="user" id="account" class="form-control" value="" placeholder="输入登录账号" autocomplete="off" required="required">
<input type="password" name="password" id="password" class="form-control" value="" placeholder="输入登录密码" autocomplete="off" required="required">
<input type="hidden" name="password" id="md5_password">
<input type="password" name="password" id="password" class="form-control" value="" placeholder="输入登录密码" autocomplete="off" required="required"><input type="hidden" name="password" id="md5_password">
<?php if ($config['captcha']) : ?>
<input class="form-control" type="text" name="code" value="" placeholder="请输入验证码" autocomplete="off" required="required" />
<div class="form-group">
Expand Down Expand Up @@ -161,13 +160,15 @@
</div>
</section>
</form>
<script src="<?php static_cdn(); ?>/public/static/crypto/SHA256.js"></script>
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/crypto/SHA256.js"></script>
<script>
function md5_post() {
var password = document.getElementById('password');
var md5pwd = document.getElementById('md5_password');
md5pwd.value = SHA256(password.value);
//可以校验判断表单内容,true就是通过提交,false,阻止提交
// fix https://github.com/icret/EasyImages2.0/pull/163
password.value = "Null";
// 可以校验判断表单内容,true就是通过提交,false,阻止提交
return true;
}

Expand Down
10 changes: 5 additions & 5 deletions admin/manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1258,7 +1258,7 @@ function getUploadExt() {
return '';
}
?>
<link href="<?php static_cdn(); ?>/public/static/tinyfilemanager/dropzone.min.css" rel="stylesheet">
<link rel="stylesheet" href="<?php static_cdn(); ?>/public/static/tinyfilemanager/dropzone.min.css">
<div class="path">

<div class="card mb-2 fm-upload-wrapper <?php echo fm_get_theme(); ?>">
Expand Down Expand Up @@ -3838,10 +3838,10 @@ function fm_show_footer()
{
?>
</div>
<script src="<?php static_cdn(); ?>/public/static/zui/lib/jquery/jquery-3.6.0.min.js"></script>
<script src="<?php static_cdn(); ?>/public/static/tinyfilemanager/bootstrap.min.js"></script>
<script src="<?php static_cdn(); ?>/public/static/tinyfilemanager/jquery.dataTables.min.js"></script>
<script src="<?php static_cdn(); ?>/public/static/tinyfilemanager/ekko-lightbox.min.js"></script>
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/zui/lib/jquery/jquery-3.6.0.min.js"></script>
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/tinyfilemanager/bootstrap.min.js"></script>
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/tinyfilemanager/jquery.dataTables.min.js"></script>
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/tinyfilemanager/ekko-lightbox.min.js"></script>
<?php if (FM_USE_HIGHLIGHTJS): ?>
<script src="<?php static_cdn(); ?>/public/static/tinyfilemanager/highlight.min.js"></script>
<script>hljs.highlightAll(); var isHighlightingEnabled = true;</script>
Expand Down
1 change: 1 addition & 0 deletions admin/version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.8.4
7 changes: 2 additions & 5 deletions admin/zui.chart.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require_once '../app/header.php';
require_once APP_ROOT . '/app/chart.php';

// 检测是否开启统计
// 检测登录和是否开启统计
if (!$config['chart_on'] || !is_who_login('admin')) exit(header('Location: ' . $config['domain'] . '?hart#closed'));

// 检测登录
Expand Down Expand Up @@ -140,10 +140,7 @@
<canvas id="myChart" width="1080" height="200"></canvas>
</div>
</div>
<script src="https://cdn.jsdelivr.net/gh/icret/[email protected]/public/static/zui/lib/chart/zui.chart.min.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.jsdelivr.net/gh/icret/[email protected]/public/static/zui/lib/chart/excanvas.js"></script>
<![endif]-->
<script type="application/javascript" src="<?php static_cdn(); ?>/public/static/zui/lib/chart/zui.chart.min.js"></script>
<script>
// 文件统计-柱状图
var data = {
Expand Down
Loading

0 comments on commit fe237dd

Please sign in to comment.