|
20 | 20 | * |
21 | 21 | * index.php |
22 | 22 | * |
23 | | - * Bugzilla PHP Wrapper description of the file. |
| 23 | + * Bugzilla PHP Wrapper. |
24 | 24 | * |
25 | 25 | * @author Daniele Bonini <my25mb@aol.com> |
26 | 26 | * @copyrights (c) 2016, 2024, 5 Mode |
27 | 27 | */ |
28 | 28 |
|
| 29 | + // Variables and constants |
| 30 | + define('BZ_WR_TIMEZONE', "Europe/Rome"); |
| 31 | + define('BZ_WR_WEBSERVER', "nginx"); |
| 32 | + define('BZ_WR_COOKIE_PATH', "/"); |
| 33 | + define('BZ_WR_COOKIE_DOMAIN', "bugs.5mode.com"); |
| 34 | + |
29 | 35 | // SCRIPT_NAME |
30 | 36 | $f = filter_input(INPUT_GET, 'perl_script'); |
31 | 37 | if ($f === "" || $f === "/") { |
|
52 | 58 |
|
53 | 59 | // SERVER VARIABLES |
54 | 60 | putenv("QUERY_STRING=$s"); |
55 | | - putenv("local_timezone=Europe/Rome"); |
56 | | - putenv("SERVER_SOFTWARE=nginx"); |
| 61 | + putenv("local_timezone=".BZ_WR_TIMEZONE); |
| 62 | + putenv("SERVER_SOFTWARE=".BZ_WR_WEBSERVER); |
57 | 63 | putenv("SERVER_NAME=" . $_SERVER['SERVER_NAME']); |
58 | 64 | putenv("REQUEST_METHOD=" . $_SERVER['REQUEST_METHOD']); |
59 | | - //putenv("REMOTE_ADDR=".$_SERVER['REMOTE_ADDR']); |
| 65 | + putenv("REMOTE_ADDR=" . $_SERVER['REMOTE_ADDR']); |
60 | 66 | // Rebuilding the rest of $_SERVER variables environment.. |
61 | 67 | $serverEnvs = $_SERVER; |
62 | 68 | foreach($serverEnvs as $key=>$val) { |
63 | | - if (($key !== "QUERY_STRING") && ($key !== "SERVER_SOFTWARE") && ($key !== "SERVER_NAME") && ($key !== "REQUEST_METHOD")) { |
| 69 | + if (($key !== "QUERY_STRING") && ($key !== "SERVER_SOFTWARE") && ($key !== "SERVER_NAME") && ($key !== "REQUEST_METHOD") && ($key !== "REMOTE_ADDR")) { |
64 | 70 | putenv("$key=".$val); |
65 | 71 | } |
66 | 72 | } |
|
101 | 107 | // Parsing for the UserID on the Cookie request |
102 | 108 | $userID = explode("=", explode(";", $row)[0])[1]; |
103 | 109 | // Creating the login cookie.. |
104 | | - setcookie("Bugzilla_login", $userID, time() + 999999999, "/", "bugs.5mode.com", true, true); |
| 110 | + setcookie("Bugzilla_login", $userID, time() + 999999999, BZ_WR_COOKIE_PATH, BZ_WR_COOKIE_DOMAIN, true, true); |
105 | 111 | } else { |
106 | 112 | if ((mb_strpos($row, "--------- =") === false) && (mb_strpos($row, "WARNING:") === false)) { |
107 | 113 | header($row); |
|
0 commit comments