Removed old API Key from Settings api.php now uses api_keys and a key is no longer generated upon setup, Also autogen an API key upon creation.

This commit is contained in:
johnnyq
2022-02-04 15:59:51 -05:00
parent b58696f079
commit b1d09e6b56
7 changed files with 8 additions and 53 deletions

View File

@@ -485,7 +485,6 @@ if(isset($_POST['add_company_settings'])){
$company_id = mysqli_insert_id($mysqli);
$config_base_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']);
$config_api_key = keygen();
mkdir_missing("uploads/clients/$company_id");
file_put_contents("uploads/clients/$company_id/index.php", "");
@@ -541,7 +540,7 @@ if(isset($_POST['add_company_settings'])){
//Set User Company Permissions
mysqli_query($mysqli,"INSERT INTO user_companies SET user_id = $user_id, company_id = $company_id");
mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_recurring_prefix = 'REC-', config_recurring_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 1, config_enable_cron = 0, config_ticket_next_number = 1, config_base_url = '$config_base_url'");
mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_recurring_prefix = 'REC-', config_recurring_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 1, config_enable_cron = 0, config_ticket_next_number = 1, config_base_url = '$config_base_url'");
//Create Some Data