getBooleanSetting($mysqli, "notifyUpdates"); $emailSubscription_status = $db->getBooleanSetting($mysqli, "subscribe_email"); $telegramSubscription_status = $db->getBooleanSetting($mysqli, "subscribe_telegram"); $tg_bot_api_token = $db->getSetting($mysqli, "tg_bot_api_token"); $tg_bot_username = $db->getSetting($mysqli, "tg_bot_username"); $php_mailer_status = $db->getBooleanSetting($mysqli, "php_mailer"); $php_mailer_smtp_status = $db->getBooleanSetting($mysqli, "php_mailer_smtp"); $php_mailer_secure_status = $db->getBooleanSetting($mysqli, "php_mailer_secure"); $php_mailer_path = $db->getSetting($mysqli, "php_mailer_path"); $php_mailer_host = $db->getSetting($mysqli, "php_mailer_host"); $php_mailer_port = $db->getSetting($mysqli, "php_mailer_port"); $php_mailer_user = $db->getSetting($mysqli, "php_mailer_user"); $php_mailer_pass = $db->getSetting($mysqli, "php_mailer_pass"); $cron_server_ip = $db->getSetting($mysqli, "cron_server_ip"); $google_rechaptcha_status = $db->getBooleanSetting($mysqli, "google_recaptcha"); $google_recaptcha_sitekey = $db->getSetting($mysqli, "google_recaptcha_sitekey"); $google_recaptcha_secret = $db->getSetting($mysqli, "google_recaptcha_secret"); $db->getSetting($mysqli, ""); $set_post = false; if(!empty($_POST)){ $db->updateSetting($mysqli, "notifyUpdates", getToggle($_POST["nu_toggle"])); $db->updateSetting($mysqli, "name",htmlspecialchars($_POST["sitename"], ENT_QUOTES)); $db->updateSetting($mysqli, "subscribe_email", getToggle($_POST["email_subscription_toggle"])); $db->updateSetting($mysqli, "subscribe_telegram", getToggle($_POST["telegram_subscription_toggle"])); $db->updateSetting($mysqli, "tg_bot_api_token", htmlspecialchars($_POST["tg_bot_api_token"], ENT_QUOTES)); $db->updateSetting($mysqli, "tg_bot_username", htmlspecialchars($_POST["tg_bot_username"], ENT_QUOTES)); $db->updateSetting($mysqli, "php_mailer", getToggle($_POST["php_mailer_toggle"])); $db->updateSetting($mysqli, "php_mailer_smtp", getToggle($_POST["php_mailer_smtp_toggle"])); $db->updateSetting($mysqli, "php_mailer_secure", getToggle($_POST["php_mailer_secure_toggle"])); $db->updateSetting($mysqli, "php_mailer_path", htmlspecialchars($_POST["php_mailer_path"], ENT_QUOTES)); $db->updateSetting($mysqli, "php_mailer_host", htmlspecialchars($_POST["php_mailer_host"], ENT_QUOTES)); $db->updateSetting($mysqli, "php_mailer_port", htmlspecialchars($_POST["php_mailer_port"], ENT_QUOTES)); $db->updateSetting($mysqli, "php_mailer_user", htmlspecialchars($_POST["php_mailer_user"], ENT_QUOTES)); $db->updateSetting($mysqli, "php_mailer_pass", htmlspecialchars($_POST["php_mailer_pass"], ENT_QUOTES)); $db->updateSetting($mysqli, "cron_server_ip", htmlspecialchars($_POST["cron_server_ip"], ENT_QUOTES)); $db->updateSetting($mysqli, "google_recaptcha", getToggle($_POST["google_rechaptcha_toggle"])); $db->updateSetting($mysqli, "google_recaptcha_sitekey", htmlspecialchars($_POST["google_recaptcha_sitekey"], ENT_QUOTES)); $db->updateSetting($mysqli, "google_recaptcha_secret", htmlspecialchars($_POST["google_recaptcha_secret"], ENT_QUOTES)); $set_post = true; /*if($nu_toggle == "yes"){ $notifyUpdates_status = true; } else { $notifyUpdates_status = false; }*/ // TODO - Reload page to prevent showing old values! or update variables being displayed header("Location: " .$uri = $_SERVER['REQUEST_URI']); // TODO - The code below will not happen ... /*define("NAME", $db->getSetting($mysqli,"name")); define("TITLE", $db->getSetting($mysqli,"title")); define("WEB_URL", $db->getSetting($mysqli,"url")); define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); define("SUBSCRIBER_EMAIL", $db->getSetting($mysqli,"subscriber_email")); define("SUBSCRIBER_TELEGRAM", $db->getSetting($mysqli,"subscriber_telegram")); define("TG_BOT_API_TOKEN", $db->getSetting($mysqli,"tg_bot_api_token")); define("TG_BOT_USERNAME", $db->getSetting($mysqli,"tg_bot_username")); define("GOOGLE_RECAPTCHA", $db->getSetting($mysqli,"google_recaptcha")); define("GOOGLE_RECAPTCHA_SITEKEY", $db->getSetting($mysqli,"google_recaptcha_sitekey")); define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli,"google_recaptcha_secret")); define("PHP_MAILER", $db->getSetting($mysqli,"php_mailer")); define("PHP_MAILER_PATH", $db->getSetting($mysqli,"php_mailer_path")); define("PHP_MAILER_SMTP", $db->getSetting($mysqli,"php_mailer_smtp")); define("PHP_MAILER_HOST", $db->getSetting($mysqli,"php_mailer_host")); define("PHP_MAILER_PORT", $db->getSetting($mysqli,"php_mailer_port")); define("PHP_MAILER_SECURE", $db->getSetting($mysqli,"php_mailer_secure")); define("PHP_MAILER_USER", $db->getSetting($mysqli,"php_mailer_user")); define("PHP_MAILER_PASS", $db->getSetting($mysqli,"php_mailer_pass")); define("CRON_SERVER_IP", $db->getSetting($mysqli,"cron_server_ip")); */ } Template::render_header(_("Options"), true); ?>