ユーザープロフィール機能の追加
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user