Skip to content
Snippets Groups Projects
Commit 9c930e0b authored by tbrehm's avatar tbrehm
Browse files

VM module: IP was not freed when VM is deleted.

VM module: Error in SQL query to select a template.
parent 967a4ace
No related branches found
No related tags found
No related merge requests found
...@@ -49,6 +49,14 @@ $app->uses('tpl,tform'); ...@@ -49,6 +49,14 @@ $app->uses('tpl,tform');
$app->load('tform_actions'); $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."'");
}
} }
......
...@@ -183,14 +183,6 @@ class page_action extends tform_actions { ...@@ -183,14 +183,6 @@ 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."'");
}
function applyTemplate() { function applyTemplate() {
global $app, $conf; global $app, $conf;
......
...@@ -77,7 +77,7 @@ class openvz_plugin { ...@@ -77,7 +77,7 @@ class openvz_plugin {
return; return;
} }
$tmp = $app->db->queryOneRecord("SELECT template_file FROM openvz_ostemplate WHERE ostemplate_id = ".$vm['ostemplate_id']); $tmp = $app->db->queryOneRecord("SELECT template_file FROM openvz_ostemplate WHERE ostemplate_id = ".$data['new']['ostemplate_id']);
$ostemplate = escapeshellcmd($tmp['template_file']); $ostemplate = escapeshellcmd($tmp['template_file']);
unset($tmp); unset($tmp);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment