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
Dirk Dankhoff
ISPConfig 3
Commits
deff20f9
Commit
deff20f9
authored
Jul 22, 2011
by
tbrehm
Browse files
Bugfixes in VM module.
parent
46598e0a
Changes
3
Show whitespace changes
Inline
Side-by-side
interface/lib/plugins/vm_openvz_plugin.inc.php
View file @
deff20f9
...
@@ -23,6 +23,7 @@ class vm_openvz_plugin {
...
@@ -23,6 +23,7 @@ class vm_openvz_plugin {
//* Register for events
//* Register for events
$app
->
plugin
->
registerEvent
(
'vm:openvz_vm:on_after_insert'
,
'vm_openvz_plugin'
,
'openvz_vm_insert'
);
$app
->
plugin
->
registerEvent
(
'vm:openvz_vm:on_after_insert'
,
'vm_openvz_plugin'
,
'openvz_vm_insert'
);
$app
->
plugin
->
registerEvent
(
'vm:openvz_vm:on_after_update'
,
'vm_openvz_plugin'
,
'openvz_vm_update'
);
$app
->
plugin
->
registerEvent
(
'vm:openvz_vm:on_after_update'
,
'vm_openvz_plugin'
,
'openvz_vm_update'
);
$app
->
plugin
->
registerEvent
(
'vm:openvz_vm:on_after_delete'
,
'vm_openvz_plugin'
,
'openvz_vm_delete'
);
}
}
/*
/*
...
@@ -105,6 +106,16 @@ class vm_openvz_plugin {
...
@@ -105,6 +106,16 @@ class vm_openvz_plugin {
}
}
function
openvz_vm_delete
(
$event_name
,
$page_form
)
{
global
$app
,
$conf
;
//* Free the IP address
$tmp
=
$app
->
db
->
queryOneRecord
(
"SELECT ip_address_id FROM openvz_ip WHERE vm_id = "
.
$page_form
->
id
);
$app
->
db
->
datalogUpdate
(
'openvz_ip'
,
'vm_id = 0'
,
'ip_address_id'
,
$tmp
[
'ip_address_id'
]);
unset
(
$tmp
);
}
private
function
applyTemplate
()
{
private
function
applyTemplate
()
{
global
$app
,
$conf
;
global
$app
,
$conf
;
...
...
interface/web/vm/openvz_vm_del.php
View file @
deff20f9
...
@@ -50,14 +50,6 @@ $app->load('tform_actions');
...
@@ -50,14 +50,6 @@ $app->load('tform_actions');
class
page_action
extends
tform_actions
{
class
page_action
extends
tform_actions
{
function
onAfterDelete
()
{
global
$app
,
$conf
;
//* Release all IP addresses which are assigned to this VM
$app
->
db
->
query
(
"UPDATE openvz_ip SET vm_id = 0 WHERE vm_id = '"
.
$this
->
id
.
"'"
);
}
}
}
$page
=
new
page_action
;
$page
=
new
page_action
;
...
...
server/plugins-available/openvz_plugin.inc.php
View file @
deff20f9
<?php
<?php
/*
/*
Copyright (c) 20
09
, Till Brehm, projektfarm Gmbh
Copyright (c) 20
11
, Till Brehm, projektfarm Gmbh
All rights reserved.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
Redistribution and use in source and binary forms, with or without modification,
...
...
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