From ab9c22aae79208826da73404e9fd6df09a6bc352 Mon Sep 17 00:00:00 2001 From: admin <15630053159@163.com> Date: Fri, 27 Nov 2026 15:41:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LICENSE | 21 ++++++++++++++ index.php | 64 +++++++++++++++++++++++++++++++++++++++++++ logout.php | 11 ++++++++ migrate-v3.sql | 37 +++++++++++++++++++++++++ migrate-v4.sql | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 207 insertions(+) create mode 100644 LICENSE create mode 100644 index.php create mode 100644 logout.php create mode 100644 migrate-v3.sql create mode 100644 migrate-v4.sql diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..47cc599 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 沈石磊(上海科技管理学校) + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/index.php b/index.php new file mode 100644 index 0000000..ab5f3b8 --- /dev/null +++ b/index.php @@ -0,0 +1,64 @@ +prepare("SELECT user_id, username, password, active, is_admin FROM photo_users WHERE username = ?"); + $stmt->bind_param("s", $username); + $stmt->execute(); + $row = $stmt->get_result()->fetch_assoc(); + $stmt->close(); + + if (!$row) { + $error = '用户名或密码错误。'; + } elseif ((int)$row['active'] === 0) { + $error = '账号已被禁用,请联系管理员。'; + } elseif (!password_verify($password, $row['password'])) { + $error = '用户名或密码错误。'; + } else { + session_regenerate_id(true); + $_SESSION['loggedin'] = true; + $_SESSION['user_id'] = (int)$row['user_id']; + $_SESSION['user_name'] = $row['username']; + $_SESSION['is_admin'] = (bool)$row['is_admin']; + start_login($conn, (int)$row['user_id']); + } +} + +render_auth_header('登录', '', 'square.php'); +?> +

欢迎回来

+

登录后即可管理你的私人相册

+ +
+ + +
+ +
+
+ + +
+
+ +
+ + +
+
+ +
+

还没有账号?使用邀请码注册

+

先逛逛照片广场(公开)

+