1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-06-27 00:51:24 +02:00

[Web] Fix init db on fresh installations

This commit is contained in:
André
2018-09-10 16:23:08 +02:00
parent ce604232e2
commit a5488d4ba6
3 changed files with 44 additions and 37 deletions

View File

@ -64,17 +64,23 @@ function logger($_data = false) {
$user = 'unauthenticated';
$role = 'unauthenticated';
}
$stmt = $pdo->prepare("INSERT INTO `logs` (`type`, `task`, `msg`, `call`, `user`, `role`, `remote`, `time`) VALUES
(:type, :task, :msg, :call, :user, :role, :remote, UNIX_TIMESTAMP())");
$stmt->execute(array(
':type' => $type,
':task' => $task,
':call' => $call,
':msg' => $msg,
':user' => $user,
':role' => $role,
':remote' => get_remote_ip()
));
// We cannot log when logs is missing...
try {
$stmt = $pdo->prepare("INSERT INTO `logs` (`type`, `task`, `msg`, `call`, `user`, `role`, `remote`, `time`) VALUES
(:type, :task, :msg, :call, :user, :role, :remote, UNIX_TIMESTAMP())");
$stmt->execute(array(
':type' => $type,
':task' => $task,
':call' => $call,
':msg' => $msg,
':user' => $user,
':role' => $role,
':remote' => get_remote_ip()
));
}
catch (Exception $e) {
// Do nothing
}
}
}
else {