修复开启登录上传后无法上传bug,安装增加user.ini检测

This commit is contained in:
icret
2022-01-28 21:32:29 +08:00
parent 11c8ee4f0b
commit 7e8f021bf1
7 changed files with 62 additions and 34 deletions

View File

@@ -12,7 +12,7 @@ if (isset($_POST['password'])) {
$config['user'] = $_POST['user'];
} else {
exit('<script>window.alert("两次密码不一致请重新输入");location.href="./index.php";</script>');
exit('<script>window.alert("两次密码不一致请重新输入!");location.href="./index.php";</script>');
}
}
@@ -32,7 +32,7 @@ file_put_contents(APP_ROOT . '/install/install.lock', '安装程序锁定文件
// 删除安装目录
if (isset($_POST['del_install'])) {
if ($_POST['del_install'] == "del") {
deldir(APP_ROOT . "/install/");
deldir(APP_ROOT . "/install");
}
}
@@ -43,15 +43,15 @@ if (isset($_POST['del_extra_files'])) {
@unlink(APP_ROOT . '/LICENSE');
@unlink(APP_ROOT . '/README.md');
@unlink(APP_ROOT . '/config/EasyIamge.lock');
@deldir(APP_ROOT . "/.github/");
@deldir(APP_ROOT . "/.git/");
@deldir(APP_ROOT . "/.github");
@deldir(APP_ROOT . "/.git");
}
}
// 跳转主页
echo '
<script>
window.alert("安装成功,即将为您跳转到登陆界面");
location.href="../admin/index.php";
window.alert("安装成功,即将为您跳转到登陆界面!");
location.href="../index.php";
</script>
';

View File

