diff --git a/includes/config.php b/includes/config.php index 205226d19..f5f352233 100755 --- a/includes/config.php +++ b/includes/config.php @@ -33,4 +33,4 @@ // Locale settings define('LOCALE_ROOT', 'locale'); -define('LOCALE_DOMAIN', 'messages'); +define('LOCALE_DOMAIN', 'messages'); diff --git a/includes/dashboard.php b/includes/dashboard.php index 2469f017b..b2b3a930c 100755 --- a/includes/dashboard.php +++ b/includes/dashboard.php @@ -60,7 +60,7 @@ function DisplayDashboard(){ preg_match('/state (UP|DOWN)/i', $stdoutIpWRepeatedSpaces, $matchesState ) || $matchesState[1] = 'unknown'; $interfaceState = $matchesState[1]; - // Because of table layout used in the ip output we get the interface statistics directly from + // Because of table layout used in the ip output we get the interface statistics directly from // the system. One advantage of this is that it could work when interface is disable. exec('cat /sys/class/net/'.RASPI_WIFI_CLIENT_INTERFACE.'/statistics/rx_packets ', $stdoutCatRxPackets); $strRxPackets = _('No data'); @@ -126,7 +126,7 @@ function DisplayDashboard(){ preg_match('/txpower ([0-9\.]+ dBm)/i', $stdoutIpInfoWRepSpaces, $matchesTxPower ) || $matchesTxPower[1] = ''; $txPower = $matchesTxPower[1]; - // iw does not have the "Link Quality". This is a is an aggregate value, + // iw does not have the "Link Quality". This is a is an aggregate value, // and depends on the driver and hardware. // Display link quality as signal quality for now. $strLinkQuality = 0; @@ -173,7 +173,7 @@ function DisplayDashboard(){ } } else { $status->addMessage(sprintf(_('Interface is %s.'), strtolower($interfaceState)), $classMsgDevicestatus); - } +} ?> <div class="row"> <div class="col-lg-12"> @@ -274,4 +274,3 @@ function getHumanReadableDatasize($numbytes, $precision = 2) return $humanDatasize; } - diff --git a/includes/functions.php b/includes/functions.php index a34bd55d1..de0321d3f 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -262,7 +262,7 @@ function DisplayOpenVPNConfig() { <h4>Server settings</h4> <div class="row"> <div class="form-group col-md-4"> - <label for="code">Port</label> + <label for="code">Port</label> <input type="text" class="form-control" name="openvpn_port" value="<?php echo htmlspecialchars($arrServerConfig['port'], ENT_QUOTES); ?>" /> </div> </div> @@ -350,14 +350,16 @@ function DisplayLokinetConfig(){ <div class="row"> <div class="col-lg-12"> <div class="panel panel-primary"> - <div class="panel-heading"><i class="fa fa-eye-slash fa-fw"></i> Configure TOR proxy</div> + <div class="panel-heading"><i class="fa fa-eye-slash fa-fw"></i> Configure Lokinet</div> <!-- /.panel-heading --> <div class="panel-body"> <!-- Nav tabs --> <ul class="nav nav-tabs"> - <li class="active"><a href="#basic" data-toggle="tab">Basic</a> + <li class="active"><a href="#basic" data-toggle="tab">Daemon Control</a> </li> - <li><a href="#relay" data-toggle="tab">Relay</a> + <li><a href="#daemon" data-toggle="tab">Advanced Console User</a> + </li> + <li><a href="#youtube" data-toggle="tab">This is Loki</a> </li> </ul> @@ -368,100 +370,59 @@ function DisplayLokinetConfig(){ <div class="tab-pane fade in active" id="basic"> <h4>Basic settings</h4> <form role="form" action="?page=save_hostapd_conf" method="POST"> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">VirtualAddrNetwork</label> - <input type="text" class="form-control" name="virtualaddrnetwork" value="<?php echo htmlspecialchars($arrConfig['VirtualAddrNetwork'], ENT_QUOTES); ?>" /> - </div> - </div> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">AutomapHostsSuffixes</label> - <input type="text" class="form-control" name="automaphostssuffixes" value="<?php echo htmlspecialchars($arrConfig['AutomapHostsSuffixes'], ENT_QUOTES); ?>" /> - </div> - </div> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">AutomapHostsOnResolve</label> - <input type="text" class="form-control" name="automaphostsonresolve" value="<?php echo htmlspecialchars($arrConfig['AutomapHostsOnResolve'], ENT_QUOTES); ?>" /> - </div> - </div> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">TransListenAddress</label> - <input type="text" class="form-control" name="translistenaddress" value="<?php echo htmlspecialchars($arrConfig['TransListenAddress'], ENT_QUOTES); ?>" /> - </div> - </div> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">DNSPort</label> - <input type="text" class="form-control" name="dnsport" value="<?php echo htmlspecialchars($arrConfig['DNSPort'], ENT_QUOTES); ?>" /> - </div> - </div> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">DNSListenAddress</label> - <input type="text" class="form-control" name="dnslistenaddress" value="<?php echo htmlspecialchars($arrConfig['DNSListenAddress'], ENT_QUOTES); ?>" /> - </div> - </div> - </div> - <div class="tab-pane fade" id="relay"> - <h4>Relay settings</h4> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">ORPort</label> - <input type="text" class="form-control" name="orport" value="<?php echo htmlspecialchars($arrConfig['ORPort'], ENT_QUOTES); ?>" /> - </div> - </div> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">ORListenAddress</label> - <input type="text" class="form-control" name="orlistenaddress" value="<?php echo htmlspecialchars($arrConfig['ORListenAddress'], ENT_QUOTES); ?>" /> - </div> - </div> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">Nickname</label> - <input type="text" class="form-control" name="nickname" value="<?php echo htmlspecialchars($arrConfig['Nickname'], ENT_QUOTES); ?>" /> - </div> - </div> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">Address</label> - <input type="text" class="form-control" name="address" value="<?php echo htmlspecialchars($arrConfig['Address'], ENT_QUOTES); ?>" /> - </div> - </div> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">RelayBandwidthRate</label> - <input type="text" class="form-control" name="relaybandwidthrate" value="<?php echo htmlspecialchars($arrConfig['RelayBandwidthRate'], ENT_QUOTES); ?>" /> - </div> - </div> - <div class="row"> - <div class="form-group col-md-4"> - <label for="code">RelayBandwidthBurst</label> - <input type="text" class="form-control" name="relaybandwidthburst" value="<?php echo htmlspecialchars($arrConfig['RelayBandwidthBurst'], ENT_QUOTES); ?>" /> - </div> - </div> - </div> + <div class="row"> + <div class="form-group col-lg-12"> + <label for="code">Update lokinet-bootstrap settings</label> + <input type="text" class="form-control" name="loinetbootstrap" placeholder="http://206.81.100.174/n-st-5.signed" value="<?php echo htmlspecialchars($arrConfig['lokinetbootstrap'], ENT_QUOTES); ?>" /> + <h5>Contact Loki user groups for the latest bootstrap file location</h5> + <input type="submit" class="btn btn-success" name="ApplyLokinetSettings" value="Apply Bootstrap" /> + <?php + if( $lokinetstatus[0] == 0 ) { + echo '<input type="submit" class="btn btn-success" name="StartLokinet" value="Start Lokinet" />' , PHP_EOL; + } else { + echo '<input type="submit" class="btn btn-danger" name="StopLokient" value="Stop Lokinet" />' , PHP_EOL; + }; + $filename = '/home/pi/.lokinet/lokinet.ini'; + if (!file_exists($filename)) { + echo '<input tpe="submit" class="btn btn-success" name="GenerateLokinet" value="Gnerate .ini" />' , PHP_EOL; + } else { + echo '<input type="submit" class="btn btn-danger" name="ReGenerateLokinet" value="Regenerate .ini" />' , PHP_EOL; + }; + ?> + </div> + </div> + </div> + + <div class="tab-pane fade" id="daemon"> + <h4>Lokient Daemon</h4> + <div class="row"> + <div class="col-lg-12"> + <iframe src="includes/webconsole.php" class="webconsole"></iframe> + </div> + </div> + </div> + + <div class="tab-pane fade" id="youtube"> + <div class="container"> + <h2>This is Loki</h2> + <div class="embed-responsive embed-responsive-16by9"> + <iframe class="embed-responsive-item" src="https://www.youtube.com/embed/Lykh-NqkKys"></iframe> + </div> + </div> + </div> + + + + </form> + </div><!-- /.tab-content --> + </div><!-- /.panel-body --> + <div class="panel-footer"> Information provided by Lokinet</div> + </div><!-- /.panel-primary --> + </div><!-- /.col-lg-12 --> + </div><!-- /.row --> + <?php + } - <input type="submit" class="btn btn-outline btn-primary" name="SaveTORProxySettings" value="Save settings" /> - <?php - if( $torproxystatus[0] == 0 ) { - echo '<input type="submit" class="btn btn-success" name="StartTOR" value="Start TOR" />' , PHP_EOL; - } else { - echo '<input type="submit" class="btn btn-warning" name="StopTOR" value="Stop TOR" />' , PHP_EOL; - }; - ?> - </form> - </div><!-- /.tab-content --> - </div><!-- /.panel-body --> - <div class="panel-footer"> Information provided by tor</div> - </div><!-- /.panel-primary --> -</div><!-- /.col-lg-12 --> -</div><!-- /.row --> -<?php -} /** * @@ -527,13 +488,13 @@ function DisplayTorProxyConfig(){ <label for="code">AutomapHostsOnResolve</label> <input type="text" class="form-control" name="automaphostsonresolve" value="<?php echo htmlspecialchars($arrConfig['AutomapHostsOnResolve'], ENT_QUOTES); ?>" /> </div> - </div> + </div> <div class="row"> <div class="form-group col-md-4"> <label for="code">TransListenAddress</label> <input type="text" class="form-control" name="translistenaddress" value="<?php echo htmlspecialchars($arrConfig['TransListenAddress'], ENT_QUOTES); ?>" /> </div> - </div> + </div> <div class="row"> <div class="form-group col-md-4"> <label for="code">DNSPort</label> @@ -588,7 +549,7 @@ function DisplayTorProxyConfig(){ </div> <input type="submit" class="btn btn-outline btn-primary" name="SaveTORProxySettings" value="Save settings" /> - <?php + <?php if( $torproxystatus[0] == 0 ) { echo '<input type="submit" class="btn btn-success" name="StartTOR" value="Start TOR" />' , PHP_EOL; } else { @@ -602,7 +563,7 @@ function DisplayTorProxyConfig(){ </div><!-- /.panel-primary --> </div><!-- /.col-lg-12 --> </div><!-- /.row --> -<?php +<?php } /** @@ -638,5 +599,5 @@ function SaveTORAndVPNConfig(){ foreach( $return as $line ) { echo htmlspecialchars($line, ENT_QUOTES).'<br />' , PHP_EOL; } - } + } } diff --git a/includes/system.php b/includes/system.php index f5b23eca2..8bb5c3ae8 100755 --- a/includes/system.php +++ b/includes/system.php @@ -64,14 +64,14 @@ function DisplaySystem(){ if (CSRFValidate()) { if(isset($_POST['locale'])) { $_SESSION['locale'] = $_POST['locale']; - $status->addMessage('Language setting saved', 'success'); + $status->addMessage('Language setting saved', 'success'); } } else { error_log('CSRF violation'); } } - // define locales + // define locales $arrLocales = array( 'en_GB.UTF-8' => 'English', 'de_DE.UTF-8' => 'Deutsch', @@ -181,6 +181,9 @@ function DisplaySystem(){ <input type="submit" class="btn btn-warning" name="system_shutdown" value="<?php echo _("Shutdown"); ?>" /> <input type="button" class="btn btn-outline btn-primary" value="<?php echo _("Refresh"); ?>" onclick="document.location.reload(true)" /> </form> + <h5><?php echo _("Development Support Appreciated"); ?></h5> + <h5><?php echo _("LK8CGQ17G9R3ys3Xf33wCeViD2B95jgdpjAhcRsjuheJ784dumXn7g3RPAzedWpFq364jJKYL9dkQ8mY66sZG9BiCwrYHPmcZin1VP8Btf"); ?></h5> + </div> </div> </div> @@ -200,7 +203,7 @@ function DisplaySystem(){ <div role="tabpanel" class="tab-pane" id="console"> <div class="row"> - <div class="col-lg-12"> + <div class="col-lg-12"> <iframe src="includes/webconsole.php" class="webconsole"></iframe> </div> </div> @@ -220,4 +223,3 @@ function DisplaySystem(){ </div><!-- /.row --> <?php } - diff --git a/index.php b/index.php index cb4b1bfe4..e55351bb2 100755 --- a/index.php +++ b/index.php @@ -9,7 +9,7 @@ * lighttpd (I have version 1.4.31-2 installed via apt) * php5-cgi (I have version 5.4.4-12 installed via apt) * along with their supporting packages, php5 will also need to be enabled. - * + * * @author Lawrence Yau <sirlagz@gmail.com> * @author Bill Zimmerman <billzimmerman@gmail.com> * @license GNU General Public License, version 3 (GPL-3.0) @@ -118,10 +118,10 @@ <li> <a href="index.php?page=wlan0_info"><i class="fa fa-dashboard fa-fw"></i> <?php echo _("Dashboard"); ?></a> </li> - <?php if ( RASPI_WIFICLIENT_ENABLED ) : ?> + <?php if ( RASPI_WIFICLIENT_ENABLED ) : ?> <li> <a href="index.php?page=wpa_conf"><i class="fa fa-signal fa-fw"></i> <?php echo _("Configure WiFi client"); ?></a> - </li> + </li> <?php endif; ?> <?php if ( RASPI_HOTSPOT_ENABLED ) : ?> <li> @@ -131,7 +131,7 @@ <?php if ( RASPI_NETWORK_ENABLED ) : ?> <li> <a href="index.php?page=network_conf"><i class="fa fa-sitemap fa-fw"></i> <?php echo _("Configure networking"); ?></a> - </li> + </li> <?php endif; ?> <?php if ( RASPI_DHCP_ENABLED ) : ?> <li> @@ -143,7 +143,7 @@ <a href="index.php?page=openvpn_conf"><i class="fa fa-lock fa-fw"></i> <?php echo _("Configure OpenVPN"); ?></a> </li> <?php endif; ?> - <?php if ( RASPI_LOKINET_ENABLED ) : ?> + <?php if ( RASPI_LOKINET_ENABLED ) : ?> <li> <a href="index.php?page=lokinet_conf"><i class="fa fa-eye-slash fa-fw"></i> <?php echo _("Configure Lokinet"); ?></a> </li> @@ -171,6 +171,8 @@ <li> <a href="index.php?page=system_info"><i class="fa fa-cube fa-fw"></i> <?php echo _("System"); ?></a> </li> + </div> + </div> </ul> </div><!-- /.navbar-collapse --> </div><!-- /.navbar-default --> @@ -187,7 +189,7 @@ </div> </div><!-- /.row --> - <?php + <?php $extraFooterScripts = array(); // handle page actions switch( $page ) { @@ -209,7 +211,7 @@ case "openvpn_conf": DisplayOpenVPNConfig(); break; - case "lokinet_conf": + case "lokinet_conf": DisplayLokinetConfig(); break; case "torproxy_conf": @@ -235,7 +237,7 @@ } ?> - </div><!-- /#page-wrapper --> + </div><!-- /#page-wrapper --> </div><!-- /#wrapper --> <!-- RaspAP JavaScript --> @@ -256,6 +258,9 @@ <!-- Custom RaspAP JS --> <script src="js/custom.js"></script> + + + <?php // Load non default JS/ECMAScript in footer. foreach ($extraFooterScripts as $script) { diff --git a/js/custom.js b/js/custom.js index d660f45e4..dc7a9815b 100644 --- a/js/custom.js +++ b/js/custom.js @@ -148,5 +148,3 @@ $().ready(function(){ break; } }); - -