From 842868340f95f8da1675f56b2de9b49605c8c0ca Mon Sep 17 00:00:00 2001 From: Michiel Dethmers Date: Fri, 12 Apr 2024 18:13:36 +0100 Subject: [PATCH] avoid the admin being kicked out after upgrade (#1033) --- public_html/lists/admin/upgrade.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public_html/lists/admin/upgrade.php b/public_html/lists/admin/upgrade.php index 26ae20cde..981f21213 100644 --- a/public_html/lists/admin/upgrade.php +++ b/public_html/lists/admin/upgrade.php @@ -337,6 +337,10 @@ function output($message) if (!Sql_Table_exists($GLOBALS['tables']['admin_login'])) { cl_output(s('Creating new table "admin_login"')); createTable('admin_login'); + ## add an entry for current admin to avoid being kicked out + Sql_Query(sprintf('insert into %s (moment,adminid,remote_ip4,remote_ip6,sessionid,active) + values(%d,%d,"%s","%s","%s",1)', + $GLOBALS['tables']['admin_login'],time(),$_SESSION['logindetails']['id'],$_SESSION['adminloggedin'],"",session_id())); } if (version_compare($dbversion, '3.6.15', '<')) { // Ensure timestamp field does not have null values then give explicit defaults