diff --git a/src/freedombone-image-hardware-setup b/src/freedombone-image-hardware-setup index 9623f80019d4c8d177883f2f207101c66fbe1637..f71ce90fb78a6cf5af5482a57191c34f85bfba0f 100755 --- a/src/freedombone-image-hardware-setup +++ b/src/freedombone-image-hardware-setup @@ -36,6 +36,7 @@ export TEXTDOMAIN=${PROJECT_NAME}-image-hardware-setup export TEXTDOMAINDIR="/usr/share/locale" INSTALL_PACKAGES='apt-get -yq install' +INSTALL_PACKAGES_BACKPORTS='apt-get -yq -t stretch-backports install' convert_dts() { dts="$1" @@ -180,8 +181,7 @@ arm_setup_boot() { arm_boot_start='usb start; ' fi ;; - "sun"*) $INSTALL_PACKAGES_BACKPORTS linux-image-armmp-lpae - arm_boot_device="mmc 0:1" + "sun"*) arm_boot_device="mmc 0:1" { echo "rtc_sunxi"; echo "vfat"; } >> /etc/initramfs-tools/modules ;; diff --git a/webadmin/backupconfirm.php b/webadmin/backupconfirm.php index a0afb53761e65f800b07f4f87b6d1cc0db3edeae..81e25ea3a3e94460e1e716843492c7993dac6f12 100755 --- a/webadmin/backupconfirm.php +++ b/webadmin/backupconfirm.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "backup.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['backupconfirmsubmit'])) { if(isset($_POST['backupconfirm'])) { $confirm = htmlspecialchars($_POST['backupconfirm']); diff --git a/webadmin/backuprestore.php b/webadmin/backuprestore.php index 88f8ee18c4ff5421da0a0b4d4f430773f8e41bee..8412c536862d46748a24a52bf79b35d565d69fd6 100755 --- a/webadmin/backuprestore.php +++ b/webadmin/backuprestore.php @@ -10,7 +10,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -40,6 +40,8 @@ function endsWith($haystack, $needle) $output_filename = "backup.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitbackuppassword'])) { $pass = trim(htmlspecialchars($_POST['backup_password'])); $pass_confirm = trim(htmlspecialchars($_POST['backup_password_confirm'])); diff --git a/webadmin/blocking.php b/webadmin/blocking.php index beb6cee7b3d4cd794ffce0b93a8b24220e5c27f1..814ca7fc32f081da702ce9df33eeb755d543f1d9 100755 --- a/webadmin/blocking.php +++ b/webadmin/blocking.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "settings.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + // blocked addresses or domains if (isset($_POST['submitblocking'])) { $blockinglist = htmlspecialchars($_POST['blockinglist']); diff --git a/webadmin/bridges.php b/webadmin/bridges.php index dc22744c5d5fb68228146987b23cfd0af6334acd..90e5766bfac9194bf2acccf2fd54a89d195e62ca 100755 --- a/webadmin/bridges.php +++ b/webadmin/bridges.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "settings.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitbridges'])) { $bridgeslist = htmlspecialchars($_POST['bridgeslist']); diff --git a/webadmin/changedomain.php b/webadmin/changedomain.php index 66d1b0faf92f0a8df45b39f91466a4c1cb4dc67e..b51d8502d9c78bd6f8018c08f1eac3119f56e127 100755 --- a/webadmin/changedomain.php +++ b/webadmin/changedomain.php @@ -29,6 +29,8 @@ $output_filename = "dynamicdns.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + function endsWith($haystack, $needle) { $length = strlen($needle); diff --git a/webadmin/dynamicdns.php b/webadmin/dynamicdns.php index 795cd18f401573b9dfd2cbb4ca2f1002210bd15c..2bce114f4c056d0b2ef4fdb8cae8e25c91e25b14 100755 --- a/webadmin/dynamicdns.php +++ b/webadmin/dynamicdns.php @@ -29,6 +29,8 @@ $output_filename = "settings.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitddnshelp'])) { $output_filename = "help_dynamicdns.html"; } diff --git a/webadmin/emailproxy.php b/webadmin/emailproxy.php index ea955f652f951bd68114ada4dbd14bc7941301fc..c8ae5f6d5f1ac140fd5ef3324fc6bd3f2d325b98 100755 --- a/webadmin/emailproxy.php +++ b/webadmin/emailproxy.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "index.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitemailhelp'])) { $output_filename = "help_email.html"; } diff --git a/webadmin/formatconfirm.php b/webadmin/formatconfirm.php index c2b5e32f05885d76927ab7cff059d52ca9cad82b..0aa87b5dc6eb97745dca4658496050094d4625f2 100755 --- a/webadmin/formatconfirm.php +++ b/webadmin/formatconfirm.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "backup.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['formatconfirmsubmit'])) { if(isset($_POST['formatconfirm'])) { $confirm = htmlspecialchars($_POST['formatconfirm']); diff --git a/webadmin/installapp.php b/webadmin/installapp.php index 993a4180deb98eef4745088eb744ba7558c9f0a2..ec121f2902c2807e9d0a7f67e63ef00c6d9158f1 100755 --- a/webadmin/installapp.php +++ b/webadmin/installapp.php @@ -15,7 +15,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -32,6 +32,8 @@ $output_filename = "apps_add.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitappinstall'])) { $app_name = htmlspecialchars($_POST['app_name']); $install_domain = ''; diff --git a/webadmin/installappcancel.php b/webadmin/installappcancel.php index 9adf24c0ac7f743654bf60a31441ac8ad23f4b96..c4b4c9ff9a211eb020b1df1a2dccd1bafc5fd77e 100755 --- a/webadmin/installappcancel.php +++ b/webadmin/installappcancel.php @@ -39,6 +39,8 @@ function endsWith($haystack, $needle) $output_filename = "index.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['installcancelsubmit'])) { $host = $_SERVER['HTTP_HOST']; diff --git a/webadmin/installappconfirm.php b/webadmin/installappconfirm.php index b883901f481430583bb6fe74410bf85263066d04..6de2767291f0c3446dc4537ea45603f79cb02ec6 100755 --- a/webadmin/installappconfirm.php +++ b/webadmin/installappconfirm.php @@ -17,7 +17,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -44,6 +44,8 @@ function endsWith($haystack, $needle) $output_filename = "apps_add.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['installconfirmsubmit'])) { if(isset($_POST['installconfirm'])) { $confirm = htmlspecialchars($_POST['installconfirm']); diff --git a/webadmin/installappfailed.php b/webadmin/installappfailed.php index c0c268c0ce991e7376834d276da83e207a1d98e9..008bbc59e0d7f6bc85f453c2f483c6659241b7c7 100755 --- a/webadmin/installappfailed.php +++ b/webadmin/installappfailed.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -39,6 +39,8 @@ function endsWith($haystack, $needle) $output_filename = "app_installing_failed.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitinstallappfailedcontinue'])) { $host = $_SERVER['HTTP_HOST']; diff --git a/webadmin/language.php b/webadmin/language.php index 369613ec3e7ea6c8bdcc7707644500264a72c125..ca6796f57f804ec3b7bdfff6b256d7a312677736 100755 --- a/webadmin/language.php +++ b/webadmin/language.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "settings.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitlanguage'])) { $language = htmlspecialchars($_POST['language']); diff --git a/webadmin/newuser.php b/webadmin/newuser.php index 629025703a6c221d87baabde090d528bf92a83ff..1ebf4040a06e3e9ac1a821a4c8377e942746e6cc 100755 --- a/webadmin/newuser.php +++ b/webadmin/newuser.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "users.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitnewuser'])) { $username = htmlspecialchars($_POST['username']); diff --git a/webadmin/password.php b/webadmin/password.php index 248b69b94fe91472e518464f9895483243b5352f..6d288bdd94de2c461f45b634f7a475e604fc6a18 100755 --- a/webadmin/password.php +++ b/webadmin/password.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "users.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitacceptpassword'])) { $username = htmlspecialchars($_POST['myuser']); $newpassword = htmlspecialchars($_POST['mypassword']); diff --git a/webadmin/removeapp.php b/webadmin/removeapp.php index cfe09df5b62696a58700fb27ef69a04b515812c1..15eb9611e1295afa378910828711890e67ceb2c3 100755 --- a/webadmin/removeapp.php +++ b/webadmin/removeapp.php @@ -15,7 +15,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -32,6 +32,8 @@ $output_filename = "apps.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['uninstall'])) { $app_name = htmlspecialchars($_POST['app_name']); diff --git a/webadmin/removeappconfirm.php b/webadmin/removeappconfirm.php index 84d0a70a98e997c8a9c629b198e2f2b3e5f76bff..b12068ac9126f1485863df823d3612c16151bd49 100755 --- a/webadmin/removeappconfirm.php +++ b/webadmin/removeappconfirm.php @@ -17,7 +17,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -34,6 +34,8 @@ $output_filename = "apps.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['removeconfirmsubmit'])) { if(isset($_POST['removeconfirm'])) { $confirm = htmlspecialchars($_POST['removeconfirm']); diff --git a/webadmin/removeuserconfirm.php b/webadmin/removeuserconfirm.php index 6600413d47988ef2afc92a239f11f06729aac15f..49f29ad6d2f103b45334ee65da65d6497b0b967d 100755 --- a/webadmin/removeuserconfirm.php +++ b/webadmin/removeuserconfirm.php @@ -10,7 +10,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -27,6 +27,8 @@ $output_filename = "users.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitremoveuser'])) { if(isset($_POST['removeuserconfirm'])) { $confirm = htmlspecialchars($_POST['removeuserconfirm']); diff --git a/webadmin/reset.php b/webadmin/reset.php index e3ed1f1134ad5b723a2107db9bc6f37577f8edfb..2051adba33e37e39e5875607766df2076e31d209 100755 --- a/webadmin/reset.php +++ b/webadmin/reset.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "settings.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitreset'])) { $reset_file = fopen(".reset.txt", "w") or die("Unable to write to reset file"); fwrite($reset_file, "reset"); diff --git a/webadmin/restoreconfirm.php b/webadmin/restoreconfirm.php index 16dc6189975f6507261be7b744f1168314bf497a..7e1a9b4146f4398a86851157b20b9b083d4f42aa 100755 --- a/webadmin/restoreconfirm.php +++ b/webadmin/restoreconfirm.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "backup.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['restoreconfirmsubmit'])) { if(isset($_POST['restoreconfirm'])) { $confirm = htmlspecialchars($_POST['restoreconfirm']); diff --git a/webadmin/search.php b/webadmin/search.php index 1d95f8721968beec5cbc2513a169205d16df86ea..6d2fba7891e44bbbe06ccbd6d38dfb4246f95a43 100755 --- a/webadmin/search.php +++ b/webadmin/search.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "index.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitsearch'])) { $search_query = htmlspecialchars($_POST['search_query']); diff --git a/webadmin/settings_datserver.php b/webadmin/settings_datserver.php index ddcc92dd8ff040a8a5a94011fb3cbee20765c754..228fcbe91cbf4d945c567d860b05aff4756280f3 100755 --- a/webadmin/settings_datserver.php +++ b/webadmin/settings_datserver.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_datserver.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitdatlinks'])) { $datlinks = htmlspecialchars($_POST['datlinks']); diff --git a/webadmin/settings_dlna.php b/webadmin/settings_dlna.php index e7e8750628d8a9aa799425aa00520685f8d12ec9..d24926366877908d82639fd1294261046bac7048 100755 --- a/webadmin/settings_dlna.php +++ b/webadmin/settings_dlna.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_dlna.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitdlna'])) { $dlna_file = fopen(".dlna.txt", "w") or die("Unable to write to dlna file"); fwrite($dlna_file, ' '); diff --git a/webadmin/settings_edith.php b/webadmin/settings_edith.php index 4e366cf095020833bb51dd9a4861b02eb6dfad92..9af7f6d3c1c06ae70a388b938751691fce283b2b 100755 --- a/webadmin/settings_edith.php +++ b/webadmin/settings_edith.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_edith.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitenablepassword'])) { $password = trim(htmlspecialchars($_POST['edith_password'])); $password_enabled = '0'; diff --git a/webadmin/settings_fedwiki.php b/webadmin/settings_fedwiki.php index 3c28050a7ca0e1a5aab4d89334651cdf913a6579..a79c9b10940bb1758517111208fc0336ac59305c 100755 --- a/webadmin/settings_fedwiki.php +++ b/webadmin/settings_fedwiki.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "settings_fedwiki.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitfedwikipassword'])) { $pass = trim(htmlspecialchars($_POST['fedwiki_password'])); if (strpos($pass, ' ') === false) { diff --git a/webadmin/settings_gogs.php b/webadmin/settings_gogs.php index 29c1b4fec1bc7932bb9548cde7441a2de744a5fb..f0e37163cd72675b417115ee6fa1dc9ab52d5718 100755 --- a/webadmin/settings_gogs.php +++ b/webadmin/settings_gogs.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_gogs.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitallowregistrations'])) { $confirm = htmlspecialchars($_POST['allowregistrations']); $settings_file = fopen(".appsettings.txt", "w") or die("Unable to write to appsettings file"); diff --git a/webadmin/settings_icecast.php b/webadmin/settings_icecast.php index 9741e0128c8606a963d9a5a2e5a34b45faba1f20..375d6a5fdfd0770ec1669ceaaf98d3ec11ae15ed 100755 --- a/webadmin/settings_icecast.php +++ b/webadmin/settings_icecast.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_icecast.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submiticecast'])) { $icecast_name = trim(htmlspecialchars($_POST['icecast_name'])); $icecast_description = trim(htmlspecialchars($_POST['icecast_description'])); diff --git a/webadmin/settings_koel.php b/webadmin/settings_koel.php index a75308d161e505ad976db60b92ac13a09e99468f..1aa55384baae5d05b73bc1a279db9bdb5edc95bd 100755 --- a/webadmin/settings_koel.php +++ b/webadmin/settings_koel.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_koel.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitkoel'])) { $koel_file = fopen(".koel.txt", "w") or die("Unable to write to koel file"); fwrite($koel_file, ' '); diff --git a/webadmin/settings_peertube.php b/webadmin/settings_peertube.php index d39271bc992c2eacb80a0570afbfa930c6027693..c6db80c6ec52d6971ba13e7e94258f7cfefe59e5 100755 --- a/webadmin/settings_peertube.php +++ b/webadmin/settings_peertube.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_peertube.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitallowregistrations'])) { $confirm = htmlspecialchars($_POST['allowregistrations']); $settings_file = fopen(".appsettings.txt", "w") or die("Unable to write to appsettings file"); diff --git a/webadmin/settings_pleroma.php b/webadmin/settings_pleroma.php index c531ff81a886f51437ddba094c1c429d9093ede2..d4f5a04377e2001ba8b9e646eb13315f1f83e05f 100755 --- a/webadmin/settings_pleroma.php +++ b/webadmin/settings_pleroma.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "settings_pleroma.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitallowregistrations'])) { $confirm = htmlspecialchars($_POST['allowregistrations']); $settings_file = fopen(".appsettings.txt", "w") or die("Unable to write to appsettings file"); diff --git a/webadmin/settings_rsync.php b/webadmin/settings_rsync.php index 29b28d1ae4b66d59c3398c83089fc7b4b0c95d75..12cd0f08b09cbd7e9288810b0394326911d287ac 100755 --- a/webadmin/settings_rsync.php +++ b/webadmin/settings_rsync.php @@ -29,6 +29,8 @@ $output_filename = "app_rsync.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitrsync'])) { $rsync_hostname = htmlspecialchars($_POST['rsync_hostname']); if (strpos($rsync_hostname, ' ') === false) { diff --git a/webadmin/settings_scuttlebot.php b/webadmin/settings_scuttlebot.php index f392c15b4225028f4aecc9bb69472215a647691e..54e1875f38419ed284d96239de016938c91c02b7 100755 --- a/webadmin/settings_scuttlebot.php +++ b/webadmin/settings_scuttlebot.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_scuttlebot.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['scuttlebotinvitesubmit'])) { if(isset($_POST['inviteconfirm'])) { $confirm = htmlspecialchars($_POST['inviteconfirm']); diff --git a/webadmin/settings_smolrss.php b/webadmin/settings_smolrss.php index 71930085d6b222b5f9ef1a31ddca33cddefa032b..35c6ad60ca129e3f069a529f232429e3702d1625 100755 --- a/webadmin/settings_smolrss.php +++ b/webadmin/settings_smolrss.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_smolrss.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitfeeds'])) { $feeds = htmlspecialchars($_POST['feeds']); diff --git a/webadmin/settings_syncthing.php b/webadmin/settings_syncthing.php index 3fa1cb905722139023bc4d56857e02e945f1a4ac..379cb5fd6ff47b82f0506beb0f2b9026cc34e874 100755 --- a/webadmin/settings_syncthing.php +++ b/webadmin/settings_syncthing.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_syncthing.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitsyncthing'])) { $ids = htmlspecialchars($_POST['syncthing_ids']); diff --git a/webadmin/settings_turtl.php b/webadmin/settings_turtl.php index b8cfcdfbb9f017d49c08a16e7f96f2bddc5c692e..a1e0d93f143e4d66f13be0a1c035a79ddfd828e9 100755 --- a/webadmin/settings_turtl.php +++ b/webadmin/settings_turtl.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "app_turtl.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitallowregistrations'])) { $confirm = htmlspecialchars($_POST['allowregistrations']); $settings_file = fopen(".appsettings.txt", "w") or die("Unable to write to appsettings file"); diff --git a/webadmin/settingsupdates.php b/webadmin/settingsupdates.php index 471742f21b2202f00a57c47ba04f985d5ec13fec..7c56d289050488913a6e7ae9d4775426780d2d8c 100755 --- a/webadmin/settingsupdates.php +++ b/webadmin/settingsupdates.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "index.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitsettingsupdates'])) { $enable = htmlspecialchars($_POST['enable_updates']); $repo = htmlspecialchars($_POST['updates_repo']); diff --git a/webadmin/setup.php b/webadmin/setup.php index 794369d37f07e27fef6b53e40c29edce28b01833..b7b1b8fe77dee14e0d86d6bc67e81cad62bf160f 100755 --- a/webadmin/setup.php +++ b/webadmin/setup.php @@ -15,7 +15,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -32,6 +32,8 @@ $output_filename = "index.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['setup'])) { if(file_exists("setup_confirm.html")) { $my_username = htmlspecialchars($_POST['my_username']); diff --git a/webadmin/setupconfirm.php b/webadmin/setupconfirm.php index 0a532e2c16995c3c6eb7794c57b27ba90b828915..001052686b7f4266ce547114cccb969d93506dbf 100755 --- a/webadmin/setupconfirm.php +++ b/webadmin/setupconfirm.php @@ -14,7 +14,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -31,6 +31,8 @@ $output_filename = "index.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['setupconfirmsubmit'])) { if(isset($_POST['setupconfirm'])) { $confirm = htmlspecialchars($_POST['setupconfirm']); diff --git a/webadmin/setupdomain.php b/webadmin/setupdomain.php index 5b86d81598e904d0ba32ee4ff7f8c8e74fa8ccb5..e0d58c2a334a9bfcafe89218dee107cc38606c90 100755 --- a/webadmin/setupdomain.php +++ b/webadmin/setupdomain.php @@ -14,7 +14,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -31,6 +31,8 @@ $output_filename = "index.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['setupdomain'])) { $install_domain = htmlspecialchars($_POST['default_domain_name']); diff --git a/webadmin/ssh.php b/webadmin/ssh.php index dc88d2dbafd5e76a053b0a6e2f5a9d46e5e535d4..888c485e2ed6ca9aa7bb5f97b3adab3e646b5dbc 100755 --- a/webadmin/ssh.php +++ b/webadmin/ssh.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "settings.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitssh'])) { $confirm = htmlspecialchars($_POST['sshconfirm']); diff --git a/webadmin/systemmonitor.php b/webadmin/systemmonitor.php index 8aee1b77b6a6d356ef94662846635d694cd5254e..94c67720b25babfa4222305eecb1b0723b73b8ff 100755 --- a/webadmin/systemmonitor.php +++ b/webadmin/systemmonitor.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -41,6 +41,8 @@ function endsWith($haystack, $needle) $output_filename = "settings.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitsystemmonitor'])) { $system_monitor_file = fopen(".system_monitor.txt", "w") or die("Unable to create system monitor file"); fwrite($system_monitor_file, "update"); diff --git a/webadmin/theme.php b/webadmin/theme.php index aface2fe34315f7293d56e914168697923b73af5..73402a2cc96ec5147d4687e504f7b8bab2da7954 100755 --- a/webadmin/theme.php +++ b/webadmin/theme.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "settings.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submittheme'])) { $confirm = htmlspecialchars($_POST['themechange']); diff --git a/webadmin/translations.php b/webadmin/translations.php index e210d2b92c91cfafee839a166b61763561429aef..0ced7cc9f0d204a8be6be08894771d59c7cc9ffd 100755 --- a/webadmin/translations.php +++ b/webadmin/translations.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -39,6 +39,8 @@ function endsWith($haystack, $needle) return (substr($haystack, -$length) === $needle); } +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (!isset($_POST['submitkeeptranslations'])) { if (file_exists('.keep_translations.txt')) { exec('rm .keep_translations.txt'); diff --git a/webadmin/translationsimport.php b/webadmin/translationsimport.php index a2fd6f275a2483b25aba6ca85ef4101c69532b0b..67e9497dbcc1cc09f11915ee13c9aa20090abac1 100755 --- a/webadmin/translationsimport.php +++ b/webadmin/translationsimport.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "language.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submittranslationsimport'])) { $language = htmlspecialchars($_POST['language']); $translations_import = htmlspecialchars($_POST['translationslist']); diff --git a/webadmin/upgradeconfirm.php b/webadmin/upgradeconfirm.php index 5245c8e7503724b1be457b90ed53bfbce56123e8..bf602a0b042a40786e4dbfd09055d1d551b33016 100755 --- a/webadmin/upgradeconfirm.php +++ b/webadmin/upgradeconfirm.php @@ -12,7 +12,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -29,6 +29,8 @@ $output_filename = "settings.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitupgradesettings'])) { $output_filename = "settings_updates.html"; } diff --git a/webadmin/userprofile.php b/webadmin/userprofile.php index fd8482e5a7d43104b69f798041cf857c2e3ecc91..1abce95efa4c2ebcd022e8d87aecf9308fc6c261 100755 --- a/webadmin/userprofile.php +++ b/webadmin/userprofile.php @@ -13,7 +13,7 @@ // License // ======= // -// Copyright (C) 2018 Bob Mottram <bob@freedombone.net> +// Copyright (C) 2018-2019 Bob Mottram <bob@freedombone.net> // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -30,6 +30,8 @@ $output_filename = "users.html"; +if (php_sapi_name()!=='fpm-fcgi') exit('php script must be run from the web interface'); + if (isset($_POST['submitremoveuser'])) { $username = htmlspecialchars($_POST['myuser']);