You've already forked EasyImages2.0
mirror of
https://github.com/icret/EasyImages2.0.git
synced 2025-12-13 11:43:58 +08:00
图表化来临
This commit is contained in:
52
install/contorl.php
Executable file
52
install/contorl.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../application/function.php';
|
||||
|
||||
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'];
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
exit('<script>window.alert("两次密码不一致请重新输入!");location.href="./index.php";</script>');
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_POST['domain'])) {
|
||||
$config['domain']= $_POST['domain'];
|
||||
|
||||
}
|
||||
|
||||
if (isset($_POST['imgurl'])) {
|
||||
$config['imgurl']= $_POST['imgurl'];
|
||||
}
|
||||
|
||||
$config_file = APP_ROOT . '/config/config.php';
|
||||
cache_write($config_file, $config);
|
||||
|
||||
file_put_contents(APP_ROOT . '/install/install.lock', '安装程序锁定文件。'); // 创建安装程序锁
|
||||
|
||||
// 跳转主页
|
||||
echo '
|
||||
<script>
|
||||
|
||||
window.alert("安装成功,即将为您跳转到登陆界面!");
|
||||
location.href="/../application/login.php";
|
||||
</script>
|
||||
';
|
||||
|
||||
// 删除安装目录
|
||||
if (isset($_POST['del_install'])) {
|
||||
if ($_POST['del_install'] == "del") {
|
||||
deldir(APP_ROOT . "/install/");
|
||||
}
|
||||
}
|
||||
|
||||
//exit(header("Location:/../application/login.php")); // 跳转主页
|
||||
184
install/index.php
Executable file
184
install/index.php
Executable file
@@ -0,0 +1,184 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../application/function.php';
|
||||
// 存在程序锁则跳转主页
|
||||
if (file_exists(APP_ROOT . '/install/install.lock')) {
|
||||
exit(header("Location:/../index.php"));
|
||||
}
|
||||
$phpEnv = (PHP_VERSION >= 5.6) ? true : false;
|
||||
$fileinfo = extension_loaded('fileinfo') ? true : false;
|
||||
$gd = extension_loaded('gd') ? true : false;
|
||||
$openssl = extension_loaded('openssl') ? true : false;
|
||||
|
||||
$file = substr(base_convert(fileperms(APP_ROOT . "/file.php"), 10, 8), 3);
|
||||
if (IS_WIN) {
|
||||
$file_php = true;
|
||||
$i_wjj = true;
|
||||
}
|
||||
if (!IS_WIN) {
|
||||
if ($file == '755') {
|
||||
$file_php = true;
|
||||
} else {
|
||||
$file_php = false;
|
||||
}
|
||||
if (is_writable(APP_ROOT . '/i/')) {
|
||||
$i_wjj = true;
|
||||
} else {
|
||||
$i_wjj = false;
|
||||
}
|
||||
}
|
||||
|
||||
function checkPASS($name)
|
||||
{
|
||||
if ($name) {
|
||||
echo '<p style="color:green;font-weight: bold"><i class="icon icon-check icon-2x"></i></p>';
|
||||
} else {
|
||||
echo '<p style="color:red;font-weight: bold"><i class="icon icon-times icon-2x"></p>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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 安装环境检测" />
|
||||
<link rel="shortcut icon" href="./../public/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>
|
||||
<script src="./../public/static/qrcode.min.js?v2.0"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body class="container">
|
||||
<!-- install header html end -->
|
||||
|
||||
<h1 style="text-align:center">EasyIamge 2.0 安装环境检测</h1>
|
||||
<table class="table table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>检查名称</th>
|
||||
<th>图床要求</th>
|
||||
<th>检测结果</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>PHP</td>
|
||||
<td>PHP >= 5.6</td>
|
||||
<td><?php checkPASS($phpEnv); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Fileinfo</td>
|
||||
<td>必须支持</td>
|
||||
<td> <?php checkPASS($fileinfo); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>GD</td>
|
||||
<td>必须支持</td>
|
||||
<td> <?php checkPASS($gd); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>openssl</td>
|
||||
<td>建议支持(用于删除文件,PHP>7.0)</td>
|
||||
<td> <?php checkPASS($openssl); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>file.php</td>
|
||||
<td>0755可执行权限(非windows系统)</td>
|
||||
<td> <?php checkPASS($file_php); ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>/i</td>
|
||||
<td>可写</td>
|
||||
<td><?php checkPASS($i_wjj); ?></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<?php
|
||||
$checkres = array($phpEnv, $fileinfo, $gd, $i_wjj, $file_php);
|
||||
|
||||
if (in_array(false, $checkres)) {
|
||||
echo '<a href="./index.php" ><button class="btn btn-lg btn-danger" type="button">请满足上述要求后点击刷新</button></a>';
|
||||
} else {
|
||||
echo '
|
||||
<form action="install.php" method="post">
|
||||
<input type="hidden" name="check" value="checked" readonly>
|
||||
<input type="submit" class="btn btn-lg btn-primary" value="下一步(1/2)" >
|
||||
</form>
|
||||
';
|
||||
}
|
||||
?>
|
||||
<!-- 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 class="sr-only">关闭</span></button>
|
||||
<h4 class="modal-title icon icon-mobile" style="text-align: center">扫描二维码使用手机上传</h4>
|
||||
</div>
|
||||
<div class="modal-body" align="center">
|
||||
<input id="text" type="hidden" value="" />
|
||||
<p id="qrcode"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-danger btn-sm" href="" target="_blank">访问</a>
|
||||
<button type="button" class="btn btn-primary btn-sm" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// js二维码 获取当前网址并赋值给id=text的value
|
||||
document.getElementById("text").value = window.location.href;
|
||||
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
||||
width: 200,
|
||||
height: 200,
|
||||
});
|
||||
|
||||
function makeCode() {
|
||||
var elText = document.getElementById("text");
|
||||
if (!elText.value) {
|
||||
alert("Input a text");
|
||||
elText.focus();
|
||||
return;
|
||||
}
|
||||
qrcode.makeCode(elText.value);
|
||||
}
|
||||
makeCode();
|
||||
$("#text").on("blur",
|
||||
function() {
|
||||
makeCode();
|
||||
}).on("keydown",
|
||||
function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
makeCode();
|
||||
}
|
||||
});
|
||||
</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">
|
||||
<i class="icon icon-qrcode"></i>二维码 </a>
|
||||
</div>
|
||||
<?php echo 'Copyright © 2018-' . date('Y'); ?>
|
||||
<a href="https://img.545141.com/" target="_blank">EasyImage</a> By
|
||||
<a href="https://www.545141.com/902.html" target="_blank">Icret</a> Version:<a href="https://github.com/icret/EasyImages2.0" target="_blank"><?php echo $config['version']; ?></a>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
175
install/install.php
Executable file
175
install/install.php
Executable file
@@ -0,0 +1,175 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../application/function.php';
|
||||
// 存在程序锁则跳转主页
|
||||
if (file_exists(APP_ROOT . '/install/install.lock')) {
|
||||
exit(header("Location:/../index.php"));
|
||||
}
|
||||
|
||||
// 验证上一步环境检测
|
||||
$state = isset($_POST['check']) ? $_POST['check'] : exit(header("Location:index.php"));
|
||||
if ($state !== 'checked') {
|
||||
exit(header("Location:index.php"));
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh-cn">
|
||||
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<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 即将完成安装!" />
|
||||
<link rel="shortcut icon" href="./../public/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>
|
||||
<script src="./../public/static/qrcode.min.js?v2.0"></script>
|
||||
<style>
|
||||
.message {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.wrong {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.right {
|
||||
color: green;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="container">
|
||||
<!-- install header html end -->
|
||||
<div class="col-md-12" style="height: 120px;"></div>
|
||||
<div class="col-md-12" style="text-align: center;">
|
||||
<form class="form-horizontal" action="./contorl.php" method="post">
|
||||
<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="" required="required" onkeyup="this.value=this.value.replace(/\s/g,'')" placeholder="网站域名与图片链接域名可以不同,比如A域名上传,可以返回B域名图片链接,如果不变的话,下边2个填写成一样的!" title="网站域名与图片链接域名可以不同,比如A域名上传,可以返回B域名图片链接,如果不变的话,下边2个填写成一样的!">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2">图片链接域名,末尾不加"/"</label>
|
||||
<div class="col-md-6 col-sm-10">
|
||||
<input type="text" class="form-control" name="imgurl" value="" required="required" placeholder="给图片的域名,末尾不加/,如果没有请填写和上边的一样即可" onkeyup="this.value=this.value.replace(/\s/g,'')" placeholder="图片域名">
|
||||
</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,'')">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 ">确认密码</label>
|
||||
<div class="col-md-6 col-sm-10">
|
||||
<input type="text" class="form-control" name="repassword" value="" required="required" placeholder="确认密码" onkeyup="this.value=this.value.replace(/\s/g,'')">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" name="del_install" value="del"><span style="font-weight: bold;color:red;">删除安装目录</span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-success">准备就绪,开始安装!</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
var password = document.querySelector('.inp');
|
||||
var message = document.querySelector('.message');
|
||||
|
||||
password.onblur = function() {
|
||||
if (this.value.length < 8 || this.value.length > 18) {
|
||||
message.innerHTML = '密码长度错误,应为8~18位';
|
||||
message.className = 'message wrong';
|
||||
} else {
|
||||
message.innerHTML = '密码长度正确';
|
||||
message.className = 'message right';
|
||||
}
|
||||
}
|
||||
</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 class="sr-only">关闭</span></button>
|
||||
<h4 class="modal-title icon icon-mobile" style="text-align: center">扫描二维码使用手机上传</h4>
|
||||
</div>
|
||||
<div class="modal-body" align="center">
|
||||
<input id="text" type="hidden" value="" />
|
||||
<p id="qrcode"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-danger btn-sm" href="" target="_blank">访问</a>
|
||||
<button type="button" class="btn btn-primary btn-sm" data-dismiss="modal">关闭</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// js二维码 获取当前网址并赋值给id=text的value
|
||||
document.getElementById("text").value = window.location.href;
|
||||
var qrcode = new QRCode(document.getElementById("qrcode"), {
|
||||
width: 200,
|
||||
height: 200,
|
||||
});
|
||||
|
||||
function makeCode() {
|
||||
var elText = document.getElementById("text");
|
||||
if (!elText.value) {
|
||||
alert("Input a text");
|
||||
elText.focus();
|
||||
return;
|
||||
}
|
||||
qrcode.makeCode(elText.value);
|
||||
}
|
||||
makeCode();
|
||||
$("#text").on("blur",
|
||||
function() {
|
||||
makeCode();
|
||||
}).on("keydown",
|
||||
function(e) {
|
||||
if (e.keyCode == 13) {
|
||||
makeCode();
|
||||
}
|
||||
});
|
||||
</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">
|
||||
<i class="icon icon-qrcode"></i>二维码 </a>
|
||||
</div>
|
||||
<?php echo 'Copyright © 2018-' . date('Y'); ?>
|
||||
<a href="https://img.545141.com/" target="_blank">EasyImage</a> By
|
||||
<a href="https://www.545141.com/902.html" target="_blank">Icret</a> Version:<a href="https://github.com/icret/EasyImages2.0" target="_blank"><?php echo $config['version']; ?></a>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user