更改密码存储方式
parent
124ea5c1b1
commit
a0ab57aed3
11
README.md
11
README.md
|
@ -56,6 +56,7 @@
|
|||
8. 出现`undefined function imagecreatefromwebp()`是因为GD没安装webp
|
||||
9. 出现`upload File size exceeds the maximum value` 调整`PHP`上传大小
|
||||
10. 出现`Warning: is_dir(): open_basedir restriction in effect`解决方法同`3`
|
||||
11. 出现`Fatal error: Allowed memory size......`主机内存或分配给PHP的内存不够 解决方法百度
|
||||
|
||||
#### 安全配置
|
||||
|
||||
|
@ -86,11 +87,17 @@ Deny from all
|
|||
<details><summary><mark><font color=darkred>点击查看2.0版更新日志</font></mark></summary>
|
||||
|
||||
|
||||
* 2022-1-3 v2.4.4 beta
|
||||
* 2022-1-3 v2.4.5 beta
|
||||
- 更新安装代码
|
||||
- 更改前端样式
|
||||
- 更新上传格式
|
||||
- 重构了密码验证
|
||||
- 使用md5存储密码
|
||||
- 增加后台设置提示
|
||||
- 增加更改网站配色
|
||||
- 增加缩略图索引格式
|
||||
- 调整后台分类及位置
|
||||
- 增加在线修改账号密码
|
||||
- 增加以源文件名称命名
|
||||
- 增加缩略图两种生成方式和开关
|
||||
- 修复开启前端压缩导致的上传图片异常
|
||||
|
@ -289,7 +296,7 @@ RewriteRule config/(.*).(php)$ – [F]
|
|||
|
||||
#### 兼容性
|
||||
|
||||
- `PHP>5.6`,推荐使用`PHP7.0`及以上版本,需要PHP支持`Fileinfo,iconv,zip,mbstring,openssl`扩展,如果缺失会导致无法上传/删除图片
|
||||
- 最低`PHP 5.6`,推荐`PHP 7.0`及以上版本,需要PHP支持`Fileinfo,iconv,zip,mbstring,openssl`扩展,如果缺失会导致无法上传/删除图片
|
||||
- 文件上传视图提供文件列表管理和文件批量上传功能,允许拖拽(需要`HTML5`支持)来添加上传文件,支持上传大图片,优先使用`HTML5`旧得浏览器自动使用`Flash和Silverlight`的方式兼容
|
||||
|
||||
<hr />
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
/*
|
||||
* 登录页面
|
||||
* 简单图床设置页面
|
||||
* 2022-1-5 15:34:34
|
||||
*/
|
||||
|
||||
require_once __DIR__ . '/../application/function.php';
|
||||
|
@ -85,7 +86,7 @@ if (isset($_POST['radio'])) {
|
|||
<div class="col-xs-9">
|
||||
<div class="tab-content col-xs-9">
|
||||
<div class="tab-pane fade active in" id="Content1">
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" onsubmit="return md5_post()">
|
||||
<div class="form-group">
|
||||
<label>网站域名,末尾不加"/" </label>
|
||||
<input type="url" class="form-control" name="domain" required="required" value="<?php echo $config['domain']; ?>" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
|
@ -94,15 +95,6 @@ if (isset($_POST['radio'])) {
|
|||
<label>图片链接域名,末尾不加"/",如果只有一个域名请与上边一致</label>
|
||||
<input type="text" class="form-control" name="imgurl" required="required" value="<?php echo $config['imgurl']; ?>" placeholder="末尾不加/" onkeyup="this.value=this.value.replace(/\s/g,'')" title="网站域名与图片链接域名可以不同,比如A域名上传,可以返回B域名图片链接,A、B需绑定到同一空间下,如果不变的话,下边2个填写成一样的!">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>登录上传和后台管理密码,管理用户名为:admin,更改后会立即生效</label>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" name="password" required="required" value="<?php echo $config['password']; ?>" id="pwd" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default" type="button"><i class="icon icon-eye-close" onclick="showhide()" id="eye"></i></button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>网站标题</label>
|
||||
<input type="text" class="form-control" name="title" required="required" value="<?php echo $config['title']; ?>" onkeyup="this.value=this.value.trim()">
|
||||
|
@ -139,6 +131,18 @@ if (isset($_POST['radio'])) {
|
|||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="showSwitch" value="0">
|
||||
<input type="checkbox" name="showSwitch" value="1" <?php if ($config['showSwitch']) {echo 'checked="checked"';} ?>>
|
||||
<label style="font-weight: bold">开启游客浏览(广场)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>默认游客浏览数量,当前:</label>
|
||||
<label id="listNumber"><?php echo $config['listNumber']; ?></label><label>张</label>
|
||||
<input type="range" class="form-control" name="listNumber" value="<?php echo $config['listNumber']; ?>" min="10" max="100" step="10" onchange="document.getElementById('listNumber').innerHTML=value" title="可在网址后填写参数实时更改预览数量 如:https://img.545141.com/application/list.php?num=3">
|
||||
</div>
|
||||
<div class="switch">
|
||||
<input type="hidden" name="static_cdn" value="0">
|
||||
<input type="checkbox" name="static_cdn" value="1" <?php if ($config['static_cdn']) {echo 'checked="checked"';} ?>>
|
||||
|
@ -150,7 +154,21 @@ if (isset($_POST['radio'])) {
|
|||
<input type="url" class="form-control" name="static_cdn_url" value="<?php echo $config['static_cdn_url']; ?>" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="" placeholder="隐藏的保存">
|
||||
<div>
|
||||
<label>缩略图生成方式 - 关闭缩略图无任何服务器开销但增加输出流量,浏览生成要比实时生成更好</label>
|
||||
</div>
|
||||
<div class="radio-primary">
|
||||
<input type="radio" name="thumbnail" value="0" <?php if($config['thumbnail']===0){echo 'checked="checked"';}?> id="thumbnail0"><label for="thumbnail0"> 关闭 - 广场直接输出上传图片,输出流量增加</label>
|
||||
</div>
|
||||
<div class="radio-primary">
|
||||
<input type="radio" name="thumbnail" value="1" <?php if($config['thumbnail']===1){echo 'checked="checked"';}?> id="thumbnail1"><label for="thumbnail1"> 实时生成 - 每次浏览都请求服务器,不会影响广场页面布局但会影响服务器性能</label>
|
||||
</div>
|
||||
<div class="radio-primary">
|
||||
<input type="radio" name="thumbnail" value="2" <?php if($config['thumbnail']===2){echo 'checked="checked"';}?> id="thumbnail2"><label for="thumbnail2"> 客户浏览广场时生成 - 每日首张缩略图生成会使广场页面代码布局异常[刷新即可]</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
</form>
|
||||
|
@ -269,7 +287,7 @@ if (isset($_POST['radio'])) {
|
|||
<label>允许上传的最小高度->更改后的高度:</label><label id="minHeight"><?php echo $config['minHeight']; ?></label><label>像素</label>
|
||||
<input type="range" class="form-control" name="minHeight" value="<?php echo $config['minHeight']; ?>" min="5" max="1024" step="10" onchange="document.getElementById('minHeight').innerHTML=value">
|
||||
</div>
|
||||
<h3 class="with-padding bg-success" style="text-align: center;">前端压缩 - 优点:服务器无压力 缺点:略微增加客户端压力</h3>
|
||||
<h4 class="with-padding bg-success" style="text-align: center;">前端裁剪压缩 - 优点:服务器无压力 缺点:略增加客户端压力,压缩仅支持JPG</h4>
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="imgRatio" value="0">
|
||||
|
@ -303,30 +321,16 @@ if (isset($_POST['radio'])) {
|
|||
<label>图片压缩率(仅支持JPG)->更改后的压缩率:</label><label id="imgRatio_quality"><?php echo $config['imgRatio_quality']; ?></label><label>%</label>
|
||||
<input type="range" class="form-control" name="imgRatio_quality" value="<?php echo $config['imgRatio_quality']; ?>" min="10" max="100" step="5" onchange="document.getElementById('imgRatio_quality').innerHTML=value">
|
||||
</div>
|
||||
<h3 class="with-padding bg-blue" style="text-align: center;">后端压缩 - 优点:避免客户端欺骗 缺点:增加服务器压力</h3>
|
||||
<h4 class="with-padding bg-blue" style="text-align: center;">后端压缩 - 优点:避免客户端欺骗,效果更好 缺点:增加服务器压力</h4>
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="compress" value="0">
|
||||
<input type="checkbox" name="compress" value="1" <?php if ($config['compress']) {echo 'checked="checked"';} ?> title=" 轻微有损压缩图片, 此压缩有可能使图片变大!特别是小图片 也有一定概率改变图片方向">
|
||||
<label style="font-weight: bold">后端压缩上传图片 - 效果好于前端 增加服务器开销</label>
|
||||
<label style="font-weight: bold">后端压缩上传图片 - 更多图片格式的支持</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div>
|
||||
<label>缩略图生成 - 关闭缩略图无任何服务器开销但增加输出流量,浏览生成要比实时生成更好</label>
|
||||
</div>
|
||||
<div class="radio-primary">
|
||||
<input type="radio" name="thumbnail" value="0" <?php if($config['thumbnail']===0){echo 'checked="checked"';}?> id="thumbnail0"><label for="thumbnail0"> 关闭缩略图生成 - 广场直接输出上传图片</label>
|
||||
</div>
|
||||
<div class="radio-primary">
|
||||
<input type="radio" name="thumbnail" value="1" <?php if($config['thumbnail']===1){echo 'checked="checked"';}?> id="thumbnail1"><label for="thumbnail1"> 实时生成 - 每次都会请求服务器,不会影响广场页面布局但会增加服务器开销</label>
|
||||
</div>
|
||||
<div class="radio-primary">
|
||||
<input type="radio" name="thumbnail" value="2" <?php if($config['thumbnail']===2){echo 'checked="checked"';}?> id="thumbnail2"><label for="thumbnail2"> 客户浏览广场时生成 - 每日首张缩略图生成会使广场页面代码布局异常[刷新即可]</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="" placeholder="隐藏的保存">
|
||||
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
</form>
|
||||
|
@ -341,7 +345,7 @@ if (isset($_POST['radio'])) {
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>顶部广告内容 支持html代码</label>
|
||||
<label>顶部广告内容 仅支持html代码</label>
|
||||
<textarea class="form-control" rows="5" name="ad_top_info"><?php echo $config['ad_top_info']; ?></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -352,7 +356,7 @@ if (isset($_POST['radio'])) {
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>底部广告内容 支持html代码</label>
|
||||
<label>底部广告内容 仅支持html代码</label>
|
||||
<textarea class="form-control" rows="5" name="ad_bot_info"><?php echo $config['ad_bot_info']; ?></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -360,7 +364,7 @@ if (isset($_POST['radio'])) {
|
|||
<textarea class="form-control" rows="7" name="customize"><?php echo $config['customize']; ?></textarea>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="" placeholder="隐藏的保存">
|
||||
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
</form>
|
||||
|
@ -389,16 +393,6 @@ if (isset($_POST['radio'])) {
|
|||
<span class="label label-primary label-outline">已缓存文件:<?php echo getFileNumber(APP_ROOT . $config['path'] . 'thumbnails/'); ?>占用<?php echo getDistUsed(getDirectorySize(APP_ROOT . $config['path'] . 'thumbnails/')); ?></span>
|
||||
<button type="submit" class="btn btn-primary" name="delDir" value="thumbnails/" onClick="return confirm('确认要清理缓存?\n* 删除文件夹后将无法恢复!');">清理缓存</button>
|
||||
</form>
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
|
||||
<div class="form-group">
|
||||
<label>利用Tinypng压缩图片 TinyImag Key 申请地址:<a href="https://tinypng.com/developers" target="_blank">https://tinypng.com/developers</a></label>
|
||||
<input type="text" class="form-control input-sm" name="TinyImag_key" value="<?php echo $config['TinyImag_key']; ?>" title="开启后会受服务器到https://tinypng.com 速度影响,国内不建议开启!" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
</form>
|
||||
<p>
|
||||
<form action="../application/compressing.php" method="post" target="_blank">
|
||||
<div class="form-group">
|
||||
|
@ -406,21 +400,39 @@ if (isset($_POST['radio'])) {
|
|||
<input type="text" class="form-control form-date" placeholder="" name="folder" value="<?php echo date('Y/m/d/'); ?>" readonly="">
|
||||
</div>
|
||||
<div class="radio-primary">
|
||||
<input type="radio" name="type" value="Imgcompress" id="Imgcompress" checked="checked"><label for="Imgcompress"> 使用本地压缩(默认上传已压缩,不需重复压缩)</label>
|
||||
<input type="radio" name="type" value="Imgcompress" id="Imgcompress" checked="checked"><label for="Imgcompress"> 使用本地压缩(如果开启上传压缩,不需重复压缩)</label>
|
||||
</div>
|
||||
<div class="radio-primary">
|
||||
<input type="radio" name="type" value="TinyImg" id="TinyImg"><label for="TinyImg"> 使用TinyImag压缩(需要申请key)</label>
|
||||
<input type="radio" name="type" value="TinyImg" id="TinyImg"><label for="TinyImg"> 使用TinyImag压缩(需要申请key,填入分类API/Token的TinyImag Key中)</label>
|
||||
</div>
|
||||
<div>
|
||||
<label>* 如果页面长时间没有响应,表示正面正在压缩!</label>
|
||||
<label>两种压缩均为不可逆,并且非常占用硬件资源。</label>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-mini btn-success">开始压缩</button>
|
||||
<button type="submit" class="btn btn-mini btn-success">开始压缩</button>
|
||||
</form>
|
||||
</p>
|
||||
</div>
|
||||
<div class="tab-pane fade " id="Content5">
|
||||
<b>生成Token 新Token需按要求填入<code>/config/api_key.php</code>才生效</b>
|
||||
<b>外部KEY,请根据需要申请并填写</b>
|
||||
<form class="form-inline" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" style="margin-bottom: 10px;">
|
||||
<div class="form-group">
|
||||
<label for="TinyImag" title="申请地址:https://tinypng.com/developers"><a href="https://tinypng.com/developers" target="_blank">TinyImag Key</a></label>
|
||||
<input type="text" class="form-control input-sm" id="TinyImag" name="TinyImag_key" value="<?php echo $config['TinyImag_key']; ?>" placeholder="填入压缩图片Key" title="开启后会受服务器到https://tinypng.com 速度影响,国内不建议开启!" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
|
||||
<button type="submit" class="btn btn-mini btn-primary">保存</button>
|
||||
</form>
|
||||
<form class="form-inline" action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" style="margin-bottom: 10px;">
|
||||
<div class="form-group">
|
||||
<label for="moderatecontent_key" title="申请地址:https://client.moderatecontent.com"><a href="https://client.moderatecontent.com" target="_blank">Moderate Key</a></label>
|
||||
<input type="text" class="form-control input-sm" name="moderatecontent_key" id="moderatecontent_key" value="<?php echo $config['moderatecontent_key']; ?>" placeholder="填入图片监黄Key" title="开启后会受服务器到https://moderatecontent.com 速度影响,国内不建议开启!" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
|
||||
<button type="submit" class="btn btn-mini btn-primary">保存</button>
|
||||
</form>
|
||||
<b>生成API Token 新Token需按要求填入<code>/config/api_key.php</code>才生效</b>
|
||||
<form class="form-condensed" action="<?php $_SERVER['SCRIPT_NAME']; ?>" method="post">
|
||||
<div class="input-group">
|
||||
<span class="input-group-addon">Generate token</span>
|
||||
|
@ -450,30 +462,40 @@ if (isset($_POST['radio'])) {
|
|||
</form>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="Content6">
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post">
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" onsubmit="return md5_post()">
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="showSwitch" value="0">
|
||||
<input type="checkbox" name="showSwitch" value="1" <?php if ($config['showSwitch']) {echo 'checked="checked"';} ?>>
|
||||
<label style="font-weight: bold">开启游客预览(广场)</label>
|
||||
<div class="input-control has-icon-left">
|
||||
<input type="text" name="user" id="account" class="form-control" placeholder="更改登录用户名">
|
||||
<label for="account" class="input-control-icon-left"><i class="icon icon-user "></i></label>
|
||||
</div>
|
||||
<div class="input-control has-icon-left" style="margin-top: 10px;">
|
||||
<input type="text" name="password" id="password" class="form-control" placeholder="更改登录密码">
|
||||
<input type="hidden" name="password" id="md5_password">
|
||||
<label for="password" class="input-control-icon-left"><i class="icon icon-key"></i></label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>默认预览数量,当前:</label>
|
||||
<label id="listNumber"><?php echo $config['listNumber']; ?></label><label>张</label>
|
||||
<input type="range" class="form-control" name="listNumber" value="<?php echo $config['listNumber']; ?>" min="10" max="100" step="10" onchange="document.getElementById('listNumber').innerHTML=value" title="可在网址后填写参数实时更改预览数量 如:https://img.545141.com/application/list.php?num=3">
|
||||
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn btn-primary">更改 账号/密码</button>
|
||||
<div class="alert alert-primary with-icon" style="margin-top: 5px;">
|
||||
<i class="icon-info-sign"></i>
|
||||
<div class="content">
|
||||
<p>更改后会立即生效并重新登录,请务必牢记密码!</p>
|
||||
<p>如果忘记用户名可以打开-><code>/config/config.php</code>文件->找到user对应的键值->填入</p>
|
||||
<p>如果忘记密码请将密码->转换成MD5小写-><a href="https://md5jiami.bmcx.com/" target="_blank" class="text-purple">转换网址</a>->打开<code>/config/config.php</code>文件->找到password对应的键值->填入</p>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form action="<?php echo $_SERVER['SCRIPT_NAME']; ?>" method="post" onsubmit="return md5_post()">
|
||||
<div class="form-group">
|
||||
<div class="switch">
|
||||
<input type="hidden" name="checkImg" value="0">
|
||||
<input type="checkbox" name="checkImg" value="1" <?php if ($config['checkImg']) {echo 'checked="checked"';} ?> title="开启后会受服务器到https://moderatecontent.com速度影响,国内不建议开启!">
|
||||
<label style="font-weight: bold">开启图片监黄</label>
|
||||
<label style="font-weight: bold">开启图片监黄(需要申请key,填入分类API/Token的Moderate Key中)</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>图片监黄key 申请地址:<a href="https://client.moderatecontent.com" target="_blank">https://client.moderatecontent.com</a></label>
|
||||
<input type="text" class="form-control input-sm" name="moderatecontent_key" value="<?php echo $config['moderatecontent_key']; ?>" title="开启后会受服务器到https://moderatecontent.com 速度影响,国内不建议开启!" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>设置是不良图片概率,概率越大准确率越高,当前:</label>
|
||||
<label id="checkImg_value"><?php echo $config['checkImg_value']; ?></label><label>%</label>
|
||||
|
@ -500,12 +522,12 @@ if (isset($_POST['radio'])) {
|
|||
</div>
|
||||
<div class="form-group">
|
||||
<p style="font-weight: bold">
|
||||
当前版本:<span class="label label-badge label-outline"><?php echo $config['version']; ?></span>
|
||||
Github:<a href="https://github.com/icret/EasyImages2.0/releases" target="_blank"><span class="label label-badge label-success label-outline"><?php echo getVersion(); ?></span></a>
|
||||
当前版本:<span class="label label-badge label-outline"><?php echo $config['version']; ?></span>
|
||||
Github:<a href="https://github.com/icret/EasyImages2.0/releases" target="_blank"><span class="label label-badge label-success label-outline"><?php echo getVersion(); ?></span></a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="hidden" class="form-control" name="form" value="" placeholder="隐藏的保存">
|
||||
<input type="hidden" class="form-control" name="form" value="<?php echo date("Y-m-d H:i:s") ;?>" placeholder="隐藏的保存">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">保存</button>
|
||||
</form>
|
||||
|
@ -513,7 +535,7 @@ if (isset($_POST['radio'])) {
|
|||
<div class="tab-pane fade" id="Content7">
|
||||
<p>为了访问速度,仅显示最近20张图片;监黄需要在安全设置->开启图片监黄。</p>
|
||||
<p>key申请地址:<a href="https://client.moderatecontent.com/" target="_blank">https://client.moderatecontent.com/</a></p>
|
||||
<p>获得key后填入安全设置->图片监黄key </p>
|
||||
<p>获得key后打开->API/Token->Moderate Key->填入 </p>
|
||||
<table class="table table-hover table-bordered table-auto table-condensed table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -612,19 +634,15 @@ if (isset($_POST['radio'])) {
|
|||
<script type="text/javascript" src="<?php static_cdn(); ?>/public/static/jscolor.js"></script>
|
||||
<link href="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.css" rel="stylesheet">
|
||||
<script src="<?php static_cdn(); ?>/public/static/zui/lib/datetimepicker/datetimepicker.min.js"></script>
|
||||
<script src="<?php static_cdn(); ?>/public/static/md5.min.js"></script>
|
||||
<script>
|
||||
|
||||
// 密码隐藏
|
||||
var eye = document.getElementById("eye");
|
||||
var pwd = document.getElementById("pwd");
|
||||
function showhide() {
|
||||
if (pwd.type == "password") {
|
||||
pwd.type = "text";
|
||||
eye.className = 'icon icon-eye-open'
|
||||
} else {
|
||||
pwd.type = "password";
|
||||
eye.className = 'icon icon-eye-close'
|
||||
}
|
||||
// 将密码以md5加密方式发送
|
||||
function md5_post() {
|
||||
var password = document.getElementById('password');
|
||||
var md5pwd = document.getElementById('md5_password');
|
||||
md5pwd.value = md5(password.value);
|
||||
//可以校验判断表单内容,true就是通过提交,false,阻止提交
|
||||
return true;
|
||||
}
|
||||
// jscolor
|
||||
jscolor.presets.default = {
|
||||
|
|
|
@ -67,7 +67,7 @@ if (is_array($char_data)) {
|
|||
<form action="counts.php" method="post">
|
||||
<span>统计时间:<?php echo $char_data['total_time']; ?></span>
|
||||
<input type="hidden" name="del_total" value="<?php echo APP_ROOT . '/admin/logs/counts/'; ?>">
|
||||
<button class="btn btn-mini btn-danger">重新统计</button>
|
||||
<button class="btn btn-mini btn-primary"><i class="icon icon-spin icon-refresh"></i>重新统计</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -25,7 +25,7 @@ if (strstr('localhost', $_SERVER['HTTP_HOST'])) {
|
|||
';
|
||||
}
|
||||
// 检测是否修改默认密码
|
||||
if ($config['password'] === 'admin@123') {
|
||||
if ($config['password'] === 'e6e061838856bf47e1de730719fb2609') {
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("请修改默认密码,否则会有泄露风险!", {type: "warning" // 定义颜色主题
|
||||
|
|
|
@ -95,7 +95,7 @@ class Imgcompress
|
|||
private function _saveImage($dstImgName)
|
||||
{
|
||||
if (empty($dstImgName)) return false;
|
||||
$allowImgs = array('.jpg', '.jpeg', '.png', '.bmp', '.wbmp', '.gif'); //如果目标图片名有后缀就用目标图片扩展名 后缀,如果没有,则用源图的扩展名
|
||||
$allowImgs = array('.jpg', '.jpeg', '.png', '.bmp', '.wbmp', '.gif','webp'); //如果目标图片名有后缀就用目标图片扩展名 后缀,如果没有,则用源图的扩展名
|
||||
$dstExt = strrchr($dstImgName, ".");
|
||||
$sourseExt = strrchr($this->src, ".");
|
||||
if (!empty($dstExt)) $dstExt = strtolower($dstExt);
|
||||
|
|
|
@ -81,7 +81,6 @@
|
|||
<a href="/admin/terms.php" target="_blank"> DMCA</a>
|
||||
</div>';
|
||||
}
|
||||
|
||||
?>
|
||||
</footer>
|
||||
</body>
|
||||
|
|
|
@ -12,10 +12,11 @@ function isAnimatedGif($filename)
|
|||
}
|
||||
|
||||
// 校验登录
|
||||
/*
|
||||
function checkLogin()
|
||||
{
|
||||
global $config;
|
||||
$md5Pwd = md5($config['password']);
|
||||
$md5Pwd = $config['password'];
|
||||
if (isset($_POST['password'])) { // 获取登录密码
|
||||
$postPW = $_POST['password'];
|
||||
if ($md5Pwd == $postPW) { // 登录密码正确
|
||||
|
@ -31,8 +32,10 @@ function checkLogin()
|
|||
//exit(include __DIR__ . '/login.php');
|
||||
exit(header("refresh:1;"));
|
||||
}
|
||||
|
||||
} elseif (isset($_COOKIE['admin'])) { // cookie正确
|
||||
if ($_COOKIE['admin'] == $md5Pwd) {
|
||||
|
||||
} else { // cookie错误
|
||||
echo '
|
||||
<script> new $.zui.Messager("密码已更改,请重新登录", {type: "special" // 定义颜色主题
|
||||
|
@ -48,7 +51,72 @@ function checkLogin()
|
|||
exit(include __DIR__ . '/login.php');
|
||||
}
|
||||
}
|
||||
*/
|
||||
function checkLogin()
|
||||
{
|
||||
global $config;
|
||||
// 获取配置密码 配置密码为md5加密
|
||||
$config_password = $config['password'];
|
||||
$config_user = $config['user'];
|
||||
|
||||
// 如果存在post并且通过设置cookie
|
||||
if (isset($_POST['user'])) {
|
||||
$postUser = $_POST['user'];
|
||||
if ($postUser === $config_user) {
|
||||
if (isset($_POST['password'])) {
|
||||
$postPWD = $_POST['password'];
|
||||
if ($postPWD === $config_password) {
|
||||
setcookie($postUser, $postPWD, time() + 3600 * 24 * 14, '/');
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("登录成功", {type: "primary" // 定义颜色主题
|
||||
}).show();
|
||||
</script>';
|
||||
header("refresh:2;url=" . $config['domain'] . "");
|
||||
} else {
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("密码错误", {type: "danger" // 定义颜色主题
|
||||
}).show();
|
||||
</script>';
|
||||
exit(header("refresh:1;"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '
|
||||
<script>
|
||||
$.zui.Messager("用户名错误", {type: "danger" // 定义颜色主题
|
||||
}).show();
|
||||
</script>';
|
||||
exit(header("refresh:2;"));
|
||||
}
|
||||
}
|
||||
|
||||
// 存在cookie 但是cookie错误
|
||||
if (isset($_COOKIE[$config_user])) {
|
||||
$cookieAdmin = $_COOKIE[$config_user];
|
||||
if ($cookieAdmin != $config_password) {
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("密码已更改,请重新登录", {type: "special" // 定义颜色主题
|
||||
}).show();
|
||||
</script>';
|
||||
//header('loction:login.php');
|
||||
exit(include __DIR__ . '/login.php');
|
||||
}
|
||||
}
|
||||
|
||||
// 无cookie
|
||||
if (empty($_COOKIE[$config_user])) {
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("请登录后再上传!", {type: "danger" // 定义颜色主题
|
||||
}).show();
|
||||
</script>';
|
||||
//header('loction:login.php');
|
||||
exit(include __DIR__ . '/login.php');
|
||||
}
|
||||
}
|
||||
// 仅允许登录后上传
|
||||
function mustLogin()
|
||||
{
|
||||
|
@ -384,8 +452,9 @@ function getDel($url, $type)
|
|||
function is_online()
|
||||
{
|
||||
global $config;
|
||||
$md5Pwd = md5($config['password']);
|
||||
if (empty($_COOKIE['admin']) || $_COOKIE['admin'] != $md5Pwd) {
|
||||
$config_user = $config['user'];
|
||||
$config_password = $config['password'];
|
||||
if (empty($_COOKIE[$config_user]) || $_COOKIE[$config_user] != $config_password) {
|
||||
echo false;
|
||||
} else {
|
||||
return true;
|
||||
|
|
|
@ -11,12 +11,41 @@ if (isset($_REQUEST['code'])) {
|
|||
|
||||
if ($_REQUEST['code'] == $_SESSION['code']) {
|
||||
// 提交登录
|
||||
if (isset($_POST['password'])) {
|
||||
checkLogin();
|
||||
header("refresh:2;url=" . $config['domain'] . "");
|
||||
if (isset($_POST['password']) and isset($_POST['user'])) {
|
||||
$postUser = $_POST['user'];
|
||||
$postPWD = $_POST['password'];
|
||||
if ($postUser == $config['user']) {
|
||||
if ($postPWD == $config['password']) {
|
||||
setcookie($postUser, $postPWD, time() + 3600 * 24 * 14, '/');
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("登录成功", {type: "primary" // 定义颜色主题
|
||||
}).show();
|
||||
</script>';
|
||||
header("refresh:2;url=" . $config['domain'] . "");
|
||||
} else {
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("密码错误", {type: "danger" // 定义颜色主题
|
||||
}).show();
|
||||
</script>';
|
||||
exit(header("refresh:1;"));
|
||||
}
|
||||
} else {
|
||||
echo '
|
||||
<script>
|
||||
$.zui.Messager("用户名错误", {type: "danger" // 定义颜色主题
|
||||
}).show();
|
||||
</script>';
|
||||
exit(header("refresh:2;"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
echo '<script> alert("验证码错误");</script>';
|
||||
echo '
|
||||
<script>
|
||||
new $.zui.Messager("验证码错误!", {type: "danger" // 定义颜色主题
|
||||
}).show();
|
||||
</script>';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,13 +54,13 @@ if (isset($_REQUEST['code'])) {
|
|||
<div class="form-group">
|
||||
<label for="account" class="col-sm-2">账号</label>
|
||||
<div class="has-success col-md-3 col-sm-5">
|
||||
<input type="text" name="account" id="account" class="form-control" value="Admin" placeholder="请输入登录账号" readonly>
|
||||
<input type="text" name="user" id="account" class="form-control" value="admin" placeholder="请输入登录账号">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password" class="col-sm-2">密码</label>
|
||||
<div class="has-success col-md-3 col-sm-5">
|
||||
<input type="password" name="password" id="password" class="form-control" placeholder="请输入登录密码">
|
||||
<input type="password" name="password" id="password" class="form-control" value="admin@123" placeholder="请输入登录密码">
|
||||
</div>
|
||||
<input type="hidden" name="password" id="md5_password">
|
||||
</div>
|
||||
|
@ -39,7 +68,7 @@ if (isset($_REQUEST['code'])) {
|
|||
<div class="form-group">
|
||||
<label class="col-sm-2">验证码</label>
|
||||
<div class="has-success col-md-3 col-sm-5">
|
||||
<label><img src="<?php echo $config["domain"]."/application/captcha.php";?>" onClick="this.src='<?php echo $config["domain"]."/application/captcha.php";?>?nocache='+Math.random()" title="点击换一张" width="150px" height="40px" /></label>
|
||||
<label><img src="<?php echo $config["domain"] . "/application/captcha.php"; ?>" onClick="this.src='<?php echo $config["domain"] . "/application/captcha.php"; ?>?nocache='+Math.random()" title="点击换一张" width="150px" height="40px" /></label>
|
||||
<input class="form-control" type="text" name="code" value="" placeholder="请输入上方4位数验证码 - 注意大小写" />
|
||||
</div>
|
||||
</div>
|
||||
|
@ -47,7 +76,7 @@ if (isset($_REQUEST['code'])) {
|
|||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<label title="选不选都记得你,想退出就点击退出才可以哦!">
|
||||
<input type="checkbox" checked="checked"> 记住我
|
||||
</label>
|
||||
</div>
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
<?php
|
||||
require_once 'header.php';
|
||||
|
||||
if (isset($_COOKIE['admin']) and $_COOKIE['admin'] == md5($config['password'])) {
|
||||
$config_user = $config['user'];
|
||||
|
||||
if (isset($_COOKIE[$config_user ]) and $_COOKIE[$config_user] == $config['password']) {
|
||||
setcookie("admin", null, time() - 1, '/');
|
||||
header("Refresh:2;url=../index.php");
|
||||
echo '
|
||||
|
|
|
@ -7,7 +7,8 @@ $config=Array
|
|||
'tips'=>'本站仅做演示用,不定时清理图片,单文件≤5M,每次上传≤30张',
|
||||
'domain'=>'http://localhost',
|
||||
'imgurl'=>'http://localhost',
|
||||
'password'=>'admin@123',
|
||||
'user'=>'admin',
|
||||
'password'=>'e6e061838856bf47e1de730719fb2609',
|
||||
'mustLogin'=>0,
|
||||
'apiStatus'=>0,
|
||||
'path'=>'/i/',
|
||||
|
@ -23,21 +24,25 @@ $config=Array
|
|||
'waterImg'=>'/public/images/watermark.png',
|
||||
'extensions'=>'gif,jpeg,png,tif,bmp,tif,svg,webp,jpg,tga,svg,ico',
|
||||
'compress'=>0,
|
||||
'thumbnail'=>2,
|
||||
'thumbnail'=>0,
|
||||
'imgConvert'=>'',
|
||||
'maxWidth'=>10240,
|
||||
'maxHeight'=>10240,
|
||||
'minWidth'=>5,
|
||||
'minHeight'=>5,
|
||||
'imgRatio'=>0,
|
||||
'image_x'=>2500,
|
||||
'image_y'=>2700,
|
||||
'image_x'=>800,
|
||||
'image_y'=>800,
|
||||
'imgRatio_quality'=>80,
|
||||
'imgRatio_crop'=>0,
|
||||
'imgRatio_preserve_headers'=>1,
|
||||
'static_cdn'=>0,
|
||||
'theme'=>'default',
|
||||
'static_cdn_url'=>'https://cdn.jsdelivr.net/gh/icret/EasyImages2.0',
|
||||
'TinyImag_key'=>'',
|
||||
'moderatecontent_key'=>'',
|
||||
'footer'=>'<a href="/admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a>
|
||||
<i class="icon icon-smile"></i> <br/>',
|
||||
'ad_top'=>0,
|
||||
'ad_top_info'=>' <div id="ad" class="col-md-12" align="center" style="padding:5px;">
|
||||
<!--广告 按照这个范例替换相应链接,如果想多几个广告,就多复制几个-->
|
||||
|
@ -50,7 +55,7 @@ $config=Array
|
|||
<a href="https://app.cloudcone.com/?ref=3521" target="_blank"><img src="/public/images/ad.jpg" /></a>
|
||||
</div>
|
||||
',
|
||||
'showSwitch'=>1,
|
||||
'showSwitch'=>0,
|
||||
'listNumber'=>20,
|
||||
'customize'=>' <!-- 百度统计代码-->
|
||||
<script>
|
||||
|
@ -63,14 +68,10 @@ $config=Array
|
|||
})();
|
||||
</script>',
|
||||
'checkEnv'=>1,
|
||||
'checkImg'=>0,
|
||||
'checkImg'=>1,
|
||||
'checkImg_value'=>50,
|
||||
'upload_logs'=>1,
|
||||
'cache_freq'=>2,
|
||||
'version'=>'2.4.4 bate',
|
||||
'form'=>'',
|
||||
'TinyImag_key'=>'',
|
||||
'moderatecontent_key'=>'',
|
||||
'footer'=>'<a href="/admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a>
|
||||
<i class="icon icon-smile"></i> <br/>'
|
||||
'version'=>'2.4.5 bate',
|
||||
'form'=>'2022-01-05 18:27:18'
|
||||
);
|
|
@ -142,5 +142,5 @@ mustLogin();
|
|||
});
|
||||
</script>
|
||||
<?php
|
||||
checkEnv($config['checkEnv']); // 环境检测
|
||||
require_once APP_ROOT . '/application/footer.php';
|
||||
checkEnv($config['checkEnv']); // 环境检测
|
|
@ -5,14 +5,10 @@ if (file_exists(APP_ROOT . '/install/install.lock')) {
|
|||
exit(header("Location:/../index.php"));
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (isset($_POST['password'])) {
|
||||
if ($_POST['password'] == $_POST['repassword']) {
|
||||
|
||||
$config['password']=$_POST['password'];
|
||||
|
||||
|
||||
$config['password'] = md5($_POST['password']);
|
||||
} else {
|
||||
|
||||
exit('<script>window.alert("两次密码不一致请重新输入!");location.href="./index.php";</script>');
|
||||
|
@ -20,12 +16,11 @@ if (isset($_POST['password'])) {
|
|||
}
|
||||
|
||||
if (isset($_POST['domain'])) {
|
||||
$config['domain']= $_POST['domain'];
|
||||
|
||||
$config['domain'] = $_POST['domain'];
|
||||
}
|
||||
|
||||
if (isset($_POST['imgurl'])) {
|
||||
$config['imgurl']= $_POST['imgurl'];
|
||||
$config['imgurl'] = $_POST['imgurl'];
|
||||
}
|
||||
|
||||
$config_file = APP_ROOT . '/config/config.php';
|
||||
|
@ -37,7 +32,7 @@ file_put_contents(APP_ROOT . '/install/install.lock', '安装程序锁定文件
|
|||
echo '
|
||||
<script>
|
||||
window.alert("安装成功,即将为您跳转到登陆界面!");
|
||||
location.href="'.get_whole_url('/install/contorl.php').'/application/login.php'.'";
|
||||
location.href="' . get_whole_url('/install/contorl.php') . '/application/login.php' . '";
|
||||
</script>
|
||||
';
|
||||
// 删除安装目录
|
||||
|
|
|
@ -47,7 +47,7 @@ function checkPASS($name)
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="keywords" content="EasyIamge 2.0 安装环境检测" />
|
||||
<meta name="description" content="EasyIamge 2.0 安装环境检测" />
|
||||
<link rel="shortcut icon" href="./../public/favicon.ico" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="./../favicon.ico" type="image/x-icon" />
|
||||
<link href="./../public/static/zui/css/zui.min.css?v1.9.2" rel="stylesheet">
|
||||
<script src="./../public/static/zui/lib/jquery/jquery-3.4.1.min.js?v3.4.1"></script>
|
||||
<script src="./../public/static/zui/js/zui.min.js?v1.9.2"></script>
|
||||
|
|
|
@ -22,7 +22,7 @@ if ($state !== 'checked') {
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="keywords" content="EasyIamge 2.0 即将完成安装!" />
|
||||
<meta name="description" content="EasyIamge 2.0 即将完成安装!" />
|
||||
<link rel="shortcut icon" href="./../public/favicon.ico" type="image/x-icon" />
|
||||
<link rel="shortcut icon" href="./../favicon.ico" type="image/x-icon" />
|
||||
<link href="./../public/static/zui/css/zui.min.css?v1.9.2" rel="stylesheet">
|
||||
<script src="./../public/static/zui/lib/jquery/jquery-3.4.1.min.js?v3.4.1"></script>
|
||||
<script src="./../public/static/zui/js/zui.min.js?v1.9.2"></script>
|
||||
|
@ -62,7 +62,13 @@ if ($state !== 'checked') {
|
|||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 ">登录上传和后台管理密码</label>
|
||||
<label class="col-sm-2 ">管理账号</label>
|
||||
<div class="col-md-6 col-sm-10">
|
||||
<input type="text" class="form-control" name="user" value="" placeholder="请以大小写英文或数字输入管理员账号" onkeyup="this.value=this.value.replace(/[^\w\.\/]/ig,'')">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 ">管理密码</label>
|
||||
<span class="message">请输入8~18位密码</span>
|
||||
<div class="col-md-6 col-sm-10 register">
|
||||
<input type="text" class="form-control inp" name="password" value="" required="required" placeholder="请使用英文输入法输入密码并不小于8位数" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
|
@ -92,7 +98,6 @@ if ($state !== 'checked') {
|
|||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
var password = document.querySelector('.inp');
|
||||
var message = document.querySelector('.message');
|
||||
|
@ -107,9 +112,9 @@ if ($state !== 'checked') {
|
|||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<!-- install bottom HTML start -->
|
||||
|
||||
|
||||
<div class="modal fade" id="myModal">
|
||||
<div class="modal-dialog modal-sm">
|
||||
<div class="modal-content">
|
||||
|
|
Loading…
Reference in New Issue