Skip to content

Commit 8428683

Browse files
authored
avoid the admin being kicked out after upgrade (#1033)
1 parent 4262a2c commit 8428683

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

public_html/lists/admin/upgrade.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ function output($message)
337337
if (!Sql_Table_exists($GLOBALS['tables']['admin_login'])) {
338338
cl_output(s('Creating new table "admin_login"'));
339339
createTable('admin_login');
340+
## add an entry for current admin to avoid being kicked out
341+
Sql_Query(sprintf('insert into %s (moment,adminid,remote_ip4,remote_ip6,sessionid,active)
342+
values(%d,%d,"%s","%s","%s",1)',
343+
$GLOBALS['tables']['admin_login'],time(),$_SESSION['logindetails']['id'],$_SESSION['adminloggedin'],"",session_id()));
340344
}
341345
if (version_compare($dbversion, '3.6.15', '<')) {
342346
// Ensure timestamp field does not have null values then give explicit defaults

0 commit comments

Comments
 (0)