Try to keep user logged in when active on site.

This commit is contained in:
Retro_Guy 2024-12-20 09:53:42 -07:00
parent 825548a87b
commit f2efe13bb5
2 changed files with 16 additions and 0 deletions

View File

@ -9,6 +9,7 @@ include($rootdir . 'common/config.inc.php');
global $OVERRIDES;
$CONFIG = include $config_file;
$keys = unserialize(file_get_contents($keyfile));
$menulist = get_section_menu_array();
$linklist = file($config_dir . "links.conf", FILE_IGNORE_NEW_LINES);
@ -109,6 +110,20 @@ if (file_exists($config_dir . '/' . $config_name . '-motd.txt')) {
}
echo '<table class="np_header_button_bar"><tr>';
if (isset($_COOKIE['mail_name'])) {
$name = strtolower($_COOKIE['mail_name']);
$logged_in = verify_logged_in(trim(strtolower($name)));
if($logged_in) {
set_user_logged_in_cookies($_COOKIE['mail_name'], $keys);
// echo '<td>';
// echo 'MYGROUPS';
// echo '</td>';
} else {
// echo '<td>' . $name . '</td?';
}
}
foreach ($menulist as $menu) {
$menuitem = explode(':', $menu);
if ($menuitem[1] == '0') {

View File

@ -38,6 +38,7 @@ if (! isset($_SESSION['last_access']) || (time() - $_SESSION['last_access']) > 6
$_SESSION['last_access'] = time();
}
$keys = unserialize(file_get_contents($keyfile));
$logfile = $logdir . '/post.log';
@$fieldnamedecrypt = $_REQUEST['fielddecrypt'];