HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //home/ezdns-setup-simple.php
<?php
/**
 * ezDNS.support - HostBill Simple Setup
 * 
 * Vereinfachte Version, die nur die absolut notwendigen Konfigurationen vornimmt
 */

echo "=== ezDNS.support HostBill Simple Setup ===\n";
echo "Verbindung zur Datenbank wird hergestellt...\n";

try {
    // Datenbankverbindung herstellen
    $pdo = new PDO(
        "mysql:host=localhost;dbname=suppo_db;port=3306",
        'suppo_db',
        'Mat36k4WS84Su9Fw61',
        [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]
    );
    
    echo "✅ Datenbankverbindung erfolgreich!\n";
    
    $brandId = 26; // ezdns.support Brand ID
    $successCount = 0;
    
    // Funktion für SQL-Execution
    function executeSQL($pdo, $description, $sql, $params = []) {
        global $successCount;
        echo "\n--- $description ---\n";
        try {
            $stmt = $pdo->prepare($sql);
            $stmt->execute($params);
            echo "✅ Erfolgreich\n";
            $successCount++;
            return true;
        } catch (PDOException $e) {
            echo "❌ Fehler: " . $e->getMessage() . "\n";
            return false;
        }
    }
    
    // SCHRITT 1: Brand aktualisieren
    echo "\n========================================\n";
    echo "SCHRITT 1: Brand-Konfiguration\n";
    echo "========================================\n";
    
    $brandSettings = json_encode([
        'theme' => 'default',
        'language' => 'de',
        'currency' => 'EUR',
        'timezone' => 'Europe/Berlin'
    ]);
    
    executeSQL($pdo, "Brand-Update", 
        "UPDATE hb_brands SET url = ?, active = 1, custom = ? WHERE brand_id = ?",
        ['https://ezdns.support', $brandSettings, $brandId]
    );
    
    // SCHRITT 2: Produkte erstellen
    echo "\n========================================\n";
    echo "SCHRITT 2: Produkte erstellen\n";
    echo "========================================\n";
    
    // Erst DNS Services Kategorie prüfen
    $stmt = $pdo->query("SELECT id FROM hb_categories WHERE name = 'DNS Services'");
    if ($stmt->rowCount() > 0) {
        echo "DNS Services Kategorie bereits vorhanden\n";
        $catId = $stmt->fetchColumn();
    } else {
        echo "Erstelle DNS Services Kategorie...\n";
        executeSQL($pdo, "Kategorie-erstellen",
            "INSERT INTO hb_categories (parent_id, contains, module, name, description, visible, sort_order, ctype) VALUES (0, 'categories', 0, 'DNS Services', 'DNS-Prüfungen und Monitoring-Services', 1, 100, 'services')"
        );
        $catId = $pdo->lastInsertId();
    }
    
    // Produkte erstellen
    $products = [
        [
            'name' => 'DNS Check Free',
            'code' => 'dns-free',
            'description' => 'Grundlegender DNS-Check für eine Domain. Beinhaltet 1x Scan/Monat, Delegation Check, DNSSEC Check.'
        ],
        [
            'name' => 'DNS Check Pro',
            'code' => 'dns-pro',
            'description' => 'Umfassender DNS-Check mit Reports und Benachrichtigungen. Unbegrenzte Scans, alle Checks, PDF/CSV Export.'
        ],
        [
            'name' => 'DNS Check Business',
            'code' => 'dns-business',
            'description' => 'Multi-Domain DNS-Monitoring für bis zu 10 Domains. White-Label Reports, Priority Support.'
        ],
        [
            'name' => 'DNS Check Agency',
            'code' => 'dns-agency',
            'description' => 'Reseller-Programm mit unbegrenzten Domains. Custom Branding, API High-Limits.'
        ]
    ];
    
    foreach ($products as $product) {
        echo "\nVerarbeite Produkt: {$product['name']}\n";
        
        // Prüfen ob Produkt bereits existiert
        $stmt = $pdo->prepare("SELECT id FROM hb_products WHERE code = ?");
        $stmt->execute([$product['code']]);
        $existing = $stmt->fetch(PDO::FETCH_ASSOC);
        
        if ($existing) {
            echo "Produkt bereits vorhanden (ID: {$existing['id']})\n";
        } else {
            echo "Erstelle neues Produkt...\n";
            executeSQL($pdo, "Produkt-Erstellung: {$product['name']}",
                "INSERT INTO hb_products (type, code, category_id, name, description, visible, sort_order) VALUES (2, ?, ?, ?, ?, 1, ?)",
                [$product['code'], $catId, $product['name'], $product['description'], array_search($product, array_column($products, 'name')) + 1]
            );
            
            $productId = $pdo->lastInsertId();
            echo "Produkt erstellt (ID: {$productId})\n";
        }
    }
    
    // Zusammenfassung
    echo "\n========================================\n";
    echo "ZUSAMMENFASSUNG\n";
    echo "========================================\n";
    echo "✅ Erfolgreiche Operationen: $successCount\n";
    echo "\nKonfigurierte Elemente:\n";
    echo "✅ Brand: ezdns.support (ID: $brandId)\n";
    echo "✅ Produkte: " . count($products) . " (Free, Pro, Business, Agency)\n";
    
    echo "\n========================================\n";
    echo "NÄCHSTE SCHRITTE\n";
    echo "========================================\n";
    echo "1. HostBill Admin prüfen:\n";
    echo "   https://support.panomity.com/padm/?cmd=products\n";
    echo "\n2. Produkte konfigurieren:\n";
    echo "   - Pricing für jedes Produkt einrichten\n";
    echo "   - Features in metadata definieren\n";
    echo "   - Payment Gateways zuweisen\n";
    echo "\n3. Support Department erstellen:\n";
    echo "   https://support.panomity.com/padm/?cmd=supportdepartments\n";
    echo "\n4. API Keys generieren:\n";
    echo "   https://support.panomity.com/padm/?cmd=apikeys\n";
    echo "\n5. Payment Gateways einrichten:\n";
    echo "   Stripe konfigurieren\n";
    echo "   PayPal konfigurieren\n";
    
    // Summary-Datei
    $summary = "=== ezDNS.support Setup Summary ===\n" .
                 "Datum: " . date('d.m.Y H:i:s') . "\n" .
                 "\n" .
                 "Konfigurierte Elemente:\n" .
                 "- Brand ID: $brandId\n" .
                 "- Brand URL: https://ezdns.support\n" .
                 "- Produkte: 4 (Free, Pro, Business, Agency)\n" .
                 "\n" .
                 "Nächste Schritte:\n" .
                 "1. HostBill Admin - Produkte prüfen und Pricing einrichten\n" .
                 "2. Support Department erstellen\n" .
                 "3. API Keys generieren\n" .
                 "4. Payment Gateways konfigurieren\n" .
                 "5. Frontend integrieren\n";
    
    file_put_contents('/home/ezdns-setup-simple-summary.txt', $summary);
    echo "\n📋 Summary gespeichert: /home/ezdns-setup-simple-summary.txt\n";
    
    echo "\n=== SETUP ERFOLGREICH ABGESCHLOSSEN ===\n";

} catch (PDOException $e) {
    echo "\n❌ Datenbank-Fehler: " . $e->getMessage() . "\n";
    exit(1);
} catch (Exception $e) {
    echo "\n❌ Allgemeiner Fehler: " . $e->getMessage() . "\n";
    exit(1);
}
?>