Centralize credentials and make migration idempotent
- Move all DB credentials to config.asp with DSN/ODBC toggle - Add Zabbix API URL and token to centralized config - Update sql.asp, api.asp, apiusb.asp, zabbix.asp to use config - Add GetConnectionString() and GetEmployeeConnectionString() functions - Make migration SQL idempotent (safe to run multiple times) - Add duplicate index cleanup (appname_2) to migration - Document employee DB access limitation in CLAUDE.md 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ Option Explicit
|
||||
<head>
|
||||
<!--#include file="./includes/header.asp"-->
|
||||
<!--#include file="./includes/wjf_employees-sql.asp"-->
|
||||
<!-- Note: config.asp is included via wjf_employees-sql.asp -->
|
||||
<!-- DataTables CSS -->
|
||||
<link rel="stylesheet" href="assets/plugins/datatables/dataTables.bootstrap4.min.css">
|
||||
</head>
|
||||
@@ -280,15 +281,13 @@ END IF
|
||||
<div class="tab-pane" id="usbhistory">
|
||||
<h5 class="mb-3"><i class="zmdi zmdi-usb"></i> USB Checkout History</h5>
|
||||
<%
|
||||
' Connect to shopdb for USB history
|
||||
' Connect to shopdb for USB history (uses centralized config)
|
||||
Dim objConnShopdb, shopdbAvailable
|
||||
shopdbAvailable = False
|
||||
|
||||
On Error Resume Next
|
||||
Set objConnShopdb = Server.CreateObject("ADODB.Connection")
|
||||
objConnShopdb.ConnectionString = "Driver={MySQL ODBC 9.4 Unicode Driver};" & _
|
||||
"Server=192.168.122.1;Port=3306;Database=shopdb;" & _
|
||||
"User=570005354;Password=570005354;Option=3;"
|
||||
objConnShopdb.ConnectionString = GetConnectionString()
|
||||
objConnShopdb.Open
|
||||
If Err.Number = 0 Then
|
||||
shopdbAvailable = True
|
||||
|
||||
Reference in New Issue
Block a user