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'); +?> +

欢迎回来

+

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

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

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

+

先逛逛照片广场(公开)

+