If config.php exists redirect setup.php to login.php, if login doesn't exist redirect index.php to setup.php

This commit is contained in:
johnny@pittpc.com
2019-07-20 16:45:00 -04:00
parent 8ca2b833e6
commit 6f58034928
2 changed files with 424 additions and 402 deletions
+21 -9
View File
@@ -1,16 +1,28 @@
<?php include("header.php"); ?> <?php
<!-- Breadcrumbs--> if(file_exists('config.php')){
<ol class="breadcrumb"> include("header.php");
?>
<!-- Breadcrumbs-->
<ol class="breadcrumb">
<li class="breadcrumb-item"> <li class="breadcrumb-item">
<a href="index.html">Dashboard</a> <a href="index.html">Dashboard</a>
</li> </li>
<li class="breadcrumb-item active">Blank Page</li> <li class="breadcrumb-item active">Blank Page</li>
</ol> </ol>
<!-- Page Content --> <!-- Page Content -->
<h1>Blank Page</h1> <h1>Blank Page</h1>
<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 include("footer.php"); ?> <?php
include("footer.php");
}else{
header("Location: setup.php");
}
?>
+25 -15
View File
@@ -1,8 +1,12 @@
<?php <?php
include("functions.php"); if(file_exists('config.php')){
header("Location: login.php");
}else{
if(isset($_POST['add_database'])){ include("functions.php");
if(isset($_POST['add_database'])){
$host = $_POST['host']; $host = $_POST['host'];
$database = $_POST['database']; $database = $_POST['database'];
@@ -77,9 +81,9 @@ if(isset($_POST['add_database'])){
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");
@@ -100,9 +104,9 @@ if(isset($_POST['add_user'])){
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");
@@ -119,14 +123,14 @@ if(isset($_POST['add_company_settings'])){
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">
@@ -146,9 +150,9 @@ if(isset($_POST['add_company_settings'])){
<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">
@@ -447,6 +451,12 @@ if(isset($_POST['add_company_settings'])){
<!-- Custom js--> <!-- Custom js-->
<script src="js/app.js"></script> <script src="js/app.js"></script>
</body> </body>
</html> </html>
<?php
}
?>