Skip to content

Commit 39f617b

Browse files
committed
Refactor: Remove unused is_https_request function and related comments; clean up test_login function by removing unnecessary password list
1 parent c4c966f commit 39f617b

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

front/index.php

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -87,32 +87,6 @@ function login_user(): void {
8787
session_regenerate_id(true);
8888
}
8989

90-
function is_https_request(): bool {
91-
92-
// Direct HTTPS detection
93-
if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') {
94-
return true;
95-
}
96-
97-
// Standard port check
98-
if (!empty($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) {
99-
return true;
100-
}
101-
102-
// Trusted proxy headers (only valid if behind a trusted reverse proxy)
103-
if (!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
104-
strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https') {
105-
return true;
106-
}
107-
108-
if (!empty($_SERVER['HTTP_X_FORWARDED_SSL']) &&
109-
strtolower($_SERVER['HTTP_X_FORWARDED_SSL']) === 'on') {
110-
return true;
111-
}
112-
113-
return false;
114-
}
115-
11690

11791
function logout_user(): void {
11892
$_SESSION = [];

test/ui/test_ui_login.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ def get_login_password():
3232
# SHA256 hash of "password" - the default test password (from index.php)
3333
DEFAULT_PASSWORD_HASH = '8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92'
3434

35-
# List of passwords to try in order
36-
passwords_to_try = ["123456", "password", "test", "admin"]
3735

3836
# Try common config file locations
3937
config_paths = [

0 commit comments

Comments
 (0)