Skip to content

Commit bfa788e

Browse files
authored
Merge pull request #6337 from WoltLab/6.2-login-lost-password
Add lost password link to login form
2 parents b9b5e98 + 34626f7 commit bfa788e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

wcfsetup/install/files/lib/acp/form/LoginForm.class.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use wcf\event\user\authentication\UserLoggedIn;
1010
use wcf\form\AbstractForm;
1111
use wcf\form\AbstractFormBuilderForm;
12+
use wcf\form\LostPasswordForm;
1213
use wcf\system\event\EventHandler;
1314
use wcf\system\exception\NamedUserException;
1415
use wcf\system\exception\UserInputException;
@@ -19,6 +20,7 @@
1920
use wcf\system\form\builder\field\validation\FormFieldValidator;
2021
use wcf\system\request\LinkHandler;
2122
use wcf\system\request\RequestHandler;
23+
use wcf\system\user\authentication\configuration\UserAuthenticationConfigurationFactory;
2224
use wcf\system\user\authentication\DefaultUserAuthentication;
2325
use wcf\system\user\authentication\EmailUserAuthentication;
2426
use wcf\system\user\authentication\LoginRedirect;
@@ -56,6 +58,14 @@ protected function createForm()
5658
->maximumLength(255),
5759
PasswordFormField::create('password')
5860
->label('wcf.user.password')
61+
->description(
62+
UserAuthenticationConfigurationFactory::getInstance()->getConfigration()->canChangePassword
63+
? \sprintf(
64+
'<a href="%s">%s</a>',
65+
StringUtil::encodeHTML(LinkHandler::getInstance()->getControllerLink(LostPasswordForm::class)),
66+
WCF::getLanguage()->getDynamicVariable('wcf.user.lostPassword')
67+
) : null
68+
)
5969
->required()
6070
->passwordStrengthMeter(false)
6171
->removeFieldClass('medium')

0 commit comments

Comments
 (0)