mirror of
https://github.com/myronblair/novacpx
synced 2026-06-30 17:50:41 -05:00
Run panel on dedicated novacpx-web Nginx service; fix auth/transaction methods
- deploy/nginx-panel.conf: standalone Nginx config for ports 8880-8883
- deploy/novacpx-web.service: systemd unit, survives apache2/nginx stop
- server_setup.php: fix Auth::requireRole() -> require('admin')
- DB.php: add beginTransaction()/commit()/rollback() methods
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
$db = DB::getInstance();
|
||||
$body = json_decode(file_get_contents('php://input'), true) ?? [];
|
||||
Auth::getInstance()->requireRole(['admin']);
|
||||
Auth::getInstance()->require('admin');
|
||||
|
||||
function getSetting(string $key, $db): ?string {
|
||||
return $db->fetchOne("SELECT value FROM settings WHERE `key` = ?", [$key])['value'] ?? null;
|
||||
|
||||
@@ -117,5 +117,9 @@ class DB {
|
||||
return $this->pdo->lastInsertId();
|
||||
}
|
||||
|
||||
public function beginTransaction(): void { $this->pdo->beginTransaction(); }
|
||||
public function commit(): void { $this->pdo->commit(); }
|
||||
public function rollback(): void { if ($this->pdo->inTransaction()) $this->pdo->rollBack(); }
|
||||
|
||||
public function pdo(): PDO { return $this->pdo; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user