Skip to content

Commit

Permalink
Migrate login form to a form builder form
Browse files Browse the repository at this point in the history
  • Loading branch information
BurntimeX committed Dec 7, 2024
1 parent 9ec543e commit 9af3a0a
Show file tree
Hide file tree
Showing 5 changed files with 146 additions and 236 deletions.
63 changes: 1 addition & 62 deletions com.woltlab.wcf/templates/login.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,6 @@
<woltlab-core-notice type="info">{lang}wcf.user.login.forceLogin{/lang}</woltlab-core-notice>
{/if}

{if !$errorField|empty && $errorField == 'cookie'}
<woltlab-core-notice type="error">{lang}wcf.user.login.error.cookieRequired{/lang}</woltlab-core-notice>
{else}
{include file='shared_formError'}
{/if}

<form id="loginForm" method="post" action="{$loginController}">
<dl{if $errorField == 'username'} class="formError"{/if}>
<dt>
<label for="username">{lang}wcf.user.usernameOrEmail{/lang}</label> <span class="formFieldRequired">*</span>
</dt>
<dd>
<input type="text" id="username" name="username" value="{$username}" required autofocus class="long" autocomplete="username">
{if $errorField == 'username'}
<small class="innerError">
{if $errorType == 'empty'}
{lang}wcf.global.form.error.empty{/lang}
{else}
{lang}wcf.user.username.error.{@$errorType}{/lang}
{/if}
</small>
{/if}
</dd>
</dl>

<dl{if $errorField == 'password'} class="formError"{/if}>
<dt>
<label for="password">{lang}wcf.user.password{/lang}</label> <span class="formFieldRequired">*</span>
</dt>
<dd>
<input type="password" id="password" name="password" value="{$password}" required class="long" autocomplete="current-password">
{if $errorField == 'password'}
<small class="innerError">
{if $errorType == 'empty'}
{lang}wcf.global.form.error.empty{/lang}
{else}
{lang}wcf.user.password.error.{@$errorType}{/lang}
{/if}
</small>
{/if}
{if $__userAuthConfig->canChangePassword}
<small><a href="{link controller='LostPassword'}{/link}">{lang}wcf.user.lostPassword{/lang}</a></small>
{/if}
</dd>
</dl>

{event name='fields'}

{include file='shared_captcha' supportsAsyncCaptcha=true}

<div class="formSubmit">
<input type="submit" value="{lang}wcf.user.button.login{/lang}" accesskey="s">
{csrfToken}
</div>

{include file='thirdPartySsoButtons'}
</form>

<p class="formFieldRequiredNotice">
<span class="formFieldRequired">*</span>
{lang}wcf.global.form.required{/lang}
</p>
{unsafe:$form->getHtml()}

{include file='authFlowFooter'}
56 changes: 1 addition & 55 deletions wcfsetup/install/files/acp/templates/login.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,60 +6,6 @@
</div>
</header>

{if !$errorField|empty && $errorField == 'cookie'}
<woltlab-core-notice type="error">{lang}wcf.user.login.error.cookieRequired{/lang}</woltlab-core-notice>
{else}
{include file='shared_formError'}
{/if}

<form id="loginForm" method="post" action="{$loginController}">
<dl{if $errorField == 'username'} class="formError"{/if}>
<dt>
<label for="username">{lang}wcf.user.usernameOrEmail{/lang}</label> <span class="formFieldRequired">*</span>
</dt>
<dd>
<input type="text" id="username" name="username" value="{$username}" required autofocus class="long" autocomplete="username">
{if $errorField == 'username'}
<small class="innerError">
{if $errorType == 'empty'}
{lang}wcf.global.form.error.empty{/lang}
{else}
{lang}wcf.user.username.error.{@$errorType}{/lang}
{/if}
</small>
{/if}
</dd>
</dl>

<dl{if $errorField == 'password'} class="formError"{/if}>
<dt>
<label for="password">{lang}wcf.user.password{/lang}</label> <span class="formFieldRequired">*</span>
</dt>
<dd>
<input type="password" id="password" name="password" value="{$password}" required class="long" autocomplete="current-password">
{if $errorField == 'password'}
<small class="innerError">
{if $errorType == 'empty'}
{lang}wcf.global.form.error.empty{/lang}
{else}
{lang}wcf.user.password.error.{@$errorType}{/lang}
{/if}
</small>
{/if}
</dd>
</dl>

{include file='shared_captcha' supportsAsyncCaptcha=true}

<div class="formSubmit">
<input type="submit" value="{lang}wcf.user.button.login{/lang}" accesskey="s">
{csrfToken}
</div>
</form>

<p class="formFieldRequiredNotice">
<span class="formFieldRequired">*</span>
{lang}wcf.global.form.required{/lang}
</p>
{unsafe:$form->getHtml()}

{include file='footer'}
Loading

0 comments on commit 9af3a0a

Please sign in to comment.