diff --git a/includes/functions.php b/includes/functions.php index 8e4050f..f2a98de 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -498,3 +498,179 @@ function SaveTORAndVPNConfig(){ } } +///////////////////LOKINET FUNCTIONS ADDED HERE TO END////////////// + + +function DisplayLokinetConfig(){ + + exec( 'cat '. RASPI_LOKINET_CONFIG, $return ); + exec( 'pidof tor | wc -l', $torproxystatus); + + if( $torproxystatus[0] == 0 ) { + $status = '
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; + } + } +}