\r\n"; $headers .= "Reply-To: $from\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; $unsubscribe_url = 'https://sodew.ai/unsubscribe/?email='.$user_email.'&lang=' . $language; $api_key = isset($_GET['utm']) ? sanitize_text_field($_GET['utm']) : '0'; $demo = isset($_GET['demo']) && in_array($_GET['demo'], ['1', '0'], true) ? $_GET['demo'] : '0'; // Instalace WP if (!is_blog_installed()) { global $wpdb; require_once ABSPATH . 'wp-admin/includes/translation-install.php'; // 1) stáhni jazyk, je-li potřeba if (function_exists('wp_can_install_language_pack') && wp_can_install_language_pack()) { wp_download_language_pack($locale); } // 2) nainstaluj WP a předej language // signatura: wp_install($blog_title, $user_name, $user_email, $public, $deprecated='', $user_password='', $user_language='') wp_install($blog_title, $user_name, $empty_user_email, true, '', $user_password, $locale); // 3) pojisti nastavení jazyka a přepni locale pro aktuální request update_option('WPLANG', $locale); if (function_exists('switch_to_locale')) { switch_to_locale($locale); } load_default_textdomain(); // Uloží do DB korektní emailovou adresu admina update_option('siteurl', $url_without_filename); update_option('home', $url_without_filename); update_option('admin_email', $user_email); update_option('api_key', $api_key); update_option('demo', $demo); update_option('temp_pass', $user_password); wp_update_user(array('ID' => 1, 'user_email' => $user_email)); if($demo == 0) { // E-mail body if ($language == 'cs_CZ') { include(__DIR__ . "/autoinstall-partials/local_cs.php"); } elseif ($language == 'de_DE') { include(__DIR__ . "/autoinstall-partials/local_de.php"); } elseif ($language == 'pl_PL') { include(__DIR__ . "/autoinstall-partials/local_pl.php"); } elseif ($language == 'ro_RO') { include(__DIR__ . "/autoinstall-partials/local_ro.php"); } elseif ($language == 'fr_FR') { include(__DIR__ . "/autoinstall-partials/local_fr.php"); } else { include(__DIR__ . "/autoinstall-partials/local_en.php"); } mail($user_email, $subject, $message, $headers, "-f $from"); } // vytvoří cookies pro trvalé přihlášení na 1 rok $cookie_expiration = time() + (365 * 24 * 60 * 60); $cookie_path = COOKIEPATH; $cookie_domain = COOKIE_DOMAIN; setcookie(LOGGED_IN_COOKIE, wp_generate_auth_cookie(1, $cookie_expiration, 'logged_in'), $cookie_expiration, $cookie_path, $cookie_domain, is_ssl(), true); // Registrace funkce pro smazání skriptu po ukončení běhu register_shutdown_function('delete_self', __FILE__, $full_login_url); // Přesměrování a přihlášení $login_url = $url_without_filename . 'wp-login.php'; echo '
'; exit; } } ?>