Skip to content

Commit 1e8dbef

Browse files
committed
v2.6.0
1 parent 03a19b3 commit 1e8dbef

17 files changed

+600
-341
lines changed

Diff for: README.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
[![License](https://img.shields.io/badge/license-GPL_V2.0-yellowgreen.svg)](https://github.com/icret/EasyImages2.0/blob/master/LICENSE)
1414
[![QQ group](https://pub.idqqimg.com/wpa/images/group.png)](https://jq.qq.com/?_wv=1027&k=jfXRHU8Y)
1515

16-
>[演示](https://png.cm/) | [Chrome/Edge 插件](https://github.com/icret/EasyImage-Browser-Extension) | [使用手册](https://www.kancloud.cn/easyimage/easyimage/)
16+
>[演示](https://png.cm/) | [Chrome/Edge 插件](https://github.com/icret/EasyImage-Browser-Extension) | [使用手册](https://www.kancloud.cn/easyimage/easyimage/) | [Telegram](https://t.me/Easy_Image)
1717
>
1818
>本人善写bug 发现bug可提交 [issues](https://github.com/icret/EasyImages2.0/issues) 追求稳定请下载 [稳定版](https://github.com/icret/EasyImages2.0/releases)
1919
@@ -149,12 +149,20 @@ $HTTP["url"] =~ "^/(i|public)/" {
149149

150150
<details><summary>点击查看2.0版更新日志</summary>
151151

152+
* 2022-05-01 v2.6.0
153+
- 修复源图缺陷
154+
- 修复API回收不能还原问题
155+
- 布局修改
156+
- 登录页美化
157+
- 屏蔽登陆页面chrome类浏览器自动填充
158+
152159
* 2022-04-02 v2.5.9
153160
- 增加安装提示
154161
- 增加忘记密码提示
155162
- 增加检测水印图片/水印字体是否存在
156163
- 修复登陆逻辑
157164
- 修复广场重复显示图片
165+
- 修改广场删除/回收样式
158166
- 调整了广告的位置
159167
- 调整后台设置分表
160168

Diff for: admin/admin.inc.php

+128-112
Large diffs are not rendered by default.

Diff for: admin/index.php

+107-98
Original file line numberDiff line numberDiff line change
@@ -9,62 +9,62 @@
99
// 验证登录
1010
header("Content-Type: text/html;charset=utf-8");
1111
if (isset($_REQUEST['code'])) {
12-
session_start();
12+
session_start();
1313

14-
if (strtolower($_REQUEST['code']) == $_SESSION['code']) {
15-
// 提交登录
16-
if (isset($_POST['password']) and isset($_POST['user'])) {
14+
if (strtolower($_REQUEST['code']) == $_SESSION['code']) {
15+
// 提交登录
16+
if (isset($_POST['password']) and isset($_POST['user'])) {
1717

18-
global $guestConfig;
19-
$postUser = strip_tags($_POST['user']);
20-
$postPWD = strip_tags($_POST['password']);
18+
global $guestConfig;
19+
$postUser = strip_tags($_POST['user']);
20+
$postPWD = strip_tags($_POST['password']);
2121

22-
if ($postUser == $config['user'] || in_array($postPWD, $guestConfig)) {
23-
if ($postPWD == $config['password'] || $postPWD == $guestConfig[$postUser]) {
24-
// 将账号密码序列化后存储
25-
$setCOK = serialize(array($postUser, $postPWD));
22+
if ($postUser == $config['user'] || in_array($postPWD, $guestConfig)) {
23+
if ($postPWD == $config['password'] || $postPWD == $guestConfig[$postUser]) {
24+
// 将账号密码序列化后存储
25+
$setCOK = serialize(array($postUser, $postPWD));
2626

27-
setcookie('auth', $setCOK, time() + 3600 * 24 * 14, '/');
28-
echo '
27+
setcookie('auth', $setCOK, time() + 3600 * 24 * 14, '/');
28+
echo '
2929
<script>
3030
new $.zui.Messager("登录成功", {type: "primary" // 定义颜色主题
3131
}).show();
3232
</script>';
33-
header("refresh:2;url=" . $config['domain'] . "");
34-
} else {
35-
echo '
33+
header("refresh:2;url=" . $config['domain'] . "");
34+
} else {
35+
echo '
3636
<script>
3737
new $.zui.Messager("密码错误", {type: "danger" // 定义颜色主题
3838
}).show();
3939
</script>';
40-
header("refresh:2;");
41-
}
42-
} else {
43-
echo '
40+
header("refresh:2;");
41+
}
42+
} else {
43+
echo '
4444
<script>
4545
new $.zui.Messager("账号不存在", {type: "danger" // 定义颜色主题
4646
}).show();
4747
</script>';
48-
header("refresh:2;");
49-
}
50-
}
51-
} else {
52-
echo '
48+
header("refresh:2;");
49+
}
50+
}
51+
} else {
52+
echo '
5353
<script>
5454
new $.zui.Messager("验证码错误!", {type: "danger" // 定义颜色主题
5555
}).show();
5656
</script>';
57-
}
57+
}
5858
}
5959

6060
// 退出
6161
if (isset($_GET['login'])) {
62-
if ($_GET['login'] = 'logout') {
62+
if ($_GET['login'] = 'logout') {
6363

64-
if (isset($_COOKIE['auth'])) {
65-
setcookie('auth', null, time() - 1, '/');
66-
header("Refresh:2;url=../index.php");
67-
echo '
64+
if (isset($_COOKIE['auth'])) {
65+
setcookie('auth', null, time() - 1, '/');
66+
header("Refresh:2;url=../index.php");
67+
echo '
6868
<script>
6969
new $.zui.Messager("退出成功", {
7070
type: "success", // 定义颜色主题
@@ -74,8 +74,8 @@
7474
window.setTimeout("window.location=\'../index.php\'",2000);
7575
</script>
7676
';
77-
} else {
78-
echo '
77+
} else {
78+
echo '
7979
<script>
8080
new $.zui.Messager("尚未登录", {
8181
type: "danger", // 定义颜色主题
@@ -85,78 +85,87 @@
8585
window.setTimeout("window.location=\'./index.php\'",2000);
8686
</script>
8787
';
88-
}
89-
}
88+
}
89+
}
9090
}
9191
?>
92+
<link href="<?php static_cdn(); ?>/public/static/login.css" rel="stylesheet">
9293
<!-- 忘记密码 -->
9394
<div class="modal fade" id="fogot">
94-
<div class="modal-dialog ">
95-
<div class="modal-content">
96-
<div class="modal-header">
97-
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">x</span><span class="sr-only">关闭</span></button>
98-
<h4 class="modal-title">
99-
<i class="icon icon-bell-alt"> </i>忘记账号/密码?
100-
</h4>
101-
</div>
102-
<div class="modal-body">
103-
<p class="text-primary">忘记账号可以打开-><code>/config/config.php</code>文件->找到user对应的键值->填入</p>
104-
<p class="text-success">忘记密码请将密码->转换成MD5小写-><a href="https://md5jiami.bmcx.com/" target="_blank" class="text-purple">转换网址</a>->打开<code>/config/config.php</code>文件->找到password对应的键值->填入</p>
105-
<h4 class="text-danger">更改后会立即生效并重新登录,请务必牢记账号和密码! </h4>
106-
</div>
107-
<div class="modal-footer">
108-
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
109-
</div>
110-
</div>
111-
</div>
95+
<div class="modal-dialog ">
96+
<div class="modal-content">
97+
<div class="modal-header">
98+
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">x</span><span class="sr-only">关闭</span></button>
99+
<h4 class="modal-title">
100+
忘记账号/密码?
101+
</h4>
102+
</div>
103+
<div class="modal-body">
104+
<p class="text-primary">忘记账号可以打开<code>/config/config.php</code>文件找到user对应的键值->填入</p>
105+
<p class="text-success">忘记密码请将密码转换成MD5小写(<a href="https://md5jiami.bmcx.com/" target="_blank" class="text-purple">转换网址</a>)->打开<code>/config/config.php</code>文件->找到password对应的键值->填入</p>
106+
<h4 class="text-danger">更改后会立即生效并重新登录,请务必牢记账号和密码! </h4>
107+
</div>
108+
<div class="modal-footer">
109+
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
110+
</div>
111+
</div>
112+
</div>
112113
</div>
113-
<form class="form-horizontal" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" onsubmit="return md5_post()">
114-
<div class="form-group">
115-
<label for="account" class="col-sm-2">账号</label>
116-
<div class="has-success col-md-3 col-sm-5">
117-
<input type="text" name="user" id="account" class="form-control" value="" placeholder="请输入登录账号" required="required">
118-
</div>
119-
</div>
120-
<div class="form-group">
121-
<label for="password" class="col-sm-2">密码</label>
122-
<div class="has-success col-md-3 col-sm-5">
123-
<input type="password" name="password" id="password" class="form-control" value="" placeholder="请输入登录密码" required="required">
124-
</div>
125-
<input type="hidden" name="password" id="md5_password">
126-
</div>
127-
<div class="form-group">
128-
<label class="col-sm-2">验证码</label>
129-
<div class="has-success col-md-3 col-sm-5">
130-
<label><img src="<?php echo $config["domain"] . "/application/captcha.php"; ?>" onClick="this.src='<?php echo $config["domain"] . "/application/captcha.php"; ?>?nocache='+Math.random()" title="点击换一张" /></label>
131-
<input class="form-control" type="text" name="code" value="" placeholder="请输入上方4位数验证码 - 不区分大小写" required="required" />
132-
</div>
133-
</div>
134-
<div class="form-group">
135-
<div class="col-sm-offset-2 col-sm-10">
136-
<div class="checkbox">
137-
<label title="选不选都记得你,想退出就点击退出才可以哦!">
138-
<input type="checkbox" checked="checked"> 记住我
139-
</label>
140-
<label title="选不选都记得你,想退出就点击退出才可以哦!">
141-
<a href="#fogot" data-moveable="inside" data-remember-pos="false" data-toggle="modal" data-target="#fogot" data-position="center">忘记账号/密码?</a>
142-
</label>
143-
</div>
144-
</div>
145-
</div>
146-
<div class="form-group">
147-
<div class="col-sm-offset-2 col-sm-10">
148-
<button type="submit" class="btn btn-primary">登录</button>
149-
</div>
150-
</div>
114+
<section>
115+
<div class="container">
116+
<div class="user singinBx">
117+
<div class="imgBx">
118+
<img src="<?php echo $config['login_bg']; ?>" alt="简单图床登陆界面背景图" />
119+
</div>
120+
<div class="formBx">
121+
<form class="form-horizontal" action="/admin/index.php" method="post" onsubmit="return md5_post()">
122+
<h2>登录</h2>
123+
<label for="account" class="col-sm-2"></label>
124+
<input type="text" name="user" id="account" class="form-control" value="" placeholder="输入登录账号" autocomplete="off" required="required">
125+
<input type="password" name="password" id="password" class="form-control" value="" placeholder="输入登录密码" autocomplete="off" required="required">
126+
<input type="hidden" name="password" id="md5_password">
127+
<input class="form-control" type="text" name="code" value="" placeholder="输入下方4位数验证码" autocomplete="off" required="required" />
128+
<div class="form-group">
129+
<div class="col">
130+
<label><img src="<?php echo $config["domain"] . "/application/captcha.php"; ?>" onClick="this.src='<?php echo $config["domain"] . "/application/captcha.php"; ?>?nocache='+Math.random()" title="点击换一张" /></label>
131+
</div>
132+
</div>
133+
<button type="submit" class="btn btn-block btn-primary">登 录</button>
134+
<p class="signup">忘记账号或密码请查看<a href="#fogot" data-moveable="inside" data-remember-pos="false" data-toggle="modal" data-target="#fogot" data-position="center">帮助信息</a></p>
135+
</form>
136+
</div>
137+
</div>
138+
<div class="user singupBx">
139+
<div class="formBx">
140+
<form action="">
141+
<h2>注册</h2>
142+
<input type="text" name="telyzm" id="telyzm" placeholder="手机号">
143+
<input type="email" name="" placeholder="邮箱地址">
144+
<input type="password" name="" placeholder="设置密码">
145+
<input type="password" name="" placeholder="再次输入密码">
146+
<input type="submit" name="" value="注册">
147+
<p class="signup">已有账号?<a href="#" onclick="topggleForm();">登录</a></p>
148+
</form>
149+
</div>
150+
<div class="imgBx"><img src="<?php echo $config['login_bg']; ?>" alt="简单图床登陆界面背景图" />
151+
</div>
152+
</div>
153+
</div>
154+
</section>
151155
</form>
152156
<script src="<?php static_cdn(); ?>/public/static/md5/md5.min.js"></script>
153157
<script>
154-
function md5_post() {
155-
var password = document.getElementById('password');
156-
var md5pwd = document.getElementById('md5_password');
157-
md5pwd.value = md5(password.value);
158-
//可以校验判断表单内容,true就是通过提交,false,阻止提交
159-
return true;
160-
}
158+
function md5_post() {
159+
var password = document.getElementById('password');
160+
var md5pwd = document.getElementById('md5_password');
161+
md5pwd.value = md5(password.value);
162+
//可以校验判断表单内容,true就是通过提交,false,阻止提交
163+
return true;
164+
}
165+
166+
function topggleForm() {
167+
var container = document.querySelector('.container');
168+
container.classList.toggle('active');
169+
}
161170
</script>
162171
<?php require_once APP_ROOT . '/application/footer.php';

Diff for: admin/terms.php

+12-4
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,25 @@
44
*/
55
require_once __DIR__ . '/../application/header.php';
66

7+
/** 顶部广告 */
8+
if ($config['ad_top']) echo $config['ad_top_info'];
9+
10+
/** 加载使用条款 */
711
if (empty($config['terms'])) {
8-
echo '<div class="alert alert-danger">Terms not set!<br />使用条款未设置</div>';
12+
echo '<div class="alert alert-danger">Terms not set!<br />未设置使用条款</div>';
913
} else {
1014
echo $config['terms'];
15+
// echo '<div style="margin-bottom: 80px;"></div>';
1116
}
1217

13-
echo "
18+
/** 底部广告 */
19+
if ($config['ad_bot']) echo $config['ad_bot_info'];
20+
?>
21+
1422
<script>
1523
// Title
16-
document.title = '使用条款 - " . $config['title'] . "';
24+
document.title = '使用条款 - <?php echo $config['title']; ?>'
1725
</script>
18-
";
1926

27+
<?php
2028
require_once __DIR__ . '/../application/footer.php';

Diff for: api/index.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?php
2+
3+
namespace Verot\Upload;
4+
25
require_once __DIR__ . '/../application/function.php';
36
require_once APP_ROOT . '/application/class.upload.php';
47
require_once APP_ROOT . '/config/api_key.php';
@@ -38,7 +41,7 @@
3841
// 允许上传的mime类型
3942
$handle->allowed = array('image/*');
4043
// 文件命名
41-
$handle->file_new_name_body = imgName($handle->file_src_name_body) . '_' . $tokenID;
44+
$handle->file_new_name_body = imgName($handle->file_src_name_body) . '-' . $tokenID;
4245
// 最大上传限制
4346
$handle->file_max_sizes = $config['maxSize'];
4447
// 最大宽度
@@ -67,8 +70,8 @@
6770
$pathIMG = config_path() . $handle->file_dst_name;
6871
$imageUrl = $config['imgurl'] . $pathIMG;
6972

70-
// 原图保护 key值是由crc32加密的登录密码
71-
$hide_original = $config['hide'] == 1 ? $config['domain'] . '/application/hide.php?key=' . urlHash($pathIMG, 0, crc32($config['password'])) : $imageUrl;
73+
// 原图保护 key值是由crc32加密的hide_key
74+
$hide_original = $config['hide'] == 1 ? $config['domain'] . '/application/hide.php?key=' . urlHash($pathIMG, 0, crc32($config['hide_key'])) : $imageUrl;
7275

7376
// 关闭上传后显示加密删除链接
7477
if ($config['show_user_hash_del']) {

Diff for: application/captcha.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
require __DIR__ . "/function.php";
55

66
//创建背景画布
7-
$img_w = 270;
7+
$img_w = 305;
88
/*宽*/
9-
$img_h = 50;
9+
$img_h = 54;
1010

1111
$img = imagecreatetruecolor($img_w, $img_h);
1212
$bg_color = imagecolorallocate($img, 0xcc, 0xcc, 0xcc);

Diff for: application/check.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
foreach ($expand as $val) {
3939
if (extension_loaded($val)) {
4040
echo '
41-
<p style="color:green">' . $val . " - 已安装</p>";
41+
<p style="color:green">' . strtoupper($val) . " - 已安装</p>";
4242
} else {
4343
echo "<script language='javascript'>alert('$val - 未安装')</script>";
44-
echo '<p style="color:red">' . $val . " - 未安装</p>";
44+
echo '<p style="color:red">' . strtoupper($val) . " - 未安装</p>";
4545
}
4646
}
4747
// 文件权限检测

Diff for: application/class.upload.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
// | This script is free to use, don't abuse. |
2626
// +------------------------------------------------------------------------+
2727

28-
// namespace Verot\Upload;
28+
namespace Verot\Upload;
2929

3030
if (!defined('IMG_WEBP')) define('IMG_WEBP', 32);
3131

Diff for: application/function.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ function urlHash($data, $mode, $key = null)
482482
{
483483
global $config;
484484

485-
if ($key) {
485+
if (!$key) {
486486
$key = $config['password'];
487487
}
488488

0 commit comments

Comments
 (0)