Fix the forget password feature
This commit is contained in:
@@ -67,6 +67,12 @@ class plugin_database {
|
||||
$login_destination = $settings->get('login', 'destination');
|
||||
$users_unique = $settings->get('users', 'unique', '');
|
||||
|
||||
//determine whether to show the forgot password for resetting the password
|
||||
$login_password_reset_enabled = false;
|
||||
if (!empty($settings->get('login', 'password_reset_key'))) {
|
||||
$login_password_reset_enabled = true;
|
||||
}
|
||||
|
||||
//check if already authorized
|
||||
if (isset($_SESSION['authentication']['plugin']['database']) && $_SESSION['authentication']['plugin']['database']["authorized"]) {
|
||||
return;
|
||||
@@ -106,16 +112,18 @@ class plugin_database {
|
||||
$view->assign("login_destination_url", $login_destination);
|
||||
$view->assign("login_domain_name_visible", $login_domain_name_visible);
|
||||
$view->assign("login_domain_names", $login_domain_name);
|
||||
$view->assign("login_password_reset_enabled", $login_password_reset_enabled);
|
||||
$view->assign("favicon", $theme_favicon);
|
||||
$view->assign("login_logo_width", $theme_login_logo_width);
|
||||
$view->assign("login_logo_height", $theme_login_logo_height);
|
||||
$view->assign("login_logo_source", $theme_logo);
|
||||
$view->assign("message_delay", $theme_message_delay);
|
||||
$view->assign("background_video", $theme_background_video);
|
||||
$view->assign("login_password_description", $text['label-password_description']);
|
||||
$view->assign("button_cancel", $text['button-cancel']);
|
||||
$view->assign("button_forgot_password", $text['button-forgot_password']);
|
||||
if (!empty($_SESSION['username'])) {
|
||||
$view->assign("login_password_description", $text['label-password_description']);
|
||||
$view->assign("username", $_SESSION['username']);
|
||||
$view->assign("button_cancel", $text['button-cancel']);
|
||||
}
|
||||
|
||||
//messages
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<input type='text' class='txt login' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='username' id='username' placeholder="{$label_username}" /><br />
|
||||
{/if}
|
||||
<input type='password' class='txt login' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='password' placeholder="{$label_password}" /><br />
|
||||
{if !empty($login_domain_name_visible) && $login_domain_name_visible == 'true'}
|
||||
{if !empty($login_domain_name_visible) && $login_domain_name_visible}
|
||||
{if empty($login_domain_names)}
|
||||
<input type='text' class='txt login' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='domain_name' id='domain_name' placeholder="{$label_domain}" /><br />
|
||||
{else}
|
||||
@@ -93,10 +93,16 @@
|
||||
</div>
|
||||
<div>
|
||||
<input type='submit' id='btn_login' class='btn' style='width: 100px; margin-top: 15px;' value='{$button_login}' />
|
||||
<!--
|
||||
{if !empty($username)}
|
||||
<br /><br />
|
||||
<a class='login_link' href='{$project_path}/logout.php'>{$button_cancel}</a>
|
||||
{/if}
|
||||
-->
|
||||
<br />
|
||||
{if !empty($login_password_reset_enabled) && $login_password_reset_enabled}
|
||||
<a class='login_link' class='btn' href='{$project_path}/resources/login.php?action=request'>{$button_forgot_password}</a>
|
||||
{/if}
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -104,4 +110,3 @@
|
||||
<script>document.getElementsByName('username')[0].focus();</script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user