mirror of
https://github.com/myronblair/novacpx
synced 2026-06-30 17:50:41 -05:00
Fix multiple user panel 500 errors
- domains: VhostManager::create() called with array instead of 4 params - PHPManager: VhostManager not required; pool writes use sudo tee (permission); updateConfig creates pool if missing instead of throwing - DatabaseManager: MySQL ops used SQLite panel PDO; add dedicated mysqlPdo() using MariaDB socket auth - BackupManager: column name is size_mb not size; diskUsage returns float - DB.php: add LAST_INSERT_ID() → last_insert_rowid() translation - user.js: SSL issue/submit used Nova.api (JSON) but endpoint streams SSE; add _sslStream() helper matching admin panel behavior - schema/migration: add enc_password column to email_accounts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,13 +41,7 @@ match ($action) {
|
||||
@mkdir($docRoot, 0755, true);
|
||||
file_put_contents("$docRoot/index.html", "<html><body><h1>$domain is ready!</h1><p>Upload your website files.</p></body></html>");
|
||||
|
||||
VhostManager::create([
|
||||
'domain' => $domain,
|
||||
'username' => $acct['username'],
|
||||
'home_dir' => $acct['home_dir'],
|
||||
'doc_root' => $docRoot,
|
||||
'php_ver' => $acct['php_version'] ?? PHP_DEFAULT,
|
||||
]);
|
||||
VhostManager::create($acct['username'], $domain, $docRoot, $acct['php_version'] ?? PHP_DEFAULT);
|
||||
DNSManager::createZone($accountId, $domain);
|
||||
audit('domains.add-addon', $domain);
|
||||
Response::success(null, "Addon domain $domain added");
|
||||
@@ -67,13 +61,7 @@ match ($action) {
|
||||
"INSERT INTO domains (account_id, domain, type, document_root, created_at) VALUES (?,?,?,?,NOW())",
|
||||
[$accountId, $full, 'subdomain', $docRoot]
|
||||
);
|
||||
VhostManager::create([
|
||||
'domain' => $full,
|
||||
'username' => $acct['username'],
|
||||
'home_dir' => $acct['home_dir'],
|
||||
'doc_root' => $docRoot,
|
||||
'php_ver' => $acct['php_version'] ?? PHP_DEFAULT,
|
||||
]);
|
||||
VhostManager::create($acct['username'], $full, $docRoot, $acct['php_version'] ?? PHP_DEFAULT);
|
||||
$zone = DB::getInstance()->fetchOne("SELECT id FROM dns_zones WHERE domain = ? AND account_id = ?", [$parent, $accountId]);
|
||||
if ($zone) DNSManager::addRecord((int)$zone['id'], $sub, 'A', gethostbyname(gethostname()));
|
||||
audit('domains.add-subdomain', $full);
|
||||
@@ -89,13 +77,7 @@ match ($action) {
|
||||
"INSERT INTO domains (account_id, domain, type, document_root, created_at) VALUES (?,?,?,?,NOW())",
|
||||
[$accountId, $alias, 'alias', $acct['home_dir'] . '/public_html']
|
||||
);
|
||||
VhostManager::create([
|
||||
'domain' => $alias,
|
||||
'username' => $acct['username'],
|
||||
'home_dir' => $acct['home_dir'],
|
||||
'doc_root' => $acct['home_dir'] . '/public_html',
|
||||
'php_ver' => $acct['php_version'] ?? PHP_DEFAULT,
|
||||
]);
|
||||
VhostManager::create($acct['username'], $alias, $acct['home_dir'] . '/public_html', $acct['php_version'] ?? PHP_DEFAULT);
|
||||
DNSManager::createZone($accountId, $alias);
|
||||
audit('domains.add-alias', $alias);
|
||||
Response::success(null, "Domain alias $alias added");
|
||||
|
||||
Reference in New Issue
Block a user