diff --git a/dist/css/custom.css b/dist/css/custom.css index 88559118..41b9c522 100644 --- a/dist/css/custom.css +++ b/dist/css/custom.css @@ -6,14 +6,10 @@ margin-right: 5px; } -#page-wrapper { - margin: 0 0 0 200px; -} - -.sidebar { +/*.sidebar { margin-top: 35px; width: 200px; -} +}*/ .panel-primary { border-color: #c61931; diff --git a/includes/functions.php b/includes/functions.php index d9f79ffc..4c4cc2f7 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -78,187 +78,6 @@ function ConvertToSecurity( $security ) { } } -/** -* -* -*/ -function DisplayDHCPConfig() { - - exec( 'cat '. RASPI_DNSMASQ_CONFIG, $return ); - $conf = ParseConfig($return); - $arrRange = explode( ",", $conf['dhcp-range'] ); - $RangeStart = $arrRange[0]; - $RangeEnd = $arrRange[1]; - $RangeMask = $arrRange[2]; - preg_match( '/([0-9]*)([a-z])/i', $arrRange[3], $arrRangeLeaseTime ); - - switch( $arrRangeLeaseTime[2] ) { - case "h": - $hselected = " selected"; - break; - case "m": - $mselected = " selected"; - break; - case "d": - $dselected = " selected"; - break; - } - - exec( 'pidof dnsmasq | wc -l',$dnsmasq ); - - if( $dnsmasq[0] == 0 ) { - $status = '
Dnsmasq is not running
'; - } else { - $status = '
Dnsmasq is running
'; - } - - echo ' -
-
-
-
Configure DHCP -
- -
- - - -
-

' .$status. '

-
-

DHCP server settings

-
-
-
- - -
-
-
-
- - -
-
- -
-
- - -
-
- -
-
- - -
-
- - -
-
- - '; - - if ( $dnsmasq[0] == 0 ) { - echo''; - } else { - echo ''; - } - - echo' -
-
- -
-

Client list

-
-
-
- Active DHCP leases -
- -
-
- - - - - - - - - - - - '; - exec( 'cat ' . RASPI_DNSMASQ_LEASES, $leases ); - foreach( $leases as $lease ) { - $lease_items = explode(' ', $lease); - foreach( $lease_items as $lease_item ) { - echo ''; - } - echo ''; - }; - echo ' - - -
Expire timeMAC AddressIP AddressHost nameClient ID
' . $lease_item . '
-
-
-
-
'; - - if( isset( $_POST['savedhcpdsettings'] ) ) { - $config = 'interface='.$_POST['interface'].' - dhcp-range='.$_POST['RangeStart'].','.$_POST['RangeEnd'].',255.255.255.0,'.$_POST['RangeLeaseTime'].''.$_POST['RangeLeaseTimeUnits']; - exec( 'echo "'.$config.'" > /tmp/dhcpddata',$temp ); - system( 'sudo cp /tmp/dhcpddata '. RASPI_DNSMASQ_CONFIG, $return ); - - if( $return == 0 ) { - echo "Dnsmasq configuration updated successfully"; - } else { - echo "Dnsmasq configuration failed to be updated"; - } - } - - if( isset( $_POST['startdhcpd'] ) ) { - $line = system('sudo /etc/init.d/dnsmasq start',$return); - echo "Attempting to start dnsmasq"; - } - - if( isset($_POST['stopdhcpd'] ) ) { - $line = system('sudo /etc/init.d/dnsmasq stop',$return); - echo "Stopping dnsmasq"; - } - echo ' -
-
-
- -
-
-
- '; -} - /** * * @@ -647,6 +466,187 @@ function DisplayHostAPDConfig(){ Dnsmasq is not running'; + } else { + $status = '
Dnsmasq is running
'; + } + ?> +
+
+
+
Configure DHCP +
+ +
+ + + +
+

+
+

DHCP server settings

+
+
+
+ + +
+
+
+
+ + +
+
+ +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + + '; + } else { + echo ''; + } + ?> +
+
+ +
+

Client list

+
+
+
+ Active DHCP leases +
+ +
+
+ + + + + + + + + + + + + ' . $lease_item . ''; + } + echo ''; + }; + ?> + + +
Expire timeMAC AddressIP AddressHost nameClient ID
+
+
+
+
' + /tmp/dhcpddata',$temp ); + system( 'sudo cp /tmp/dhcpddata '. RASPI_DNSMASQ_CONFIG, $return ); + + if( $return == 0 ) { + echo "Dnsmasq configuration updated successfully"; + } else { + echo "Dnsmasq configuration failed to be updated"; + } + } + + if( isset( $_POST['startdhcpd'] ) ) { + $line = system('sudo /etc/init.d/dnsmasq start',$return); + echo "Attempting to start dnsmasq"; + } + + if( isset($_POST['stopdhcpd'] ) ) { + $line = system('sudo /etc/init.d/dnsmasq stop',$return); + echo "Stopping dnsmasq"; + } + ?> +
+
+
+ +
+
+
+
-