Fix fatal error: logAudit function doesn't exist

- Renamed logAudit calls to logAction (the actual function name)
- Removed system event logging calls that used invalid action types
  (audit_log ENUM only accepts INSERT/UPDATE/DELETE)
- Fixes WebDAV backup success response not being returned

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Purple
2026-01-18 14:09:15 +00:00
parent 59c26d8b54
commit 6cb7f70546

View File

@@ -1835,14 +1835,6 @@ function handleDatabaseImport($db) {
}
}
// Log the import action
logAudit($db, null, 'database_import', null, [
'entries_imported' => $importedEntries,
'settings_imported' => $importedSettings,
'logos_imported' => $importedLogos,
'backup_date' => $backup['backup_info']['created_at'] ?? 'unknown'
]);
$db->commit();
jsonResponse([
@@ -2238,12 +2230,6 @@ function handleSchemaApply($db) {
}
}
// Log the schema update
logAudit($db, null, 'schema_update', null, [
'applied' => $applied,
'failed' => $failed
]);
// Build results array for frontend
$results = [];
foreach ($applied as $item) {
@@ -2446,8 +2432,6 @@ function handleErrorLogsClear($db) {
fclose($fp);
// Log the action
logAudit($db, null, 'error_log_cleared', null, ['log_path' => $logPath]);
jsonResponse([
'success' => true,
'message' => 'Error log cleared successfully',
@@ -3857,16 +3841,11 @@ function handleBackupImport($db) {
$db->commit();
// Log the import
logAudit($db, null, 'backup_import', null, [
'entries_imported' => count($backup['entries'] ?? []),
'logos_imported' => count($backup['logos'] ?? [])
]);
jsonResponse([
'success' => true,
'message' => 'Backup imported successfully',
'entries_imported' => count($backup['entries'] ?? [])
'entries_imported' => count($backup['entries'] ?? []),
'logos_imported' => count($backup['logos'] ?? [])
]);
} catch (Exception $e) {
@@ -4041,13 +4020,6 @@ function handleWebDAVBackup($db) {
// HTTP 201 Created or 204 No Content are success for WebDAV PUT
if ($httpCode >= 200 && $httpCode < 300) {
// Log the backup
logAudit($db, null, 'webdav_backup', null, [
'filename' => $filename,
'server' => $serverUrl,
'entries' => count($backup['entries'])
]);
jsonResponse([
'success' => true,
'message' => 'Backup uploaded successfully',