@@ -27,6 +27,8 @@ if (!IS_WIN) {
}
}
$userINI = is_file(APP_ROOT . '/.user.ini') ? false : true; // user.ini
function checkPASS($name)
{
if ($name) {
@@ -49,12 +51,13 @@ function checkPASS($name)
<meta name="description" content="EasyIamge 2.0 安装环境检测" />
<link rel="shortcut icon" href="./../favicon.ico" type="image/x-icon" />
<link href="./../public/static/zui/css/zui.min.css?v1.10.0" rel="stylesheet">
<link href="./../public/static/nprogress.min.css?v1.10.0" 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.10.0"></script>
<script src="./../public/static/qrcode.min.js?v2.0"></script>
<script src="./../public/static/nprogress.min.js"></script>
</head>
<body class="container">
<!-- install header html end -->
@@ -98,14 +101,17 @@ function checkPASS($name)
<td>可写</td>
<td><?php checkPASS($i_wjj); ?></td>
</tr>
<tr>
<td>.user.ini</td>
<td>防止跨目录访问和读取文件-><a href="https://lnmp.org/faq/lnmp-vhost-add-howto.html#user.ini" target="_blank">删除方法</a></td>
<td><?php checkPASS($userINI); ?></td>
</tr>
</tbody>
</table>
<?php
$checkres = array($phpEnv, $fileinfo, $gd, $i_wjj, $file_php);
$checkres = array($phpEnv, $fileinfo, $gd, $i_wjj, $file_php, $userINI);
if (in_array(false, $checkres)) {
echo '<p class="text-danger">如果你的PHP版本较低或者不想安装上述PHP扩展请删除<code>install</code>目录</p>
@@ -125,7 +131,7 @@ function checkPASS($name)
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span aria-hidden="true">x</span>
<span class="sr-only">关闭</span></button>
<h4 class="modal-title icon icon-mobile" style="text-align: center">扫描二维码使用手机上传</h4>
</div>
@@ -141,6 +147,13 @@ function checkPASS($name)
</div>
</div>
<script>
// NProgress
NProgress.configure({
showSpinner: false
});
NProgress.set(0.0);
NProgress.set(0.5);
// js二维码 获取当前网址并赋值给id=text的value
document.getElementById("text").value = window.location.href;
var qrcode = new QRCode(document.getElementById("qrcode"), {
@@ -170,7 +183,6 @@ function checkPASS($name)
</script>
<footer class="text-muted small col-md-12" style="text-align: center;margin-bottom: 10px">
<hr>
<p><a href="/../admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a><i class="icon icon-smile"></i></p>
<div>
<!-- 对话框触发按钮 -->
<a href="#" data-position="center" data-moveable="inside" data-moveable="true" data-toggle="modal" data-target="#myModal">

View File

@@ -17,16 +17,18 @@ if ($state !== 'checked') {
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>EasyIamge 2.0 即将完成安装</title>
<title>EasyIamge 2.0 即将完成安装!</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="keywords" content="EasyIamge 2.0 即将完成安装" />
<meta name="description" content="EasyIamge 2.0 即将完成安装" />
<meta name="keywords" content="EasyIamge 2.0 即将完成安装!" />
<meta name="description" content="EasyIamge 2.0 即将完成安装!" />
<link rel="shortcut icon" href="./../favicon.ico" type="image/x-icon" />
<link href="./../public/static/zui/css/zui.min.css?v1.10.0" rel="stylesheet">
<link href="./../public/static/nprogress.min.css?v1.10.0" 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.10.0"></script>
<script src="./../public/static/qrcode.min.js?v2.0"></script>
<script src="./../public/static/nprogress.min.js"></script>
<style>
.message {
font-size: 12px;
@@ -52,7 +54,7 @@ if ($state !== 'checked') {
<div class="form-group">
<label class="col-sm-2">网站域名,末尾不加"/"</label>
<div class="col-md-6 col-sm-10">
<input type="url" class="form-control" name="domain" value="<?php echo get_whole_url('/install/install.php'); ?>" required="required" onkeyup="this.value=this.value.replace(/\s/g,'')" placeholder="网站域名与图片链接域名可以不同比如A域名上传可以返回B域名图片链接如果不变的话下边2个填写成一样的" title="网站域名与图片链接域名可以不同比如A域名上传可以返回B域名图片链接如果不变的话下边2个填写成一样的">
<input type="url" class="form-control" name="domain" value="<?php echo get_whole_url('/install/install.php'); ?>" required="required" onkeyup="this.value=this.value.replace(/\s/g,'')" placeholder="网站域名与图片链接域名可以不同比如A域名上传可以返回B域名图片链接如果不变的话下边2个填写成一样的!" title="网站域名与图片链接域名可以不同比如A域名上传可以返回B域名图片链接如果不变的话下边2个填写成一样的!">
</div>
</div>
<div class="form-group">
@@ -74,6 +76,7 @@ if ($state !== 'checked') {
<input type="text" class="form-control inp" name="password" value="" required="required" placeholder="请使用英文输入法输入密码并不小于8位数" onkeyup="this.value=this.value.replace(/\s/g,'')">
</div>
</div>
<div class="form-group">
<label class="col-sm-2 ">确认密码</label>
<div class="col-md-6 col-sm-10">
@@ -84,7 +87,7 @@ if ($state !== 'checked') {
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" name="del_extra_files" value="del" checked><span style="font-weight: bold;color:green;" title="删除Github/Gitee下载的多余文件">删除多余文件</span>
<input type="checkbox" name="del_extra_files" value="del" checked><span style="font-weight: bold;color:green;" title="删除Github|Gitee下载的多余文件">删除多余文件</span>
</label>
<label>
<input type="checkbox" name="del_install" value="del"><span style="font-weight: bold;color:red;">删除安装目录</span>
@@ -94,13 +97,12 @@ if ($state !== 'checked') {
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-success">准备就绪,开始安装!</button>
<a class="btn btn" href="index.php">上一步</a>
<button type="submit" class="btn btn-success">开始安装</button>
</div>
</div>
</form>
</div>
<script>
var password = document.querySelector('.inp');
var message = document.querySelector('.message');
@@ -115,15 +117,13 @@ if ($state !== 'checked') {
}
}
</script>
<!-- install bottom HTML start -->
<div class="modal fade" id="myModal">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">×</span>
<span aria-hidden="true">x</span>
<span class="sr-only">关闭</span></button>
<h4 class="modal-title icon icon-mobile" style="text-align: center">扫描二维码使用手机上传</h4>
</div>
@@ -139,6 +139,12 @@ if ($state !== 'checked') {
</div>
</div>
<script>
// NProgress
NProgress.configure({
showSpinner: false
});
NProgress.set(0.5);
NProgress.set(0.9);
// js二维码 获取当前网址并赋值给id=text的value
document.getElementById("text").value = window.location.href;
var qrcode = new QRCode(document.getElementById("qrcode"), {
@@ -168,7 +174,6 @@ if ($state !== 'checked') {
</script>
<footer class="text-muted small col-md-12" style="text-align: center;margin-bottom: 10px">
<hr>
<p><a href="/../admin/terms.php" target="_blank">请勿上传违反中国政策的图片</a><i class="icon icon-smile"></i></p>
<div>
<!-- 对话框触发按钮 -->
<a href="#" data-position="center" data-moveable="inside" data-moveable="true" data-toggle="modal" data-target="#myModal">