summaryrefslogtreecommitdiffstats
path: root/usr/local
diff options
context:
space:
mode:
authorJim P <jim@pingle.org>2012-02-28 13:29:41 -0800
committerJim P <jim@pingle.org>2012-02-28 13:29:41 -0800
commit6c046206508d5a36a7a52b6cd9c52936c388cb62 (patch)
treece4cdb74b4a7cd77bd2d98cf548be1efcbe6f016 /usr/local
parent2044cb61fc2399becf7a42a0c3b44f3f396d74fe (diff)
parentadaa3f751ade110cfe8a811b01b080c30d080b5c (diff)
downloadpfsense-6c046206508d5a36a7a52b6cd9c52936c388cb62.zip
pfsense-6c046206508d5a36a7a52b6cd9c52936c388cb62.tar.gz
Merge pull request #59 from Joecowboy/Time-format-change
Time format change
Diffstat (limited to 'usr/local')
-rwxr-xr-xusr/local/www/services_dhcp.php7
-rw-r--r--usr/local/www/services_dhcpv6.php15
-rwxr-xr-xusr/local/www/status_dhcp_leases.php16
-rw-r--r--usr/local/www/status_dhcpv6_leases.php14
4 files changed, 31 insertions, 21 deletions
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);
OpenPOWER on IntegriCloud