From 3ed8b1b3e59ec2ca601cbdd370dfe843d3f1dcd1 Mon Sep 17 00:00:00 2001 From: glen Date: Sun, 4 Oct 2020 08:19:03 -0400 Subject: [PATCH] Remove irrelevant code. --- includes/functions.php | 297 +---------------------------------------- index.php | 18 +-- 2 files changed, 3 insertions(+), 312 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index ccddf90..104d024 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -209,132 +209,6 @@ function ConvertToSecurity($security) } } -/** -* -* -*/ -function DisplayOpenVPNConfig() -{ - exec('cat '. RASPI_OPENVPN_CLIENT_CONFIG, $returnClient); - exec('cat '. RASPI_OPENVPN_SERVER_CONFIG, $returnServer); - exec('pidof openvpn | wc -l', $openvpnstatus); - - if ($openvpnstatus[0] == 0) { - $status = '
OpenVPN is not running -
'; - } else { - $status = '
OpenVPN is running -
'; - } - - // parse client settings - foreach ($returnClient as $a) { - if ($a[0] != "#") { - $arrLine = explode(" ", $a) ; - $arrClientConfig[$arrLine[0]]=$arrLine[1]; - } - } - - // parse server settings - foreach ($returnServer as $a) { - if ($a[0] != "#") { - $arrLine = explode(" ", $a) ; - $arrServerConfig[$arrLine[0]]=$arrLine[1]; - } - } ?> -
-
-
-
Configure OpenVPN
- -
- - - -
-

-
- -

Client settings

-
- -
-
- - -
-
-
-
- - -
-
-
-
-

Server settings

-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
- - ' , PHP_EOL; - } else { - echo '' , PHP_EOL; - } ?> - -
-
- -
-
-TOR is not running -
'; - } else { - $status = '
TOR is running -
'; - } - - $arrConfig = array(); - foreach ($return as $a) { - if ($a[0] != "#") { - $arrLine = explode(" ", $a) ; - $arrConfig[$arrLine[0]]=$arrLine[1]; - } - } ?> -
-
-
-
Configure TOR proxy
- -
- - - - -
-

- -
-

Basic settings

-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
-

Relay settings

-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
- - - ' , PHP_EOL; - } else { - echo '' , PHP_EOL; - }; ?> - -
-
- -
-
-
-' , PHP_EOL; - } - } elseif (isset($_POST['StopOpenVPN'])) { - echo "Attempting to stop openvpn"; - exec('sudo /etc/init.d/openvpn stop', $return); - foreach ($return as $line) { - echo htmlspecialchars($line, ENT_QUOTES).'
' , PHP_EOL; - } - } elseif (isset($_POST['StartTOR'])) { - echo "Attempting to start TOR"; - exec('sudo /etc/init.d/tor start', $return); - foreach ($return as $line) { - echo htmlspecialchars($line, ENT_QUOTES).'
' , PHP_EOL; - } - } elseif (isset($_POST['StopTOR'])) { - echo "Attempting to stop TOR"; - exec('sudo /etc/init.d/tor stop', $return); - foreach ($return as $line) { - echo htmlspecialchars($line, ENT_QUOTES).'
' , PHP_EOL; - } /* Lokinet script commands start HERE //// //// LOKINET @@ -611,7 +318,7 @@ function SaveTORAndVPNConfig() //*/ //START - } elseif (isset($_POST['StartDaemon'])) { + if (isset($_POST['StartDaemon'])) { exec('sudo /var/lib/lokinet/lokilaunch.sh start'); //STOP diff --git a/index.php b/index.php index 9daec39..20fe786 100755 --- a/index.php +++ b/index.php @@ -135,22 +135,12 @@ $theme_url = 'dist/css/'.htmlspecialchars($theme, ENT_QUOTES);
  • - - -
  • - -
  • - -
  • - -
  • -
  • @@ -205,21 +195,15 @@ $extraFooterScripts = array(); break; case "hostapd_conf": DisplayHostAPDConfig(); - break; - case "openvpn_conf": - DisplayOpenVPNConfig(); break; case "lokinet_conf": DisplayLokinetConfig(); break; - case "torproxy_conf": - DisplayTorProxyConfig(); - break; case "auth_conf": DisplayAuthConfig($config['admin_user'], $config['admin_pass']); break; case "save_hostapd_conf": - SaveTORAndVPNConfig(); + ActivateLokinetConfig(); break; case "theme_conf": DisplayThemeConfig();