Skip to content

Commit

Permalink
Improve
Browse files Browse the repository at this point in the history
  • Loading branch information
lslqtz committed Nov 3, 2024
1 parent 869706a commit b7ca2a7
Show file tree
Hide file tree
Showing 9 changed files with 355 additions and 343 deletions.
12 changes: 11 additions & 1 deletion config-example.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
'MinSearchLength' => 2,
'MaxSearchFontCount' => 100,
'EmailExpireTime' => 0, // 0: Manual approval.
'AnonUID' => 10000000
'PublicUID' => 10000000 // 0: Disable public.
),
'FontServer' => array(
'key' => 'FontServer',
Expand Down Expand Up @@ -114,6 +114,16 @@ function dieHTML(string $string, string $prefix = '') {
HTMLEnd();
die();
}
function RedirectIndex() {
header('HTTP/1.1 302 Found');
header('Location: /');
die();
}
function RedirectLogin() {
header('HTTP/1.1 302 Found');
header('Location: /login.php');
die();
}
function ShowTable(array $fontsResult, bool $foundFont = true, ?array $downloadFontArr = null, bool $uploadSubtitle = false) {
echo "<p>" . ($foundFont ? '找到字体数: ' : '缺失字体数: ') . count($fontsResult) . "</p>\n";
echo "<div class=\"searchResult\">\n<table border=\"2\">\n";
Expand Down
6 changes: 3 additions & 3 deletions confirm.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
require_once('user.php');
if (isset($_GET['uid'], $_GET['time'], $_GET['code']) && is_numeric($_GET['uid']) && is_numeric($_GET['time']) && !empty($_GET['email'])) {
if (ConfirmEmail(intval($_GET['uid']), $_GET['email'], intval($_GET['time']), $_GET['code']) <= 0) {
dieHTML("确认失败! 可能已确认或已失效.", 'Register');
dieHTML("确认失败! 可能已确认或已失效.", 'Confirm');
}
dieHTML("确认成功! 请直接<a href=\"login.php\">登录</a>.", 'Register');
dieHTML("确认成功! 请直接<a href=\"login.php\">登录</a>.", 'Confirm');
}
dieHTML(":(", 'Register');
dieHTML(":(", 'Confirm');
?>
Loading

0 comments on commit b7ca2a7

Please sign in to comment.