diff options
-rw-r--r-- | conf.default/config.xml | 2 | ||||
-rwxr-xr-x | usr/local/www/services_dhcp.php | 7 | ||||
-rw-r--r-- | usr/local/www/services_dhcpv6.php | 15 | ||||
-rwxr-xr-x | usr/local/www/status_dhcp_leases.php | 16 | ||||
-rw-r--r-- | usr/local/www/status_dhcpv6_leases.php | 14 |
5 files changed, 31 insertions, 23 deletions
diff --git a/conf.default/config.xml b/conf.default/config.xml index db86104..a75b33e 100644 --- a/conf.default/config.xml +++ b/conf.default/config.xml @@ -174,8 +174,6 @@ <nextuid>2000</nextuid> <nextgid>2000</nextgid> <timezone>Etc/UTC</timezone> - <timeformatchange/> - <timeformatchangev6/> <time-update-interval>300</time-update-interval> <timeservers>0.pfsense.pool.ntp.org</timeservers> <webgui> diff --git a/usr/local/www/services_dhcp.php b/usr/local/www/services_dhcp.php index 6cc8674..3895268 100755 --- a/usr/local/www/services_dhcp.php +++ b/usr/local/www/services_dhcp.php @@ -151,7 +151,7 @@ if (is_array($config['dhcpd'][$if])){ $pconfig['failover_peerip'] = $config['dhcpd'][$if]['failover_peerip']; $pconfig['netmask'] = $config['dhcpd'][$if]['netmask']; $pconfig['numberoptions'] = $config['dhcpd'][$if]['numberoptions']; - $pconfig['timeformatchange'] = $config['system']['timeformatchange']; + $pconfig['dhcpleaseinlocaltime'] = $config['dhcpd'][$if]['dhcpleaseinlocaltime']; if (!is_array($config['dhcpd'][$if]['staticmap'])) $config['dhcpd'][$if]['staticmap'] = array(); $a_maps = &$config['dhcpd'][$if]['staticmap']; @@ -381,7 +381,7 @@ if ($_POST) { $config['dhcpd'][$if]['nextserver'] = $_POST['nextserver']; $config['dhcpd'][$if]['filename'] = $_POST['filename']; $config['dhcpd'][$if]['rootpath'] = $_POST['rootpath']; - $config['system']['timeformatchange'] = $_POST['timeformatchange']; + $config['dhcpd'][$if]['dhcpleaseinlocaltime'] = $_POST['dhcpleaseinlocaltime']; // Handle the custom options rowhelper if(isset($config['dhcpd'][$if]['numberoptions']['item'])) @@ -480,6 +480,7 @@ include("head.inc"); document.iform.domain.disabled = endis; document.iform.domainsearchlist.disabled = endis; document.iform.staticarp.disabled = endis; + document.iform.dhcpleaseinlocaltime.disabled = endis; document.iform.ddnsdomain.disabled = endis; document.iform.ddnsupdate.disabled = endis; document.iform.ntp1.disabled = endis; @@ -736,7 +737,7 @@ include("head.inc"); <table> <tr> <td> - <input name="timeformatchange" type="checkbox" id="timeformatchange" value="yes" <?php if ($pconfig['timeformatchange']) echo "checked"; ?>> + <input name="dhcpleaseinlocaltime" type="checkbox" id="dhcpleaseinlocaltime" value="yes" <?php if ($pconfig['dhcpleaseinlocaltime']) echo "checked"; ?>> </td> <td> <strong> diff --git a/usr/local/www/services_dhcpv6.php b/usr/local/www/services_dhcpv6.php index 26b6066..f873e0b 100644 --- a/usr/local/www/services_dhcpv6.php +++ b/usr/local/www/services_dhcpv6.php @@ -119,7 +119,7 @@ if (is_array($config['dhcpdv6'][$if])){ $pconfig['failover_peerip'] = $config['dhcpdv6'][$if]['failover_peerip']; $pconfig['netmask'] = $config['dhcpdv6'][$if]['netmask']; $pconfig['numberoptions'] = $config['dhcpdv6'][$if]['numberoptions']; - $pconfig['timeformatchangev6'] = $config['system']['timeformatchangev6']; + $pconfig['dhcpv6leaseinlocaltime'] = $config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime']; if (!is_array($config['dhcpdv6'][$if]['staticmap'])) $config['dhcpdv6'][$if]['staticmap'] = array(); $a_maps = &$config['dhcpdv6'][$if]['staticmap']; @@ -319,7 +319,7 @@ if ($_POST) { $config['dhcpdv6'][$if]['nextserver'] = $_POST['nextserver']; $config['dhcpdv6'][$if]['filename'] = $_POST['filename']; $config['dhcpdv6'][$if]['rootpath'] = $_POST['rootpath']; - $config['system']['timeformatchangev6'] = $_POST['timeformatchangev6']; + $config['dhcpdv6'][$if]['dhcpv6leaseinlocaltime'] = $_POST['dhcpv6leaseinlocaltime']; // Handle the custom options rowhelper if(isset($config['dhcpdv6'][$if]['numberoptions']['item'])) @@ -401,15 +401,16 @@ include("head.inc"); document.iform.dns2.disabled = endis; document.iform.deftime.disabled = endis; document.iform.maxtime.disabled = endis; - document.iform.gateway.disabled = endis; + //document.iform.gateway.disabled = endis; document.iform.failover_peerip.disabled = endis; + document.iform.dhcpv6leaseinlocaltime.disabled = endis; document.iform.domain.disabled = endis; document.iform.domainsearchlist.disabled = endis; document.iform.ddnsdomain.disabled = endis; document.iform.ddnsupdate.disabled = endis; - document.iform.ntp1.disabled = endis; - document.iform.ntp2.disabled = endis; - document.iform.tftp.disabled = endis; + //document.iform.ntp1.disabled = endis; + //document.iform.ntp2.disabled = endis; + //document.iform.tftp.disabled = endis; document.iform.ldap.disabled = endis; document.iform.netboot.disabled = endis; document.iform.nextserver.disabled = endis; @@ -665,7 +666,7 @@ include("head.inc"); <table> <tr> <td> - <input name="timeformatchangev6" type="checkbox" id="timeformatchangev6" value="yes" <?php if ($pconfig['timeformatchangev6']) echo "checked"; ?>> + <input name="dhcpv6leaseinlocaltime" type="checkbox" id="dhcpv6leaseinlocaltime" value="yes" <?php if ($pconfig['dhcpv6leaseinlocaltime']) echo "checked"; ?>> </td> <td> <strong> diff --git a/usr/local/www/status_dhcp_leases.php b/usr/local/www/status_dhcp_leases.php index a00c94e..f1dec97 100755 --- a/usr/local/www/status_dhcp_leases.php +++ b/usr/local/www/status_dhcp_leases.php @@ -95,18 +95,22 @@ function leasecmp($a, $b) { } function adjust_gmt($dt) { - global $config; - $sysctl = $config['system']; - $timezone = $sysctl['timezone']; - $timeformatchange = $sysctl['timeformatchange']; + global $config; + $dhcpd = $config['dhcpd']; + foreach ($dhcpd as $dhcpleaseinlocaltime) { + $dhcpleaseinlocaltime = $dhcpleaseinlocaltime['dhcpleaseinlocaltime']; + if ($dhcpleaseinlocaltime == "yes") + break; + } + $timezone = $config['system']['timezone']; $ts = strtotime($dt . " GMT"); - if ($timeformatchange == "yes") { + if ($dhcpleaseinlocaltime == "yes") { $this_tz = new DateTimeZone($timezone); $dhcp_lt = new DateTime(strftime("%I:%M:%S%p", $ts), $this_tz); $offset = $this_tz->getOffset($dhcp_lt); $ts = $ts + $offset; return strftime("%Y/%m/%d %I:%M:%S%p", $ts); - } + } else return strftime("%Y/%m/%d %H:%M:%S", $ts); } diff --git a/usr/local/www/status_dhcpv6_leases.php b/usr/local/www/status_dhcpv6_leases.php index c4d7aa7..2f2696d 100644 --- a/usr/local/www/status_dhcpv6_leases.php +++ b/usr/local/www/status_dhcpv6_leases.php @@ -96,12 +96,16 @@ function leasecmp($a, $b) { } function adjust_gmt($dt) { - global $config; - $sysctl = $config['system']; - $timezone = $sysctl['timezone']; - $timeformatchangev6 = $sysctl['timeformatchangev6']; + global $config; + $dhcpdv6 = $config['dhcpdv6']; + foreach ($dhcpdv6 as $dhcpv6leaseinlocaltime) { + $dhcpv6leaseinlocaltime = $dhcpv6leaseinlocaltime['dhcpv6leaseinlocaltime']; + if ($dhcpv6leaseinlocaltime == "yes") + break; + } + $timezone = $config['system']['timezone']; $ts = strtotime($dt . " GMT"); - if ($timeformatchangev6 == "yes") { + if ($dhcpv6leaseinlocaltime == "yes") { $this_tz = new DateTimeZone($timezone); $dhcp_lt = new DateTime(strftime("%I:%M:%S%p", $ts), $this_tz); $offset = $this_tz->getOffset($dhcp_lt); |