Add USB checkout system and SSO profile page
New Features: - USB Device checkout/check-in system with barcode scanning - displayusb.asp: List all USB devices with status - addusb.asp: Add new USB devices via barcode scan - checkout_usb.asp/savecheckout_usb.asp: Check out USB to SSO - checkin_usb.asp/savecheckin_usb.asp: Check in with wipe confirmation - usb_history.asp: Full checkout history with filters - api_usb.asp: JSON API for AJAX lookups - displayprofile.asp: SSO profile page showing user info and USB history - Date/time format changed to 12-hour (MM/DD/YYYY h:mm AM/PM) - SSO links in USB history now link to profile page via search Database: - New machinetypeid 44 for USB devices - New usb_checkouts table for tracking checkouts Cleanup: - Removed v2 folder (duplicate/old files) - Removed old debug/test files - Removed completed migration documentation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
<head>
|
||||
<link rel="stylesheet" href="./style.css" type="text/css">
|
||||
<!--#include file="./includes/sql.asp"-->
|
||||
<!--#include file="./includes/response.asp"-->
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@@ -26,76 +27,72 @@
|
||||
|
||||
' Validate required fields
|
||||
If vlan = "" Or ipstart = "" Or cidr = "" Or subnettypeid = "" Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Required field missing.</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Required field missing.", "addsubnet.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Validate VLAN is numeric
|
||||
If Not IsNumeric(vlan) Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: VLAN must be numeric.</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "VLAN must be numeric.", "addsubnet.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Basic IP address validation
|
||||
If Len(ipstart) < 7 Or Len(ipstart) > 15 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Invalid IP address.</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Invalid IP address.", "addsubnet.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Validate subnet type ID
|
||||
If Not IsNumeric(subnettypeid) Or CLng(subnettypeid) < 1 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Invalid subnet type.</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Invalid subnet type.", "addsubnet.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Parse CIDR value (expected format: "cidr,ipend")
|
||||
If InStr(cidr, ",") = 0 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Invalid CIDR format.</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Invalid CIDR format.", "addsubnet.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
cidrarray = Split(cidr, ",")
|
||||
If UBound(cidrarray) < 1 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Invalid CIDR format.</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Invalid CIDR format.", "addsubnet.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
ipend = Trim(cidrarray(1))
|
||||
cidr = Trim(cidrarray(0))
|
||||
|
||||
' Strip leading "/" if present (dropdown values include it)
|
||||
If Left(cidr, 1) = "/" Then
|
||||
cidr = Mid(cidr, 2)
|
||||
End If
|
||||
|
||||
' Validate CIDR is numeric
|
||||
If Not IsNumeric(cidr) Or CInt(cidr) < 0 Or CInt(cidr) > 32 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: CIDR must be between 0 and 32.</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "CIDR must be between 0 and 32.", "addsubnet.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Validate ipend is numeric
|
||||
If Not IsNumeric(ipend) Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Invalid IP end value.</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Invalid IP end value.", "addsubnet.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
' Validate description length
|
||||
If Len(description) > 500 Then
|
||||
Response.Write("<div class='alert alert-danger'>Error: Description too long.</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Description too long.", "addsubnet.asp"
|
||||
Response.End
|
||||
End If
|
||||
|
||||
@@ -115,9 +112,8 @@
|
||||
rsCheck.Close
|
||||
Set rsCheck = Nothing
|
||||
Set cmdCheck = Nothing
|
||||
Response.Write("<div class='alert alert-danger'>Error: Subnet type not found.</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
objConn.Close
|
||||
ShowError "Subnet type not found.", "addsubnet.asp"
|
||||
Response.End
|
||||
End If
|
||||
End If
|
||||
@@ -149,12 +145,13 @@
|
||||
If Err.Number = 0 Then
|
||||
Set cmdInsert = Nothing
|
||||
objConn.Close
|
||||
Response.Redirect("./displaysubnets.asp")
|
||||
ShowSuccess "Subnet added successfully.", "displaysubnets.asp", "subnets"
|
||||
Else
|
||||
Response.Write("<div class='alert alert-danger'>Error: " & Server.HTMLEncode(Err.Description) & "</div>")
|
||||
Response.Write("<a href='addsubnet.asp'>Go back</a>")
|
||||
Dim insertErr
|
||||
insertErr = Err.Description
|
||||
Set cmdInsert = Nothing
|
||||
objConn.Close
|
||||
ShowError "Error: " & Server.HTMLEncode(insertErr), "addsubnet.asp"
|
||||
End If
|
||||
%>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user