Webgui: improve box, maintenance and date handling
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user