From acb6c19c70ae95ea6287f2546a2e85a111724d2b Mon Sep 17 00:00:00 2001 From: root Date: Thu, 15 Aug 2019 22:34:44 -0400 Subject: [PATCH] MySQL DB dump for addition of enable_cron --- db.sql | 3 ++- setup.php | 51 ++++++++++++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/db.sql b/db.sql index e71302e9..1b73230e 100644 --- a/db.sql +++ b/db.sql @@ -621,6 +621,7 @@ CREATE TABLE `settings` ( `config_invoice_overdue_reminders` varchar(200) DEFAULT NULL, `config_quote_next_number` int(11) DEFAULT NULL, `config_quote_prefix` varchar(200) DEFAULT NULL, + `config_enable_cron` int(1) NOT NULL, PRIMARY KEY (`company_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; @@ -804,4 +805,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2019-08-14 11:11:26 +-- Dump completed on 2019-08-15 22:34:10 diff --git a/setup.php b/setup.php index f76c2140..45854a31 100644 --- a/setup.php +++ b/setup.php @@ -43,19 +43,19 @@ if(isset($_POST['add_database'])){ $lines = file($filename); // Loop through each line foreach ($lines as $line){ - // Skip it if it's a comment - if(substr($line, 0, 2) == '--' || $line == '') - continue; + // Skip it if it's a comment + if(substr($line, 0, 2) == '--' || $line == '') + continue; - // Add this line to the current segment - $templine .= $line; - // If it has a semicolon at the end, it's the end of the query - if(substr(trim($line), -1, 1) == ';'){ - // Perform the query - mysqli_query($mysqli,$templine); - // Reset temp variable to empty - $templine = ''; - } + // Add this line to the current segment + $templine .= $line; + // If it has a semicolon at the end, it's the end of the query + if(substr(trim($line), -1, 1) == ';'){ + // Perform the query + mysqli_query($mysqli,$templine); + // Reset temp variable to empty + $templine = ''; + } } $_SESSION['alert_message'] = "Database successfully added"; @@ -68,23 +68,24 @@ if(isset($_POST['add_user'])){ include("config.php"); - $name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])); - $email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])); - $password = md5(mysqli_real_escape_string($mysqli,$_POST['password'])); + $name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name'])); + $email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email'])); + $password = md5(mysqli_real_escape_string($mysqli,$_POST['password'])); - if($_FILES['file']['tmp_name']!='') { - $path = "uploads/users/"; - $path = $path . time() . basename( $_FILES['file']['name']); - $file_name = basename($path); - move_uploaded_file($_FILES['file']['tmp_name'], $path); - } + if($_FILES['file']['tmp_name']!='') { + $path = "uploads/users/"; + $path = $path . time() . basename( $_FILES['file']['name']); + $file_name = basename($path); + move_uploaded_file($_FILES['file']['tmp_name'], $path); + } - mysqli_query($mysqli,"INSERT INTO users SET name = '$name', email = '$email', password = '$password', avatar = '$path', created_at = NOW()"); - $user_id = mysqli_insert_id($mysqli); + mysqli_query($mysqli,"INSERT INTO users SET name = '$name', email = '$email', password = '$password', avatar = '$path', created_at = NOW()"); + + $user_id = mysqli_insert_id($mysqli); - $_SESSION['alert_message'] = "User added"; + $_SESSION['alert_message'] = "User added"; - header("Location: setup.php?company"); + header("Location: setup.php?company"); }