Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Zvonimir
ISPConfig 3
Commits
391e05cb
Commit
391e05cb
authored
Oct 22, 2013
by
Falko Timme
Browse files
- Display hostname next to IP (where available) in the jQuery IP suggestion box.
parent
3327ed19
Changes
1
Hide whitespace changes
Inline
Side-by-side
interface/lib/classes/functions.inc.php
View file @
391e05cb
...
...
@@ -237,12 +237,24 @@ class functions {
// IPv6
$regex
=
"/^(\:\:([a-f0-9]
{
1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3
}
)?$/i"
;
}
$server_by_id
=
array
();
$server_by_ip
=
array
();
$servers
=
$app
->
db
->
queryAllRecords
(
"SELECT * FROM server"
);
if
(
is_array
(
$servers
)
&&
!
empty
(
$servers
)){
foreach
(
$servers
as
$server
){
$server_by_id
[
$server
[
'server_id'
]]
=
$server
[
'server_name'
];
}
}
$ips
=
array
();
$results
=
$app
->
db
->
queryAllRecords
(
"SELECT ip_address AS ip FROM server_ip WHERE ip_type = '"
.
$type
.
"'"
);
$results
=
$app
->
db
->
queryAllRecords
(
"SELECT ip_address AS ip
, server_id
FROM server_ip WHERE ip_type = '"
.
$type
.
"'"
);
if
(
!
empty
(
$results
)
&&
is_array
(
$results
)){
foreach
(
$results
as
$result
){
if
(
preg_match
(
$regex
,
$result
[
'ip'
]))
$ips
[]
=
$result
[
'ip'
];
if
(
preg_match
(
$regex
,
$result
[
'ip'
])){
$ips
[]
=
$result
[
'ip'
];
$server_by_ip
[
$result
[
'ip'
]]
=
$server_by_id
[
$result
[
'server_id'
]];
}
}
}
$results
=
$app
->
db
->
queryAllRecords
(
"SELECT ip_address AS ip FROM openvz_ip"
);
...
...
@@ -317,7 +329,7 @@ class functions {
foreach
(
$ips
as
$ip
){
$result_array
[
'cdata'
][]
=
array
(
'title'
=>
$ip
,
'description'
=>
$type
,
'description'
=>
$type
.
(
$server_by_ip
[
$ip
]
!=
''
?
' > '
.
$server_by_ip
[
$ip
]
:
''
)
,
'onclick'
=>
''
,
'fill_text'
=>
$ip
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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