Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
修订 1.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lc6464 committed Aug 16, 2020
1 parent ee0ee5d commit 6e2cb2e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 18 deletions.
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@ define('Password', '请在这里填写密码啦!ヾ(≧▽≦*)o');
- [PNL 下载方式](https://www.lanzous.com/u/pnl "PNL 下载方式")

## New Changes
- 当前版本:`1.3.0`
- 更新日期:2020-8-15
- 当前版本:`1.3.1`
- 更新日期:2020-8-16
- 以下修改由 [LC](https://github.com/lc6464 "LC") 完成
- 优化后端逻辑和效率
- 优化代码
- 支持打开子文件夹
- 支持下载子文件夹内的文件
- 使用 SESSION 保存客户端登录状态
- 使用 SESSION 保存已经展示泄露密码提示的状态
- 优化错误时提示

## 坑或不确定
- `static/functions.js`
Expand Down
7 changes: 5 additions & 2 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* 请不要使用弱密码!否则后果自负!
* 若只在局域网开放,则可根据个人喜好开启或关闭密码。
*
* @version 1.3.0
* @version 1.3.1
*
* @author Yuan_Tuo <[email protected]>
* @link https://imwcr.cn/
Expand All @@ -22,7 +22,10 @@
* @link https://lcwebsite.cn/
* @link https://space.bilibili.com/52618445
*/
if (!defined('init')){ http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 3;url=./'); die("想啥呢?\r\n直接访问这个文件?"); } // 直接访问处理程序
if (!defined('init')){ // 直接访问处理程序
http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 3;url=./');
die("HTTP 403 禁止访问!\r\n此文件是 PanDownload 网页复刻版 PHP 语言版项目版本" . programVersion . "的配置文件!\r\n禁止直接访问!");
}

define('BDUSS', ''); // 你的 SVIP BDUSS
define('STOKEN', ''); // 你的 SVIP STOKEN
Expand Down
17 changes: 11 additions & 6 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* 请勿随意修改此文件!如需更改相关配置请到 config.php !
*
* @version 1.3.0
* @version 1.3.1
*
* @author Yuan_Tuo <[email protected]>
* @link https://imwcr.cn/
Expand All @@ -16,7 +16,10 @@
* @link https://lcwebsite.cn/
* @link https://space.bilibili.com/52618445
*/
if (!defined('init')){ http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 3;url=./'); die("想啥呢?\r\n直接访问这个文件?"); } // 直接访问处理程序
if (!defined('init')){ // 直接访问处理程序
http_response_code(403); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 3;url=./');
die("HTTP 403 禁止访问!\r\n此文件是 PanDownload 网页复刻版 PHP 语言版项目版本" . programVersion . "的有关文件!\r\n禁止直接访问!");
}

// main
function setCurl(&$ch, array $header) { // 批处理 curl
Expand Down Expand Up @@ -94,15 +97,17 @@ function CheckPassword() { // 校验密码
if (!isset($_POST["Password"])) {
if (isset($_SESSION["Password"])) {
if ($_SESSION["Password"] === Password) {
echo isset($_POST["dir"]) ? '' : '<script>sweetAlert("重要提示","请勿将密码告诉他人!此项目仅供测试使用!\r\n——Yuan_Tuo","info");</script>';
return;
echo (isset($_POST["dir"]) || isset($_SESSION["ShowAlert"])) ? ''
: '<script>sweetAlert("重要提示","请勿将密码告诉他人!此项目仅供测试使用!\r\n——Yuan_Tuo","info");</script>';
$_SESSION['ShowAlert'] = true; return;
}
}
} else {
if ($_POST["Password"] === Password) {
$_SESSION['Password'] = $_POST["Password"];
echo isset($_POST["dir"]) ? '' : '<script>sweetAlert("重要提示","请勿将密码告诉他人!此项目仅供测试使用!\r\n——Yuan_Tuo","info");</script>';
return;
echo (isset($_POST["dir"]) || isset($_SESSION["ShowAlert"])) ? ''
: '<script>sweetAlert("重要提示","请勿将密码告诉他人!此项目仅供测试使用!\r\n——Yuan_Tuo","info");</script>';
$_SESSION['ShowAlert'] = true; return;
}
}
die('<div class="row justify-content-center"><div class="col-md-7 col-sm-8 col-11">
Expand Down
12 changes: 7 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* 此项目 GitHub 地址:https://github.com/yuantuo666/baiduwp-php
*
* @version 1.3.0
* @version 1.3.1
*
* @author Yuan_Tuo <[email protected]>
* @link https://imwcr.cn/
Expand All @@ -23,11 +23,12 @@
// 导入配置和函数
session_start();
define('init', true);
define('programVersion', '1.3.1');
if (file_exists('config.php') && file_exists('functions.php')) {
require('config.php'); require('functions.php');
} else {
http_response_code(503); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 7;url=https://github.com/lc6464/baiduwp-php');
die("缺少相关配置和定义文件!无法正常运行程序!\r\n请重新 Clone 项目并配置!\r\n将在七秒内跳转到 GitHub 储存库!");
http_response_code(503); header('Content-Type: text/plain; charset=utf-8'); header('Refresh: 5;url=https://github.com/lc6464/baiduwp-php');
die("HTTP 503 服务不可用!\r\n缺少相关配置和定义文件!无法正常运行程序!\r\n请重新 Clone 项目并配置!\r\n将在五秒内跳转到 GitHub 储存库!");
}
// 通用响应头
header('Content-Type: text/html; charset=utf-8');
Expand Down Expand Up @@ -61,9 +62,10 @@
<button class="navbar-toggler border-0" type="button" data-toggle="collapse" data-target="#collpase-bar"><span class="navbar-toggler-icon"></span></button>
<div class="collapse navbar-collapse" id="collpase-bar">
<ul class="navbar-nav">
<li class="nav-item"><a class="nav-link" href="">主页</a></li>
<li class="nav-item"><a class="nav-link" href="">首页</a></li>
<li class="nav-item"><a class="nav-link" href="https://pandownload.com/" target="_blank">度盘下载器</a></li>
<li class="nav-item"><a class="nav-link" href="https://github.com/yuantuo666/baiduwp-php" target="_blank">GitHub 仓库</a></li>
<li class="nav-item"><a class="nav-link" href="https://github.com/lc6464/baiduwp-php" target="_blank">GitHub 仓库</a></li>
<li class="nav-item"><a class="nav-link" href="https://github.com/lc6464/baiduwp-php/releases/tag/<?php echo programVersion; ?>" target="_blank">版本:<?php echo programVersion; ?></a></li>
<li class="nav-item"><a class="nav-link" href="https://imwcr.cn/" target="_blank">Made by Yuan_Tuo</a></li>
<li class="nav-item"><a class="nav-link" href="https://lcwebsite.cn/" target="_blank">Optimized by LC</a></li>
</ul>
Expand Down

0 comments on commit 6e2cb2e

Please sign in to comment.