Webgui: improve box, maintenance and date handling

This commit is contained in:
thooge committed 2026-09-16 06:12:50 +02:00
1 parent a76848e1da
commit 9b45fd3700
10 files changed
+116 -31

No files matched your search

+14
View File
@@ -8,6 +8,20 @@
*/
function db_get_setting($sno, $default=NULL) {
// TODO WIP
global $pdo;
$sql = "SELECT valint, valstr FROM settings WHERE userid=0 AND sno=?";
$sth = $pdo->prepare($sql);
try {
$sth->execute([$sno]);
} catch (Exception $e) {
return $default;
}
$row = $sth->fetchOne();
return $row;
}
function db_lock_acquire($table, $key, $userid) {
global $pdo;
$token = bin2hex(random_bytes(8));