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-final-setup.php
<?php
/**
 * ezDNS.support - HostBill Final Setup
 * 
 * Ein pragmatisches Setup-Skript, das nur das absolut Notwendige konfiguriert
 */

echo "=== ezDNS.support HostBill Final 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
    $brandName = 'ezdns.support';
    $successCount = 0;
    $errorCount = 0;
    
    // Funktion für SQL-Execution
    function executeSQL($pdo, $description, $sql, $params = []) {
        global $successCount, $errorCount;
        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";
            $errorCount++;
            return false;
        }
    }
    
    // SCHRITT 1: Brand aktualisieren
    echo "\n========================================\n";
    echo "SCHRITT 1: Brand-Konfiguration\n";
    echo "========================================\n";
    
    executeSQL($pdo, "Brand-Update", 
        "UPDATE hb_brands SET url = ?, active = 1 WHERE brand_id = ?",
        ['https://ezdns.support', $brandId]
    );
    
    // Brand Custom Settings (JSON)
    $brandSettings = json_encode([
        'theme' => 'default',
        'language' => 'de',
        'currency' => 'EUR',
        'timezone' => 'Europe/Berlin',
        'date_format' => 'dd.mm.YYYY'
    ]);
    
    executeSQL($pdo, "Brand-Custom-Settings",
        "UPDATE hb_brands SET custom = ? WHERE brand_id = ?",
        [$brandSettings, $brandId]
    );
    
    echo "✅ Brand 'ezdns.support' (ID: $brandId) aktualisiert\n";
    
    // SCHRITT 2: DNS Services Kategorie erstellen/aktualisieren
    echo "\n========================================\n";
    echo "SCHRITT 2: DNS Services Kategorie\n";
    echo "========================================\n";
    
    // Prüfen ob Kategorie existiert
    $stmt = $pdo->prepare("SELECT id FROM hb_categories WHERE name = ? AND contains = 'categories'");
    $stmt->execute(['DNS Services']);
    $existing = $stmt->fetch(PDO::FETCH_ASSOC);
    
    if ($existing) {
        echo "✅ Kategorie 'DNS Services' bereits vorhanden (ID: {$existing['id']})\n";
        $catId = $existing['id'];
    } else {
        $sql = "INSERT INTO hb_categories (parent_id, contains, module, name, description, visible, sort_order, ctype) 
                 VALUES (0, 'categories', 0, ?, ?, 1, 100, 'services')";
        
        executeSQL($pdo, "Kategorie-erstellen",
            $sql,
            ['DNS Services', 'DNS-Prüfungen und Monitoring-Services']
        );
        
        $catId = $pdo->lastInsertId();
    }
    
    // SCHRITT 3: Produkte erstellen/aktualisieren
    echo "\n========================================\n";
    echo "SCHRITT 3: Produkte erstellen\n";
    echo "========================================\n";
    
    $products = [
        [
            'name' => 'DNS Check Free',
            'code' => 'dns-free',
            'type' => 2, // Hosting type
            'category_id' => $catId,
            'description' => 'Grundlegender DNS-Check für eine Domain mit basis Analytik',
            'metadata' => json_encode([
                'scans_per_month' => 1,
                'delegation_check' => true,
                'dnssec_check' => true,
                'mail_security_check' => false,
                'performance_check' => false,
                'pdf_export' => false,
                'csv_export' => false,
                'email_notifications' => false,
                'historical_data' => false,
                'api_access' => false
            ])
        ],
        [
            'name' => 'DNS Check Pro',
            'code' => 'dns-pro',
            'type' => 2,
            'category_id' => $catId,
            'description' => 'Umfassender DNS-Check mit Reports und Benachrichtigungen',
            'metadata' => json_encode([
                'scans_per_month' => -1,
                'delegation_check' => true,
                'dnssec_check' => true,
                'mail_security_check' => true,
                'performance_check' => true,
                'pdf_export' => true,
                'csv_export' => true,
                'email_notifications' => true,
                'historical_data' => true,
                'api_access' => true
            ])
        ],
        [
            'name' => 'DNS Check Business',
            'code' => 'dns-business',
            'type' => 2,
            'category_id' => $catId,
            'description' => 'Multi-Domain DNS-Monitoring mit erweiterten Features',
            'metadata' => json_encode([
                'scans_per_month' => -1,
                'max_domains' => 10,
                'delegation_check' => true,
                'dnssec_check' => true,
                'mail_security_check' => true,
                'performance_check' => true,
                'pdf_export' => true,
                'csv_export' => true,
                'email_notifications' => true,
                'historical_data' => true,
                'api_access' => true,
                'white_label_reports' => true,
                'priority_support' => true,
                'team_users' => 5,
                'webhook_notifications' => true,
                'extended_api_limits' => true
            ])
        ],
        [
            'name' => 'DNS Check Agency',
            'code' => 'dns-agency',
            'type' => 2,
            'category_id' => $catId,
            'description' => 'Reseller-Programm für DNS-Services mit vollem Support',
            'metadata' => json_encode([
                'scans_per_month' => -1,
                'max_domains' => -1,
                'delegation_check' => true,
                'dnssec_check' => true,
                'mail_security_check' => true,
                'performance_check' => true,
                'pdf_export' => true,
                'csv_export' => true,
                'email_notifications' => true,
                'historical_data' => true,
                'api_access' => true,
                'white_label_reports' => true,
                'priority_support' => true,
                'team_users' => -1,
                'webhook_notifications' => true,
                'extended_api_limits' => true,
                'custom_branding' => true,
                'reseller_pricing' => true,
                'dedicated_account_manager' => true,
                'support_24_7' => true,
                'affiliate_access' => true
            ])
        ]
    ];
    
    foreach ($products as $product) {
        // 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 "\nProdukt '{$product['name']}' bereits vorhanden (ID: {$existing['id']})\n";
            
            // Produkt aktualisieren
            $sql = "UPDATE hb_products SET 
                type = ?, category_id = ?, name = ?, description = ?, 
                metadata = ?, visible = 1
                WHERE id = ?";
            
            executeSQL($pdo, "Produkt-Update: {$product['name']}",
                $sql,
                [
                    $product['type'],
                    $product['category_id'],
                    $product['name'],
                    $product['description'],
                    $product['metadata'],
                    $existing['id']
                ]
            );
        } else {
            echo "\nErstelle Produkt '{$product['name']}'...\n";
            
            // Produkt erstellen
            $sql = "INSERT INTO hb_products (
                type, code, category_id, name, description, metadata, visible, sort_order
            ) VALUES (?, ?, ?, ?, ?, 1, ?)";
            
            executeSQL($pdo, "Produkt-Erstellung: {$product['name']}",
                $sql,
                [
                    $product['type'],
                    $product['code'],
                    $product['category_id'],
                    $product['name'],
                    $product['description'],
                    $product['metadata'],
                    count($products) // sort_order basierend auf Anzahl
                ]
            );
            
            $productId = $pdo->lastInsertId();
            echo "✅ Produkt erstellt (ID: {$productId})\n";
            
            // Pricing einrichten (soweit Tabelle existiert)
            $productPricing = [
                ['code' => 'dns-free', 'price' => 0.00, 'setup' => 0.00],
                ['code' => 'dns-pro', 'price' => 9.00, 'setup' => 0.00],
                ['code' => 'dns-business', 'price' => 29.00, 'setup' => 0.00],
                ['code' => 'dns-agency', 'price' => 99.00, 'setup' => 0.00]
            ];
            
            // Pricing für dieses Produkt finden
            foreach ($productPricing as $pricing) {
                if ($pricing['code'] === $product['code']) {
                    // Prüfen ob Pricing-Tabelle existiert
                    $pricingTables = ['hb_products_pricing', 'hb_product_pricing', 'hb_pricing'];
                    $pricingTableExists = false;
                    
                    foreach ($pricingTables as $table) {
                        $checkSql = $pdo->query("SHOW TABLES LIKE '$table'");
                        if ($checkSql->rowCount() > 0) {
                            $pricingTableExists = true;
                            break;
                        }
                    }
                    
                    if ($pricingTableExists) {
                        $billingCycle = $pricing['price'] > 0 ? 'm' : 'free';
                        
                        $pricingSql = "INSERT INTO $pricingTable (
                            product_id, billing_cycle, price, setup
                        ) VALUES (?, ?, ?, ?)";
                        
                        executeSQL($pdo, "Pricing-Erstellung: {$pricing['code']}",
                            $pricingSql,
                            [$productId, $billingCycle, $pricing['price'], $pricing['setup']]
                        );
                    } else {
                        echo "⚠️  Pricing-Tabelle nicht gefunden - überspringe Pricing für {$pricing['code']}\n";
                    }
                    break;
                }
            }
        }
    }
    
    // Zusammenfassung
    echo "\n========================================\n";
    echo "ZUSAMMENFASSUNG\n";
    echo "========================================\n";
    echo "✅ Erfolgreiche Operationen: $successCount\n";
    echo "❌ Fehlgeschlagene Operationen: $errorCount\n";
    echo "\nKonfigurierte Elemente:\n";
    echo "- Brand: ezdns.support (ID: $brandId)\n";
    echo "- Kategorie: DNS Services (ID: $catId)\n";
    echo "- Produkte: 4 (Free, Pro, Business, Agency)\n";
    echo "\nNächste Schritte:\n";
    echo "1. HostBill Admin prüfen: https://support.panomity.com/padm/?cmd=products\n";
    echo "2. Payment Gateways einrichten (Stripe, PayPal)\n";
    echo "3. Support Department erstellen (falls noch nicht vorhanden)\n";
    echo "4. API Keys generieren\n";
    echo "5. Frontend-Integration von ezdns.support starten\n";
    
    // Summary-Datei erstellen
    $summary = "=== ezDNS.support HostBill Setup Summary ===\n" .
                 "Datum: " . date('d.m.Y H:i:s') . "\n" .
                 "\n" .
                 "KONFIGURIERTE ELEMENTE:\n" .
                 "=========================\n" .
                 "\n" .
                 "1. Brand: ezdns.support\n" .
                 "   - ID: $brandId\n" .
                 "   - URL: https://ezdns.support\n" .
                 "   - Theme: default\n" .
                 "   - Sprache: de, EUR\n" .
                 "   - Zeitzone: Europe/Berlin\n" .
                 "\n" .
                 "2. Kategorie: DNS Services\n" .
                 "   - ID: $catId\n" .
                 "   - Typ: Hosting\n" .
                 "\n" .
                 "3. Produkte:\n" .
                 "   a) DNS Check Free\n" .
                 "      - Code: dns-free\n" .
                 "      - Preis: €0.00 (once)\n" .
                 "      - Features: 1x Scan, Delegation, DNSSEC\n" .
                 "\n" .
                 "   b) DNS Check Pro\n" .
                 "      - Code: dns-pro\n" .
                 "      - Preis: €9.00/Monat\n" .
                 "      - Features: Unbegrenzte Scans, alle Checks, PDF/CSV Export\n" .
                 "\n" .
                 "   c) DNS Check Business\n" .
                 "      - Code: dns-business\n" .
                 "      - Preis: €29.00/Monat\n" .
                 "      - Features: Bis zu 10 Domains, White-Label, Priority-Support\n" .
                 "\n" .
                 "   d) DNS Check Agency\n" .
                 "      - Code: dns-agency\n" .
                 "      - Preis: €99.00/Monat\n" .
                 "      - Features: Unbegrenzte Domains, Reseller, Custom-Branding\n" .
                 "\n" .
                 "NÄCHSTE SCHRITTE:\n" .
                 "===================\n" .
                 "1. HostBill Admin öffnen und Produkte prüfen\n" .
                 "2. Payment Gateways konfigurieren (Stripe, PayPal)\n" .
                 "3. Support Department erstellen (DNS Support)\n" .
                 "4. API Keys generieren für ezdns.support\n" .
                 "5. Frontend-Integration implementieren\n" .
                 "6. Test-Services erstellen und DNS-Scans durchführen\n";
    
    file_put_contents('/home/ezdns-setup-final-summary.txt', $summary);
    echo "\n📋 Summary gespeichert: /home/ezdns-setup-final-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);
}
?>