Skip to content

Commit

Permalink
2.11.18 Preparing for mandatory logins
Browse files Browse the repository at this point in the history
  • Loading branch information
webpwnized committed Sep 29, 2024
1 parent 52618af commit ea60f77
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
* Check if user wants to disregard any detected
* database errors
* ----------------------------------------------------
* user is logged out by default
*/
if (!isset($_SESSION["UserOKWithDatabaseFailure"])) {
$_SESSION["UserOKWithDatabaseFailure"] = "FALSE";
Expand All @@ -106,7 +105,8 @@
* provide an example to developers of proper coding techniques.
*/
switch ($_SESSION["security-level"]){
case "0": // This code is insecure
default: // Add a default case. This code is insecure
case "0": // This code is insecure
case "1": // This code is insecure
$lProtectCookies = false;
break;
Expand Down Expand Up @@ -142,11 +142,7 @@
if (!isset($_SESSION["showhints"]) || ($_SESSION["showhints"] != $l_showhints)){
// make session = cookie
$_SESSION["showhints"] = $l_showhints;
switch ($l_showhints){
case 0: $_SESSION["hints-enabled"] = "Disabled"; break;
case 1: $_SESSION["hints-enabled"] = "Enabled"; break;
default: $_SESSION["hints-enabled"] = "Enabled"; break;
}// end switch
$_SESSION["hints-enabled"] = ($l_showhints === 0) ? "Disabled" : "Enabled";
}//end if

/* ------------------------------------------
Expand Down Expand Up @@ -202,7 +198,7 @@ function handleException(){
$RequiredSoftwareHandler = new RequiredSoftwareHandler($_SESSION["security-level"]);

/* ------------------------------------------
* PROCESS REQUESTS
* PROCESS REQUESTS (IF ANY)
* ------------------------------------------ */
if (isset($_GET["do"])){
include_once(__SITE_ROOT__.'/includes/process-commands.php');
Expand All @@ -219,6 +215,7 @@ function handleException(){
* REACT TO CLIENT SIDE CHANGES
* ------------------------------------------ */
switch ($_SESSION["security-level"]){
default: // Add a default case. This code is insecure
case "0": // This code is insecure
case "1": // This code is insecure
/* Use the clients authorization token which is stored in
Expand Down Expand Up @@ -291,6 +288,7 @@ function handleException(){
* Security Headers (Modern Browsers)
* ------------------------------------------ */
switch ($_SESSION["security-level"]){
default: // Add a default case. This code is insecure
case "0": // This code is insecure
case "1":
/* Built-in user-agent defenses */
Expand Down Expand Up @@ -362,6 +360,7 @@ function handleException(){
global $lPage;
$lPage = __SITE_ROOT__.'/home.php';
switch ($_SESSION["security-level"]){
default: // Add a default case. This code is insecure
case "0": // This code is insecure
case "1": // This code is insecure
// Get the value of the "page" URL query parameter
Expand Down Expand Up @@ -422,6 +421,7 @@ function handleException(){
case ".htpasswd.php":

switch ($_SESSION["security-level"]){
default: // Add a default case. This code is insecure
case "0": // This code is insecure
case "1": // This code is insecure
$lPage=__SITE_ROOT__.'/phpinfo.php';
Expand Down Expand Up @@ -492,11 +492,11 @@ function handleException(){
/* ------------------------------------------
* BEGIN OUTPUT RESPONSE
* ------------------------------------------ */
require_once (__SITE_ROOT__."/includes/header.php");
require_once __SITE_ROOT__."/includes/header.php";

if (strlen($lPage)==0 || !isset($lPage)){
/* Default Page */
require_once(__SITE_ROOT__."/home.php");
require_once __SITE_ROOT__."/home.php";
}else{
/* All Other Pages */
if (file_exists($lPage) || $RemoteFileHandler->remoteSiteIsReachable($lPage)){
Expand All @@ -505,18 +505,18 @@ function handleException(){
if(!$RemoteFileHandler->curlIsInstalled()){
echo $RemoteFileHandler->getNoCurlAdviceBasedOnOperatingSystem();
}//end if
require_once (__SITE_ROOT__."/page-not-found.php");
require_once __SITE_ROOT__."/page-not-found.php";
}//end if

}// end if page variable not set

require_once (__SITE_ROOT__."/includes/information-disclosure-comment.php");
require_once (__SITE_ROOT__."/includes/footer.php");
require_once __SITE_ROOT__."/includes/information-disclosure-comment.php";
require_once __SITE_ROOT__."/includes/footer.php";

/* ------------------------------------------
* LOG USER VISIT TO PAGE
* ------------------------------------------ */
include_once (__SITE_ROOT__."/includes/log-visit.php");
include_once __SITE_ROOT__."/includes/log-visit.php";

/* ------------------------------------------
* CLOSE DATABASE CONNECTION
Expand Down

0 comments on commit ea60f77

Please sign in to comment.