Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
0b9139a0
Commit
0b9139a0
authored
Apr 01, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
src: fix `Illegal string offset' warning in dhcp lease status
parent
8fde7fab
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
status_dhcp_leases.php
src/www/status_dhcp_leases.php
+22
-7
No files found.
src/www/status_dhcp_leases.php
View file @
0b9139a0
...
...
@@ -85,23 +85,32 @@ include("head.inc");
<?php
function
leasecmp
(
$a
,
$b
)
{
function
leasecmp
(
$a
,
$b
)
{
return
strcmp
(
$a
[
$_GET
[
'order'
]],
$b
[
$_GET
[
'order'
]]);
}
function
adjust_gmt
(
$dt
)
{
function
adjust_gmt
(
$dt
)
{
global
$config
;
$dhcpd
=
$config
[
'dhcpd'
];
$dhcpd
=
array
();
if
(
isset
(
$config
[
'dhcpd'
]))
{
$dhcpd
=
$config
[
'dhcpd'
];
}
foreach
(
$dhcpd
as
$dhcpditem
)
{
$dhcpleaseinlocaltime
=
$dhcpditem
[
'dhcpleaseinlocaltime'
];
if
(
$dhcpleaseinlocaltime
==
"yes"
)
break
;
}
if
(
$dhcpleaseinlocaltime
==
"yes"
)
{
$ts
=
strtotime
(
$dt
.
" GMT"
);
return
strftime
(
"%Y/%m/%d %I:%M:%S%p"
,
$ts
);
}
else
return
$dt
;
}
return
$dt
;
}
function
remove_duplicate
(
$array
,
$field
)
...
...
@@ -347,9 +356,15 @@ if(count($pools) > 0) {
$fspans
=
""
;
$fspane
=
" "
;
}
$dhcpd
=
array
();
if
(
isset
(
$config
[
'dhcpd'
]))
{
$dhcpd
=
$config
[
'dhcpd'
];
}
$lip
=
ip2ulong
(
$data
[
'ip'
]);
if
(
$data
[
'act'
]
==
"static"
)
{
foreach
(
$
config
[
'dhcpd'
]
as
$dhcpif
=>
$dhcpifconf
)
{
foreach
(
$
dhcpd
as
$dhcpif
=>
$dhcpifconf
)
{
if
(
is_array
(
$dhcpifconf
[
'staticmap'
]))
{
foreach
(
$dhcpifconf
[
'staticmap'
]
as
$staticent
)
{
if
(
$data
[
'ip'
]
==
$staticent
[
'ipaddr'
])
{
...
...
@@ -363,7 +378,7 @@ if(count($pools) > 0) {
break
;
}
}
else
{
foreach
(
$
config
[
'dhcpd'
]
as
$dhcpif
=>
$dhcpifconf
)
{
foreach
(
$
dhcpd
as
$dhcpif
=>
$dhcpifconf
)
{
if
(
!
is_array
(
$dhcpifconf
[
'range'
]))
continue
;
if
((
$lip
>=
ip2ulong
(
$dhcpifconf
[
'range'
][
'from'
]))
&&
(
$lip
<=
ip2ulong
(
$dhcpifconf
[
'range'
][
'to'
])))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment