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-->
<ol class="breadcrumb">
if(file_exists('config.php')){
include("header.php");
?>
<!-- Breadcrumbs-->
<ol class="breadcrumb">
<li class="breadcrumb-item">
<a href="index.html">Dashboard</a>
</li>
<li class="breadcrumb-item active">Blank Page</li>
</ol>
</ol>
<!-- Page Content -->
<h1>Blank Page</h1>
<hr>
<p>This is a great starting point for new custom pages.</p>
<!-- Page Content -->
<h1>Blank Page</h1>
<hr>
<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
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'];
$database = $_POST['database'];
@@ -77,9 +81,9 @@ if(isset($_POST['add_database'])){
header("Location: setup.php?user");
}
}
if(isset($_POST['add_user'])){
if(isset($_POST['add_user'])){
include("config.php");
@@ -100,9 +104,9 @@ if(isset($_POST['add_user'])){
header("Location: setup.php?company");
}
}
if(isset($_POST['add_company_settings'])){
if(isset($_POST['add_company_settings'])){
include("config.php");
@@ -119,14 +123,14 @@ if(isset($_POST['add_company_settings'])){
header("Location: login.php");
}
}
?>
?>
<!DOCTYPE html>
<html lang="en">
<!DOCTYPE html>
<html lang="en">
<head>
<head>
<meta charset="utf-8">
<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="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 -->
<nav class="navbar navbar-expand navbar-dark bg-primary static-top">
@@ -447,6 +451,12 @@ if(isset($_POST['add_company_settings'])){
<!-- Custom js-->
<script src="js/app.js"></script>
</body>
</body>
</html>
</html>
<?php
}
?>