diff options
| author | haturatu <taro@eyes4you.org> | 2025-10-12 18:52:35 +0900 |
|---|---|---|
| committer | haturatu <taro@eyes4you.org> | 2025-10-12 18:52:35 +0900 |
| commit | 0cf0d195218fc289f2a04db5535d8fbbd96c988c (patch) | |
| tree | e5d1911b7e0aae157b3cd93719a4f547ca88a965 /templates | |
| parent | 957dc75eddf69ccf26bd387828b9e205a5425f30 (diff) | |
add: php support
- ja doc
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/php/account.php | 29 | ||||
| -rw-r--r-- | templates/php/account_password.php | 42 | ||||
| -rw-r--r-- | templates/php/login.php | 42 | ||||
| -rw-r--r-- | templates/php/register.php | 46 |
4 files changed, 159 insertions, 0 deletions
diff --git a/templates/php/account.php b/templates/php/account.php new file mode 100644 index 0000000..c57455e --- /dev/null +++ b/templates/php/account.php @@ -0,0 +1,29 @@ +<?php + $paths = [ + 'AccountPassword' => $_SERVER['AUTH_PATH_ACCOUNT_PASSWORD'] ?? '/account/password', + 'Logout' => $_SERVER['AUTH_PATH_LOGOUT'] ?? '/logout', + 'Assets' => $_SERVER['AUTH_ASSETS_PATH'] ?? '/assets', + ]; +?> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>My Account</title> + <link rel="stylesheet" href="<?php echo htmlspecialchars($paths['Assets']); ?>/css/style.css"> + <link rel="stylesheet" href="<?php echo htmlspecialchars($paths['Assets']); ?>/css/account.css"> +</head> +<body> + <div class="container content-container"> + <h2>My Account</h2> + <p>Welcome, <?php echo htmlspecialchars($_SERVER['HTTP_X_USERNAME']); ?>!</p> + <ul> + <li><a href="<?php echo htmlspecialchars($paths['AccountPassword']); ?>">Change Password</a></li> + </ul> + <div class="logout-link"> + <a href="<?php echo htmlspecialchars($paths['Logout']); ?>">Logout</a> + </div> + </div> +</body> +</html>
\ No newline at end of file diff --git a/templates/php/account_password.php b/templates/php/account_password.php new file mode 100644 index 0000000..b287c90 --- /dev/null +++ b/templates/php/account_password.php @@ -0,0 +1,42 @@ +<?php + $paths = [ + 'Account' => $_SERVER['AUTH_PATH_ACCOUNT'] ?? '/account', + 'AccountPassword' => $_SERVER['AUTH_PATH_ACCOUNT_PASSWORD'] ?? '/account/password', + 'Assets' => $_SERVER['AUTH_ASSETS_PATH'] ?? '/assets', + ]; +?> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Change Password</title> + <link rel="stylesheet" href="<?php echo htmlspecialchars($paths['Assets']); ?>/css/style.css"> + <link rel="stylesheet" href="<?php echo htmlspecialchars($paths['Assets']); ?>/css/account.css"> +</head> +<body> + <div class="container content-container"> + <h2>Change Password</h2> + <form id="change-password-form" action="<?php echo htmlspecialchars($paths['AccountPassword']); ?>" method="post"> + <div class="form-group"> + <label for="current_password">Current Password</label> + <input type="password" id="current_password" name="current_password" required> + </div> + <div class="form-group"> + <label for="new_password">New Password</label> + <input type="password" id="new_password" name="new_password" required> + </div> + <div class="form-group"> + <label for="confirm_new_password">Confirm New Password</label> + <input type="password" id="confirm_new_password" name="confirm_new_password" required> + </div> + <button type="submit">Update Password</button> + </form> + <p id="message-placeholder" class="message"></p> + <div class="back-link"> + <a href="<?php echo htmlspecialchars($paths['Account']); ?>">Back to Account</a> + </div> + </div> + <script src="<?php echo htmlspecialchars($paths['Assets']); ?>/js/auth.js"></script> +</body> +</html>
\ No newline at end of file diff --git a/templates/php/login.php b/templates/php/login.php new file mode 100644 index 0000000..f3e5113 --- /dev/null +++ b/templates/php/login.php @@ -0,0 +1,42 @@ +<?php + $paths = [ + 'Login' => $_SERVER['AUTH_PATH_LOGIN'] ?? '/login', + 'Register' => $_SERVER['AUTH_PATH_REGISTER'] ?? '/register', + 'Assets' => $_SERVER['AUTH_ASSETS_PATH'] ?? '/assets', + ]; +?> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Login</title> + <link rel="stylesheet" href="<?php echo htmlspecialchars($paths['Assets']); ?>/css/style.css"> +</head> +<body> + <div class="container form-container"> + <h2>Login Required</h2> + <form id="login-form" action="<?php echo htmlspecialchars($paths['Login']); ?>" method="post"> + <div class="form-group"> + <label for="username">Username</label> + <input type="text" id="username" name="username" required> + </div> + <div class="form-group"> + <label for="password">Password</label> + <input type="password" id="password" name="password" required> + </div> + <button type="submit">Login</button> + </form> + <p class="error"> + <?php + if (!empty($_GET['error'])) { + echo htmlspecialchars($_GET['error']); + } + ?> + </p> + <div style="text-align: center; margin-top: 1rem;"> + <a href="<?php echo htmlspecialchars($paths['Register']); ?>">Don't have an account? Register</a> + </div> + </div> +</body> +</html>
\ No newline at end of file diff --git a/templates/php/register.php b/templates/php/register.php new file mode 100644 index 0000000..956467a --- /dev/null +++ b/templates/php/register.php @@ -0,0 +1,46 @@ +<?php + $paths = [ + 'Login' => $_SERVER['AUTH_PATH_LOGIN'] ?? '/login', + 'Register' => $_SERVER['AUTH_PATH_REGISTER'] ?? '/register', + 'Assets' => $_SERVER['AUTH_ASSETS_PATH'] ?? '/assets', + ]; +?> +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>Register</title> + <link rel="stylesheet" href="<?php echo htmlspecialchars($paths['Assets']); ?>/css/style.css"> +</head> +<body> + <div class="container form-container"> + <h2>Create Account</h2> + <form id="register-form" action="<?php echo htmlspecialchars($paths['Register']); ?>" method="post"> + <div class="form-group"> + <label for="username">Username</label> + <input type="text" id="username" name="username" required> + </div> + <div class="form-group"> + <label for="password">Password</label> + <input type="password" id="password" name="password" required> + </div> + <div class="form-group"> + <label for="confirm_password">Confirm Password</label> + <input type="password" id="confirm_password" name="confirm_password" required> + </div> + <button type="submit" class="btn-success">Register</button> + </form> + <p class="error"> + <?php + if (!empty($_GET['error'])) { + echo htmlspecialchars($_GET['error']); + } + ?> + </p> + <div class="form-link"> + <a href="<?php echo htmlspecialchars($paths['Login']); ?>">Already have an account? Login</a> + </div> + </div> +</body> +</html>
\ No newline at end of file |
