ユーザープロフィール機能の追加

This commit is contained in:
2025-12-12 00:50:11 +09:00
parent 4085b77f6a
commit 72f3f5d39b
5 changed files with 112 additions and 6 deletions

View File

@@ -144,4 +144,37 @@ class User {
throw new \Exception($e->getMessage());
}
}
public function profile(array $params): void {
if (!AUTH_ENABLED) return;
$name = '';
if (isset($params['name'])) $name = $params['name'];
if ($name === '') {
header('Location: /');
exit();
}
try {
$auth = new Auth;
$user = $auth->getLoggedInUser();
$u = $auth->getUser($name);
$tmpl = new Template('/');
$pagetit = 'サインイン';
$description = 'サイトにサインイン';
$tmpl->assign('pagetit', $pagetit);
$tmpl->assign('curPage', 'auth');
$tmpl->assign('custCss', false);
$tmpl->assign('menu', $this->getMenu());
$tmpl->assign('description', $description);
$tmpl->assign('error', $error);
$tmpl->assign('user', $user);
$tmpl->assign('u', $u);
$tmpl->render('profile');
} catch (\Exception $e) {
throw new \Exception($e->getMessage());
}
}
}