From 4da0be2cd8d64d8b90d131a78c9b63c3b6f25020 Mon Sep 17 00:00:00 2001 From: Alex <40072887+alexdcrane@users.noreply.github.com> Date: Tue, 17 Mar 2026 17:14:45 +0000 Subject: [PATCH] Add remember me to email and TOTP authentication methods (#7795) * Update totp.php * Update email.php * Update username.htm --- core/authentication/resources/classes/plugins/email.php | 8 +++++++- core/authentication/resources/classes/plugins/totp.php | 8 +++++++- core/authentication/resources/views/username.htm | 6 ++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/core/authentication/resources/classes/plugins/email.php b/core/authentication/resources/classes/plugins/email.php index dd118295f..b92049977 100644 --- a/core/authentication/resources/classes/plugins/email.php +++ b/core/authentication/resources/classes/plugins/email.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2025 + Portions created by the Initial Developer are Copyright (C) 2008-2026 the Initial Developer. All Rights Reserved. Contributor(s): @@ -78,6 +78,7 @@ class plugin_email { $theme_background_video = (isset($background_videos) && is_array($background_videos)) ? $background_videos[0] : null; //$login_domain_name_visible = $settings->get('login', 'domain_name_visible'); //$login_domain_name = $settings->get('login', 'domain_name'); + $login_remember_me = $settings->get('login', 'remember_me', true); $login_destination = $settings->get('login', 'destination'); $users_unique = $settings->get('users', 'unique', ''); @@ -90,6 +91,9 @@ class plugin_email { $_POST['username'] = $_SESSION['username']; $_REQUEST['username'] = $_SESSION['username']; } + if (isset($_POST["remember"])) { + $_SESSION['remember'] = $_POST["remember"]; + } //request the username if (!isset($_POST['username']) && !isset($_POST['authentication_code'])) { @@ -114,6 +118,8 @@ class plugin_email { $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("login_remember_me", $login_remember_me); + $view->assign("label_remember_me", $text['label-remember_me']); $view->assign("button_login", $text['button-login']); $view->assign("message_delay", $theme_message_delay); $view->assign("background_video", $theme_background_video); diff --git a/core/authentication/resources/classes/plugins/totp.php b/core/authentication/resources/classes/plugins/totp.php index 8490a7248..30856cf9b 100644 --- a/core/authentication/resources/classes/plugins/totp.php +++ b/core/authentication/resources/classes/plugins/totp.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2008-2024 + Portions created by the Initial Developer are Copyright (C) 2008-2026 the Initial Developer. All Rights Reserved. Contributor(s): @@ -83,6 +83,7 @@ class plugin_totp { $theme_background_video = (isset($background_videos) && is_array($background_videos)) ? $background_videos[0] : null; //$login_domain_name_visible = $settings->get('login', 'domain_name_visible'); //$login_domain_name = $settings->get('login', 'domain_name'); + $login_remember_me = $settings->get('login', 'remember_me', true); $login_destination = $settings->get('login', 'destination'); $users_unique = $settings->get('users', 'unique', ''); @@ -94,6 +95,9 @@ class plugin_totp { $this->username = $_POST['username']; $_SESSION["username"] = $this->username; } + if (isset($_POST["remember"])) { + $_SESSION['remember'] = $_POST["remember"]; + } //request the username if (!$this->username && !isset($_POST['authentication_code'])) { @@ -126,6 +130,8 @@ class plugin_totp { $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("login_remember_me", $login_remember_me); + $view->assign("label_remember_me", $text['label-remember_me']); $view->assign("button_login", $text['button-login']); $view->assign("favicon", $theme_favicon); $view->assign("message_delay", $theme_message_delay); diff --git a/core/authentication/resources/views/username.htm b/core/authentication/resources/views/username.htm index e040a3f5e..4547cec60 100644 --- a/core/authentication/resources/views/username.htm +++ b/core/authentication/resources/views/username.htm @@ -73,6 +73,12 @@

+ {if !empty($login_remember_me)} + + {/if}