Check to see if config.php exists in header.php else redirect to setup.php, removed the else conditions as they were unessessary

This commit is contained in:
johnny@pittpc.com
2019-07-20 16:51:18 -04:00
parent 6f58034928
commit aa274ed5da
3 changed files with 428 additions and 442 deletions

View File

@@ -1,5 +1,9 @@
<?php <?php
if(!file_exists('config.php')){
header("Location: setup.php");
}
include("config.php"); include("config.php");
include("check_login.php"); include("check_login.php");
include("vendor/Parsedown.php"); include("vendor/Parsedown.php");

View File

@@ -1,9 +1,4 @@
<?php <?php include("header.php"); ?>
if(file_exists('config.php')){
include("header.php");
?>
<!-- Breadcrumbs--> <!-- Breadcrumbs-->
<ol class="breadcrumb"> <ol class="breadcrumb">
@@ -18,11 +13,4 @@ if(file_exists('config.php')){
<hr> <hr>
<p>This is a great starting point for new custom pages.</p> <p>This is a great starting point for new custom pages.</p>
<?php <?php include("footer.php"); ?>
include("footer.php");
}else{
header("Location: setup.php");
}
?>

View File

@@ -2,11 +2,11 @@
if(file_exists('config.php')){ if(file_exists('config.php')){
header("Location: login.php"); header("Location: login.php");
}else{ }
include("functions.php"); include("functions.php");
if(isset($_POST['add_database'])){ if(isset($_POST['add_database'])){
$host = $_POST['host']; $host = $_POST['host'];
$database = $_POST['database']; $database = $_POST['database'];
@@ -81,9 +81,9 @@ if(file_exists('config.php')){
header("Location: setup.php?user"); header("Location: setup.php?user");
} }
if(isset($_POST['add_user'])){ if(isset($_POST['add_user'])){
include("config.php"); include("config.php");
@@ -104,9 +104,9 @@ if(file_exists('config.php')){
header("Location: setup.php?company"); header("Location: setup.php?company");
} }
if(isset($_POST['add_company_settings'])){ if(isset($_POST['add_company_settings'])){
include("config.php"); include("config.php");
@@ -123,14 +123,14 @@ if(file_exists('config.php')){
header("Location: login.php"); header("Location: login.php");
} }
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
@@ -150,9 +150,9 @@ if(file_exists('config.php')){
<link href="css/style.css" rel="stylesheet"> <link href="css/style.css" rel="stylesheet">
<link href="vendor/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet" type="text/css"> <link href="vendor/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet" type="text/css">
</head> </head>
<body id="page-top"> <body id="page-top">
<!-- Top Nav --> <!-- Top Nav -->
<nav class="navbar navbar-expand navbar-dark bg-primary static-top"> <nav class="navbar navbar-expand navbar-dark bg-primary static-top">
@@ -451,12 +451,6 @@ if(file_exists('config.php')){
<!-- Custom js--> <!-- Custom js-->
<script src="js/app.js"></script> <script src="js/app.js"></script>
</body> </body>
</html> </html>
<?php
}
?>