Files
zzp-server/public/install/template/main.php
2026-01-19 14:19:22 +08:00

476 lines
33 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php !defined('install') && exit(); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>安装</title>
<link rel="stylesheet" type="text/css" href="https://cdn.bootcdn.net/ajax/libs/layui/2.9.13/css/layui.css"/>
<link rel="stylesheet" type="text/css" href="./css/mounted.css"/>
<link rel="shortcut icon" href="./favicon.ico"/>
</head>
<body>
<div class="header">
<div class="logo" style="width: 220px;height:100px;">
</div>
</div>
<div class="mounted" id="mounted">
<div class="mounted-box">
<form method="post" action="#" name="main_form">
<!-- <div class="mounted-title">安装步骤</div>-->
<div class="mounted-container" id="tab">
<ul class="mounted-nav" id="nav">
<li <?php if ($step == "1") { ?>class="active"<?php } ?>>许可协议</li>
<li <?php if ($step == "2") { ?>class="active"<?php } ?>>环境监测</li>
<li <?php if ($step == "3") { ?>class="active"<?php } ?>>参数配置</li>
<li <?php if ($step == "4" or $step == '5') { ?>class="active"<?php } ?>>安装</li>
</ul>
<!-- 阅读许可 -->
<?php if ($step == '1') { ?>
<div class="mounted-content-item show">
<div class="content-header">
阅读许可协议
</div>
<div class="content">
<h2>应用授权协议</h2>
<div class="white-space;pre">
</div>
<h3 class="mt16">一、应用使用</h3>
<p class="mt16">
1、应用禁止在各类平台以任何形式包括二次修改后进行二次分发出售。<br>
2、基于应用从事的一切商业行业和本站无关。<br>
3、应用禁止分享、复制、转售和传播。<br>
4、用户不得利用应用制作、上载、复制、发布、传播如下法律、法规和政策禁止的内容<br>
(1) 反对宪法所确定的基本原则的;<br>
(2) 危害国家安全,泄露国家秘密,颠覆国家政权,破坏国家统一的;<br>
(3) 损害国家荣誉和利益的;<br>
(4) 煽动民族仇恨、民族歧视,破坏民族团结的;<br>
(5) 破坏国家宗教政策,宣扬邪教和封建迷信的;<br>
(6) 散布谣言,扰乱社会秩序,破坏社会稳定的;<br>
(7) 散布淫秽、色情、赌博、暴力、凶杀、恐怖或者教唆犯罪的;<br>
(8) 侮辱或者诽谤他人,侵害他人合法权益的;<br>
(9) 不遵守法律法规底线、社会主义制度底线、国家利益底线、公民合法权益底线、社会公共秩序底线、道德风尚底线和信息真实性底线的“七条底线”要求的;<br>
(10) 含有法律、行政法规禁止的其他内容的信息。<br>
</p>
<h3 class="mt16">二、知识产权声明</h3>
<p class="mt16">
1、应用源代码所有权和著作权归应用开发商所有。<br>
2、除另有特别声明外应用所依托的代码、文字、图片等著作权、专利权及其他知识产权均归其开发商所有。<br>
</p>
<h3 class="mt16">三、法律责任</h3>
<p class="mt16">
1、如果官网发现或收到他人举报或投诉用户违反本协议约定的官网有权不经通知随时对相关内容包括但不限于用户资料、聊天记录进行审查、删除并视情节轻重对违规帐号处以包括但不限于警告、帐号封禁、设备封禁、功能封禁的处罚。<br>
2、用户理解并同意官网有权依合理判断对违反有关法律法规或本协议规定的行为进行处罚对违法违规的任何用户采取适当的法律行动并依据法律法规保存有关信息向有关部门报告等用户应承担由此而产生的一切法律责任。<br>
3、用户理解并同意因用户违反本协议约定导致或产生的任何第三方主张的任何索赔、要求或损失包括合理的律师费用户应当赔偿官网与合作公司、关联公司并使之免受损害。<br>
</p>
<h3 class="mt16">四、不可抗力及其他免责事由</h3>
<p class="mt16">
1、用户理解并确认在使用本服务的过程中可能会遇到不可抗力等风险因素使本服务发生中断。不可抗力是指不能预见、不能克服并不能避免且对一方或双方造成重大影响的客观事件包括但不限于自然灾害如洪水、地震、瘟疫流行和风暴等以及社会事件如战争、动乱、政府行为等。出现上述情况时官网将努力在第一时间与相关单位配合及时进行修复但是由此给用户或第三方造成的损失官网及合作单位在法律允许的范围内免责。<br>
2、本服务同大多数互联网服务一样受包括但不限于用户原因、网络服务质量、社会环境等因素的差异影响可能受到各种安全问题的侵扰如他人利用用户的资料造成现实生活中的骚扰用户下载安装的其它软件或访问的其他网站中含有“特洛伊木马”等病毒威胁到用户的计算机信息和数据的安全继而影响本服务的正常使用等等。用户应加强信息安全及使用者资料的保护意识要注意加强帐号保护以免遭致损失和骚扰。<br>
3、用户理解并确认本服务存在因不可抗力、计算机病毒或黑客攻击、系统不稳定、用户所在位置、用户关机以及其他任何技术、互联网络、通信线路原因等造成的服务中断或不能满足用户要求的风险因此导致的用户或第三方任何损失官网不承担任何责任。<br>
4、用户理解并确认在使用本服务过程中存在来自任何他人的包括误导性的、欺骗性的、威胁性的、诽谤性的、令人反感的或非法的信息或侵犯他人权利的匿名或冒名的信息以及伴随该等信息的行为因此导致的用户或第三方的任何损失官网不承担任何责任。<br>
5、用户理解并确认官网需要定期或不定期地对官网平台或相关的设备进行检修或者维护如因此类情况而造成服务在合理时间内的中断官网无需为此承担任何责任。<br>
6、官网依据法律法规、本协议约定获得处理违法违规或违约内容的权利该权利不构成官网的义务或承诺官网不能保证及时发现违法违规或违约行为或进行相应处理。<br>
7、用户理解并确认对于官网向用户提供的下列产品或者服务的质量缺陷及其引发的任何损失官网无需承担任何责任<br>
(1) 官网向用户免费提供的服务;<br>
(2) 官网向用户赠送的任何产品或者服务。<br>
8、在任何情况下官网均不对任何间接性、后果性、惩罚性、偶然性、特殊性或刑罚性的损害包括因用户使用官网或本服务而遭受的利润损失承担责任即使官网已被告知该等损失的可能性亦然。尽管本协议中可能含有相悖的规定官网对用户承担的全部责任无论因何原因或何种行为方式始终不超过用户因使用官网提供的服务而支付给官网的费用(如有)。<br>
</p>
<h3 class="mt16">五、服务的变更、中断、终止</h3>
<p class="mt16">
1、鉴于网络服务的特殊性用户同意官网有权随时变更、中断或终止部分或全部的服务包括收费服务。官网变更、中断或终止的服务官网应当在变更、中断或终止之前通知用户。<br>
2、如发生下列任何一种情形官网有权变更、中断或终止向用户提供的免费服务或收费服务而无需对用户或任何第三方承担任何责任<br>
(1) 根据法律规定用户应提交真实信息,而用户提供的个人资料不真实、或与注册时信息不一致又未能提供合理证明;<br>
(2) 用户违反相关法律法规或本协议的约定;<br>
(3) 按照法律规定或有权机关的要求;<br>
(4) 出于安全的原因或其他必要的情形。<br>
</p>
<h3 class="mt16">六、其他</h3>
<p class="mt16">
1、官网郑重提醒用户注意本协议中免除官网责任和限制用户权利的条款请用户仔细阅读自主考虑风险。未成年人应在法定监护人的陪同下阅读本协议。<br>
2、本协议的效力、解释及纠纷的解决适用于中华人民共和国法律。若用户和官网之间发生任何纠纷或争议首先应友好协商解决协商不成的用户同意将纠纷或争议提交官网住所地有管辖权的人民法院管辖。<br>
3、本协议的任何条款无论因何种原因无效或不具可执行性其余条款仍有效对双方具有约束力。<br>
</p>
</div>
</div>
<?php } ?>
<!-- 检查信息 -->
<?php if ($step == '2') { ?>
<div class="mounted-content-item show">
<div class="mounted-env-container">
<div class="mounted-item">
<div class="content-header">
服务器信息
</div>
<div class="content-table">
<table class="layui-table" lay-skin="line">
<colgroup>
<col width="210">
<col width="730">
</colgroup>
<thead>
<tr>
<th>参数</th>
<th>值</th>
</tr>
</thead>
<tbody>
<tr>
<td>服务器操作系统</td>
<td><?php echo PHP_OS ?></td>
</tr>
<tr>
<td>web服务器环境</td>
<td><?php echo $_SERVER['SERVER_SOFTWARE']; ?></td>
</tr>
<tr>
<td>PHP版本</td>
<td><?php echo @phpversion(); ?></td>
</tr>
<tr>
<td>程序安装目录</td>
<td><?php echo realpath(__DIR__ . '../../../'); ?></td>
</tr>
<tr>
<td>磁盘空间</td>
<td><?php echo $modelInstall->freeDiskSpace(realpath(__DIR__ . '../../../')) ?></td>
</tr>
<tr>
<td>上传限制</td>
<?php if (ini_get('file_uploads')): ?>
<td><?php echo ini_get('upload_max_filesize'); ?></td>
<?php else: ?>
<td>禁止上传</td>
<?php endif; ?>
</tr>
</tbody>
</table>
</div>
</div>
<div class="mounted-tips mt16">PHP环境要求必须满足下列所有条件否则系统或系统部分功能将无法使用。</div>
<div class="mounted-item mt16">
<div class="content-header">
PHP环境要求
</div>
<div class="content-table">
<table class="layui-table" lay-skin="line">
<colgroup>
<col width="210">
<col width="210">
<col width="120">
<col width="400">
</colgroup>
<thead>
<tr>
<th>选项</th>
<th>要求</th>
<th>状态</th>
<th>说明及帮助</th>
</tr>
</thead>
<tbody>
<tr>
<td>PHP版本</td>
<td>大于8.0</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkPHP()) ?>
<td>建议使用PHP8.0.8版本</td>
</tr>
<tr>
<td>PDO_MYSQL</td>
<td>支持 (强烈建议支持)</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkPDOMySQL()) ?>
<td></td>
</tr>
<tr>
<td>allow_url_fopen</td>
<td>支持 (建议支持cURL)</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkCurl()) ?>
<td></td>
</tr>
<tr>
<td>GD2</td>
<td>支持</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkGd2()) ?>
<td></td>
</tr>
<tr>
<td>DOM</td>
<td>支持</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkDom()) ?>
<td></td>
</tr>
<tr>
<td>fileinfo</td>
<td>支持</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkFileInfo()) ?>
<td></td>
</tr>
<tr>
<td>session.auto_start</td>
<td>关闭</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkSessionAutoStart()) ?>
<td></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="mounted-tips mt16">
系统要求安装目录下的runtime和upload必须可写才能使用的所有功能。
</div>
<div class="mounted-item mt16">
<div class="content-header">
目录权限监测
</div>
<div class="content-table">
<table class="layui-table" lay-skin="line">
<colgroup>
<col width="210">
<col width="210">
<col width="120">
<col width="400">
</colgroup>
<thead>
<tr>
<th>目录</th>
<th>要求</th>
<th>状态</th>
<th>说明及帮助</th>
</tr>
</thead>
<tbody>
<tr>
<td>/runtime</td>
<td>runtime目录可写</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('runtime')) ?>
<td><?php if($modelInstall->checkDirWrite('runtime') =='fail') echo'请给runtime目录权限若目录不存在先新建';?></td>
</tr>
<tr>
<td>/public/uploads</td>
<td>uploads目录可写</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('public/uploads')) ?>
<td><?php if($modelInstall->checkDirWrite('public/uploads')=='fail') echo'请给public/uploads目录权限若目录不存在先新建';?></td>
</tr>
<tr>
<td>/public/admin</td>
<td>admin目录可写</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('public/admin')) ?>
<td><?php if($modelInstall->checkDirWrite('public/uploads')=='fail') echo'请给public/admin目录权限若目录不存在先新建';?></td>
</tr>
<tr>
<td>../config</td>
<td>config目录可写</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('config')) ?>
<td><?php if($modelInstall->checkDirWrite('config')=='fail') echo'请给config目录权限若目录不存在先新建';?></td>
</tr>
<tr>
<td>../.env</td>
<td>.env文件可写</td>
<?php echo $modelInstall->correctOrFail($modelInstall->checkDirWrite('.env')) ?>
<td><?php if($modelInstall->checkDirWrite('.env')=='fail') echo'请给.env文件权限若文件不存在注意文件名第1字符是" . "';?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<?php } ?>
<!-- 数据库设置 -->
<?php if ($step == '3') { ?>
<div class="mounted-content-item show">
<div class="mounted-item">
<div class="content-header">
数据库选项
</div>
<div class="content-form">
<div class="form-box-item">
<div class="form-desc">
数据库主机
</div>
<div>
<input type="text" name="host" value="<?= $post['host'] ?>"/>
</div>
</div>
<div class="form-box-item">
<div class="form-desc">
端口号
</div>
<div>
<input type="text" name="port" value="<?= $post['port'] ?>"/>
</div>
</div>
<div class="form-box-item">
<div class="form-desc">
数据库用户
</div>
<div>
<input type="text" name="user" value="<?= $post['user'] ?>"/>
</div>
</div>
<div class="form-box-item">
<div class="form-desc">
数据库名称
</div>
<div>
<input type="text" name="name" value="<?= $post['name'] ?>"/>
</div>
</div>
<div class="form-box-item">
<div class="form-desc">
数据库密码
</div>
<div>
<input type="text" name="password" value="<?= $post['password'] ?>"/>
</div>
</div>
<div class="form-box-item">
<div class="form-desc">
数据表前缀
</div>
<div>
<input type="text" name="prefix" value="<?= $post['prefix'] ?>"/>
</div>
</div>
</div>
</div>
<div class="mounted-item">
<div class="content-header mt16">
管理选项
</div>
<div class="content-form">
<div class="form-box-item">
<div class="form-desc">
管理员账号
</div>
<div>
<input type="text" name="admin_user" value="<?= $post['admin_user'] ?>"/>
</div>
</div>
<div class="form-box-item">
<div class="form-desc">
管理员密码
</div>
<div>
<input type="password" name="admin_password"
value="<?= $post['admin_password'] ?>"/>
</div>
</div>
<div class="form-box-item">
<div class="form-desc">
确认密码
</div>
<div>
<input type="password" name="admin_confirm_password"
value="<?= $post['admin_confirm_password'] ?>"/>
</div>
</div>
</div>
</div>
<div class="mounted-item">
<div class="content-header mt16">
系统选项
</div>
<div class="content-form">
<div class="form-box-item">
<div class="form-desc">
PHP时区
</div>
<div>
<input type="text" name="time_zone" value="<?= $post['time_zone'] ?>"/>
</div>
</div>
</div>
</div>
</div>
<?php } ?>
<!-- 安装中 -->
<?php if ($step == '4' or $step == '5') { ?>
<div class="mounted-content-item show">
<?php if ($step == '4') { ?>
<div id="mounting">
<div class="content-header">
正在安装中
</div>
<div class="mounting-container " id="install_message">
<?php if (count($successTables) > 0): ?>
<p style="margin-bottom: 4px;">成功创建数据库:<?= $post['name'] ?></p>
<?php endif; ?>
</div>
</div>
<?php } ?>
<?php if ($step == '5') { ?>
<div class="show" id="mounting-success">
<div class="content-header">
安装成功
</div>
<div class="success-content">
<div style="width: 48px;height: 48px;">
<img src="./images/icon_mountSuccess.png"/>
</div>
<div class="mt16 result">安装完成</div>
<div style="margin-top: 5px;font-size:14px;">版本号1.6.0</div>
<div class="tips">
为了您站点的安全安装完成后即可将网站根目录下的“install”文件夹删除或者config/install.lock/目录下创建install.lock文件防止重复安装。
</div>
</div>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
</form>
<?php if ($step == '1') { ?>
<div class="item-btn-group show">
<button class="accept-btn" onclick="goStep(<?php echo $nextStep ?>)">我已阅读并同意</button>
</div>
<?php } elseif (in_array($step, ['2', "3"])) { ?>
<div class="item-btn-group show">
<button class="cancel-btn" onclick="cancel()" style="padding: 7px 63px;margin-right: 16px">返回
</button>
<?php if ($modelInstall->getAllowNext()): ?>
<button class="accept-btn" onclick="goStep(<?php echo $nextStep ?>)" style="padding: 7px 63px;">
继续
</button>
<?php else: ?>
<button class="accept-btn" onclick="goStep(<?php echo $step ?>)" style="padding: 7px 63px;">重新检查
</button>
<?php endif; ?>
</div>
<?php } elseif ($step == "4") { ?>
<div class="item-btn-group show">
<button class="disabled-btn" disabled="disabled">
<div class="layui-icon layui-icon-loading layui-anim layui-anim-rotate layui-anim-loop"></div>
<div style="font-size: 14px;margin-left: 7px;">正在安装中...</div>
</button>
</div>
<?php } ?>
</div>
</div>
<footer>
</footer>
<script src="https://cdn.bootcdn.net/ajax/libs/layui/2.9.13/layui.js"></script>
<?php if (count($successTables) > 0): ?>
<script>var successTables = eval(<?=json_encode($successTables) ?>); </script>
<?php endif; ?>
<script src="./js/mounted.js"></script>
</body>
</html>
<?php if ($message != ''): ?>
<script>alert('<?=$message; ?>');</script>
<?php endif; ?>