[], 'active' => user_session_current('session_id'), 'amount' => user_session_count(user_session_current('user_id')), 'offset' => max(0, intval($_GET['sessions']['offset'] ?? 0)), 'take' => clamp($_GET['sessions']['take'] ?? 15, 5, 30), ]; $logins = [ 'list' => [], 'amount' => user_login_attempts_count(user_session_current('user_id')), 'offset' => max(0, intval($_GET['logins']['offset'] ?? 0)), 'take' => clamp($_GET['logins']['take'] ?? 15, 5, 30), ]; $logs = [ 'list' => [], 'amount' => audit_log_count(user_session_current('user_id')), 'offset' => max(0, intval($_GET['logs']['offset'] ?? 0)), 'take' => clamp($_GET['logs']['take'] ?? 15, 5, 30), 'strings' => [ 'PERSONAL_EMAIL_CHANGE' => 'Changed e-mail address to %s.', 'PERSONAL_PASSWORD_CHANGE' => 'Changed account password.', 'PERSONAL_SESSION_DESTROY' => 'Ended session #%d.', 'PERSONAL_SESSION_DESTROY_ALL' => 'Ended all personal sessions.', 'PASSWORD_RESET' => 'Successfully used the password reset form to change password.', 'CHANGELOG_ENTRY_CREATE' => 'Created a new changelog entry #%d.', 'CHANGELOG_ENTRY_EDIT' => 'Edited changelog entry #%d.', 'CHANGELOG_TAG_ADD' => 'Added tag #%2$d to changelog entry #%1$d.', 'CHANGELOG_TAG_REMOVE' => 'Removed tag #%2$d from changelog entry #%1$d.', 'CHANGELOG_TAG_CREATE' => 'Created new changelog tag #%d.', 'CHANGELOG_TAG_EDIT' => 'Edited changelog tag #%d.', 'CHANGELOG_ACTION_CREATE' => 'Created new changelog action #%d.', 'CHANGELOG_ACTION_EDIT' => 'Edited changelog action #%d.', ], ]; $sessions['list'] = user_session_list($sessions['offset'], $sessions['take'], user_session_current('user_id')); $logins['list'] = user_login_attempts_list($sessions['offset'], $sessions['take'], user_session_current('user_id')); $logs['list'] = audit_log_list($logs['offset'], $logs['take'], user_session_current('user_id')); if (empty($errors)) { $errors[] = 'A few of the elements on this page have been moved to the on-profile editor. To find them, go to your profile and hit the "Edit Profile" button below your avatar.'; } echo tpl_render('user.settings', [ 'errors' => $errors, 'disable_account_options' => $disableAccountOptions, 'current_email' => $currentEmail, 'sessions' => $sessions, 'logins' => $logins, 'logs' => $logs, ]);