mirror of
https://github.com/itflow-org/itflow
synced 2026-11-21 11:57:25 +00:00
Users: an API or service account keeps its role for API keys but is left out of agent lists, pickers, notifications and admin alerts, cannot sign in, and has its own API accounts tab on Admin Users; database 3.8.1 adds users.user_service_account; 26.11.9 changelog entries
This commit is contained in:
@@ -6,7 +6,7 @@ $session_user_id = intval($_SESSION['user_id']);
|
||||
|
||||
$sql = mysqli_query(
|
||||
$mysqli,
|
||||
"SELECT role_is_admin, role_name, user_archived_at, user_avatar, user_config_force_mfa,
|
||||
"SELECT role_is_admin, role_name, user_archived_at, user_avatar, user_config_force_mfa," . (serviceAccountsReady() ? ' user_service_account,' : '') . "
|
||||
user_config_records_per_page, user_config_theme_dark, user_email, user_name, user_role_id,
|
||||
user_password, user_status, user_token, user_type FROM users
|
||||
LEFT JOIN user_settings ON users.user_id = user_settings.user_id
|
||||
@@ -56,6 +56,13 @@ if ($session_user_archived_at !== null) {
|
||||
redirect("/login.php");
|
||||
}
|
||||
|
||||
// An API / service account is only for API keys to act as - it doesn't sign in (functions/service_account.php)
|
||||
if (!empty($row['user_service_account'])) {
|
||||
session_unset();
|
||||
session_destroy();
|
||||
redirect("/login.php");
|
||||
}
|
||||
|
||||
// Check the password hasn't changed since this session signed in - by them elsewhere,
|
||||
// an admin, or the incident-response reset (userSessionStamp())
|
||||
if (!hash_equals($session_stamp_current, (string) ($_SESSION['user_session_stamp'] ?? ''))) {
|
||||
|
||||
Reference in New Issue
Block a user