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:
18
api.asp
18
api.asp
@@ -1,21 +1,13 @@
|
||||
<%@ Language=VBScript %>
|
||||
<!--#include file="includes/config.asp"-->
|
||||
<%
|
||||
' ============================================================================
|
||||
' DATABASE CONNECTION - Created directly in api.asp to avoid scoping issues
|
||||
' DATABASE CONNECTION - Uses centralized config.asp
|
||||
' ============================================================================
|
||||
Dim objConn, rs, DB_CONN_STRING
|
||||
' Use direct MySQL ODBC driver connection (same as sql.asp) instead of DSN
|
||||
DB_CONN_STRING = "Driver={MySQL ODBC 9.4 Unicode Driver};" & _
|
||||
"Server=192.168.122.1;" & _
|
||||
"Port=3306;" & _
|
||||
"Database=shopdb;" & _
|
||||
"User=570005354;" & _
|
||||
"Password=570005354;" & _
|
||||
"Option=3;" & _
|
||||
"Pooling=True;Max Pool Size=100;"
|
||||
Session.Timeout = 15
|
||||
Dim objConn, rs
|
||||
Session.Timeout = APP_SESSION_TIMEOUT
|
||||
Set objConn = Server.CreateObject("ADODB.Connection")
|
||||
objConn.ConnectionString = DB_CONN_STRING
|
||||
objConn.ConnectionString = GetConnectionString()
|
||||
objConn.Open
|
||||
Set rs = Server.CreateObject("ADODB.Recordset")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user