ユーザー

This commit is contained in:
2025-12-07 20:23:29 +09:00
parent 4f70e6d4e4
commit d5428d7514
11 changed files with 476 additions and 2 deletions

View File

@@ -56,6 +56,18 @@
<a class="{{ $m['class'] }}{{ $curPage == $m['page'] ? ' active' : '' }}" href="{{ $m['href'] }}">{{ $m['text'] }}</a>
{@ endif @}
{@ endforeach @}
{@ if (AUTH_ENABLED) @}
<div>
{@ if (isset($user) && isset($user->id) && $user->id > 0) @}
お帰りなしゃ~い、{{ $user->displayname ?? $user->username }}さん! (<a href="/logout">ログアウト</a>)
{@ else @}
<a href="/login">ログイン</a>
{@ if (AUTH_REGISTER_ENABLED) @}
| <a href="/register">登録</a>
{@ endif @}
{@ endif @}
</div>
{@ endif @}
</nav>
</header>
<main>

37
view/login.maron Normal file
View File

@@ -0,0 +1,37 @@
{@ include(common/header) @}
<h1 class="paragraph">ログイン</h1>
<p class="paragraph">
ログインして下さい。
</p>
{@ if ($error) @}
<p>
<div class="errormes">
{{ $error }}
</div>
</p>
{@ endif @}
<p>
<form action="/login" method="POST">
{$ $username = randstr() $}
{$ $password = randstr() $}
<table>
<tbody>
<tr>
<td><label for="{{ $username }}">ユーザー名:</label></td>
<td><input type="text" id="{{ $username }}" name="{{ $username }}" /></td>
</tr>
<tr>
<td><label for="{{ $password }}">パスワード:</label></td>
<td><input type="password" id="{{ $password }}" name="{{ $password }}" /></td>
</tr>
<tr>
<td></td>
<td><button>サインイン</button></td>
</tr>
</tbody>
</table>
</form>
</p>
{@ include(common/footer) @}