Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ISPConfig 3
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Dirk Dankhoff
ISPConfig 3
Commits
7b26eae1
Commit
7b26eae1
authored
Aug 27, 2015
by
Marius Cramer
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into 'master'
Master See merge request !222
parents
eb1177f6
458ad7c7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
72 additions
and
2 deletions
+72
-2
install/sql/incremental/upd_dev_collection.sql
install/sql/incremental/upd_dev_collection.sql
+2
-0
install/sql/ispconfig3.sql
install/sql/ispconfig3.sql
+1
-0
install/tpl/master_cf_amavis10025.master
install/tpl/master_cf_amavis10025.master
+1
-0
install/tpl/master_cf_amavis10027.master
install/tpl/master_cf_amavis10027.master
+1
-0
interface/lib/plugins/vm_openvz_plugin.inc.php
interface/lib/plugins/vm_openvz_plugin.inc.php
+29
-2
interface/web/vm/form/openvz_vm.tform.php
interface/web/vm/form/openvz_vm.tform.php
+6
-0
interface/web/vm/openvz_vm_edit.php
interface/web/vm/openvz_vm_edit.php
+13
-0
interface/web/vm/templates/openvz_vm_additional_ip_edit.htm
interface/web/vm/templates/openvz_vm_additional_ip_edit.htm
+19
-0
No files found.
install/sql/incremental/upd_dev_collection.sql
View file @
7b26eae1
...
...
@@ -166,3 +166,5 @@ CREATE TABLE `server_ip_map` (
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
AUTO_INCREMENT
=
1
;
ALTER
TABLE
`web_domain`
ADD
COLUMN
`rewrite_to_https`
ENUM
(
'y'
,
'n'
)
NOT
NULL
DEFAULT
'n'
AFTER
`seo_redirect`
;
ALTER
TABLE
openvz_ip
ADD
COLUMN
`additional`
VARCHAR
(
255
)
NOT
NULL
DEFAULT
'n'
;
install/sql/ispconfig3.sql
View file @
7b26eae1
...
...
@@ -1004,6 +1004,7 @@ CREATE TABLE IF NOT EXISTS `openvz_ip` (
`ip_address`
varchar
(
39
)
DEFAULT
NULL
,
`vm_id`
int
(
11
)
NOT
NULL
DEFAULT
'0'
,
`reserved`
varchar
(
255
)
NOT
NULL
DEFAULT
'n'
,
`additional`
varchar
(
255
)
NOT
NULL
DEFAULT
'n'
,
PRIMARY
KEY
(
`ip_address_id`
)
)
ENGINE
=
MyISAM
DEFAULT
CHARSET
=
utf8
;
...
...
install/tpl/master_cf_amavis10025.master
View file @
7b26eae1
...
...
@@ -12,4 +12,5 @@
-o strict_rfc821_envelopes=yes
-o receive_override_options=no_unknown_recipient_checks,no_header_body_checks
-o smtp_send_xforward_command=yes
-o disable_dns_lookups=yes
install/tpl/master_cf_amavis10027.master
View file @
7b26eae1
...
...
@@ -14,4 +14,5 @@
-o smtp_send_xforward_command=yes
-o milter_default_action=accept
-o milter_macro_daemon_name=ORIGINATING
-o disable_dns_lookups=yes
interface/lib/plugins/vm_openvz_plugin.inc.php
View file @
7b26eae1
...
...
@@ -60,6 +60,14 @@ class vm_openvz_plugin {
// Set the IP address
$app
->
db
->
query
(
"UPDATE openvz_ip SET vm_id = ? WHERE ip_address = ?"
,
$this
->
id
,
$this
->
dataRecord
[
'ip_address'
]);
// Set additional IPs
if
(
isset
(
$this
->
dataRecord
[
'additional_ip'
]))
{
$app
->
db
->
query
(
"UPDATE openvz_ip SET vm_id = 0, additional = 'n' WHERE vm_id = ? AND additional='y'"
,
$this
->
id
);
foreach
(
$this
->
dataRecord
[
'additional_ip'
]
as
$idx
=>
$rec
)
{
$app
->
db
->
query
(
"UPDATE openvz_ip SET vm_id = ?, additional = 'y' WHERE ip_address = ?"
,
$this
->
id
,
$rec
);
}
}
// Create the OpenVZ config file and store it in config field
$this
->
makeOpenVZConfig
();
...
...
@@ -95,8 +103,16 @@ class vm_openvz_plugin {
// Set the IP address
if
(
isset
(
$this
->
dataRecord
[
'ip_address'
]))
{
$app
->
db
->
query
(
"UPDATE openvz_ip SET vm_id = 0 WHERE vm_id = ?"
,
$this
->
id
);
$app
->
db
->
query
(
"UPDATE openvz_ip SET vm_id = ? WHERE ip_address = ?"
,
$this
->
id
,
$this
->
dataRecord
[
'ip_address'
]);
$app
->
db
->
query
(
"UPDATE openvz_ip SET vm_id = 0 WHERE vm_id = ? AND additional='n'"
,
$this
->
id
);
$app
->
db
->
query
(
"UPDATE openvz_ip SET vm_id = ?, additional = 'n' WHERE ip_address = ?"
,
$this
->
id
,
$this
->
dataRecord
[
'ip_address'
]);
}
// Set additional IPs
if
(
isset
(
$this
->
dataRecord
[
'additional_ip'
]))
{
$app
->
db
->
query
(
"UPDATE openvz_ip SET vm_id = 0, additional = 'n' WHERE (vm_id = ? AND additional='y')"
,
$this
->
id
);
foreach
(
$this
->
dataRecord
[
'additional_ip'
]
as
$idx
=>
$rec
)
{
$app
->
db
->
query
(
"UPDATE openvz_ip SET vm_id = ?, additional = 'y' WHERE ip_address = ?"
,
$this
->
id
,
$rec
);
}
}
// Create the OpenVZ config file and store it in config field
...
...
@@ -195,6 +211,17 @@ class vm_openvz_plugin {
$hostname
=
str_replace
(
'{VEID}'
,
$vm
[
'veid'
],
$vm
[
'hostname'
]);
$tpl
->
setVar
(
'hostname'
,
$hostname
);
$additional_ips
=
$app
->
db
->
queryAllRecords
(
"SELECT * FROM openvz_ip WHERE vm_id = ?"
,
$this
->
id
);
if
(
isset
(
$additional_ips
))
{
$vm
[
'ip_address'
]
=
''
;
foreach
(
$additional_ips
as
$ip
)
{
$vm
[
'ip_address'
]
.
=
" "
.
$ip
[
'ip_address'
];
}
$vm
[
'ip_address'
]
=
substr
(
$vm
[
'ip_address'
],
1
);
}
$tpl
->
setVar
(
'ip_address'
,
$vm
[
'ip_address'
]);
$tpl
->
setVar
(
'ip_address'
,
$vm
[
'ip_address'
]);
$tpl
->
setVar
(
'nameserver'
,
$vm
[
'nameserver'
]);
$tpl
->
setVar
(
'capability'
,
$vm
[
'capability'
]);
...
...
interface/web/vm/form/openvz_vm.tform.php
View file @
7b26eae1
...
...
@@ -327,6 +327,12 @@ if($_SESSION["s"]["user"]["typ"] == 'admin') {
//#################################
)
);
$form
[
"tabs"
][
'additional_ip'
]
=
array
(
'title'
=>
"Additional IP"
,
'width'
=>
100
,
'template'
=>
"templates/openvz_vm_additional_ip_edit.htm"
,
);
}
...
...
interface/web/vm/openvz_vm_edit.php
View file @
7b26eae1
...
...
@@ -178,6 +178,19 @@ class page_action extends tform_actions {
$app
->
tpl
->
setVar
(
"ip_address"
,
$ip_select
);
unset
(
$tmp
);
unset
(
$ips
);
//* Additional IPs
$sql
=
"SELECT * FROM openvz_ip WHERE reserved = 'n' AND ((vm_id = ? AND additional='y') OR vm_id = 0) AND server_id = ?"
;
$additional_ips
=
$app
->
db
->
queryAllRecords
(
$sql
,
$this
->
id
,
$vm_server_id
);
foreach
(
$additional_ips
as
$idx
=>
$rec
)
{
$temp
.
=
"<input type='hidden' id='id"
.
$idx
.
"' name='additional_ip["
.
$idx
.
"]' name='additional_ip["
.
$idx
.
"]' value='0'>"
;
$used
=
@
(
$rec
[
'additional'
]
==
'y'
)
?
'CHECKED'
:
''
;
$temp
.
=
"<input type='checkbox' value='"
.
$rec
[
'ip_address'
]
.
"' id='id"
.
$idx
.
"' name='additional_ip["
.
$idx
.
"]' "
.
$used
.
"> "
.
$rec
[
'ip_address'
]
.
"<br>"
;
}
$app
->
tpl
->
setVar
(
"additional_ip"
,
$temp
);
unset
(
$used
);
unset
(
$temp
);
unset
(
$additional_ips
);
if
(
$this
->
id
>
0
)
{
//* we are editing a existing record
...
...
interface/web/vm/templates/openvz_vm_additional_ip_edit.htm
0 → 100644
View file @
7b26eae1
<div
class=
'page-header'
></div>
<p><tmpl_var
name=
"list_desc_txt"
></p>
<legend>
Additional IPs
</legend>
<div
class=
"form-group"
>
<div
class=
"col-sm-3"
>
{tmpl_var name='additional_ip'}
</div>
</div>
<input
type=
"hidden"
name=
"id"
value=
"{tmpl_var name='id'}"
>
<div
class=
"clear"
><div
class=
"right"
>
<button
class=
"btn btn-default formbutton-success"
type=
"button"
value=
"{tmpl_var name='btn_save_txt'}"
data-submit-form=
"pageForm"
data-form-action=
"vm/openvz_vm_edit.php"
>
{tmpl_var name='btn_save_txt'}
</button>
<button
class=
"btn btn-default formbutton-default"
type=
"button"
value=
"{tmpl_var name='btn_cancel_txt'}"
data-load-content=
"vm/openvz_vm_list.php"
>
{tmpl_var name='btn_cancel_txt'}
</button>
</div></div>
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