-
Notifications
You must be signed in to change notification settings - Fork 82
/
vm_update.php
32 lines (32 loc) · 1.14 KB
/
vm_update.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
include ('functions/config.php');
require_once('functions/functions.php');
if (!check_session()){
header ("Location: $serviceurl/?error=1");
exit;
}
slash_vars();
$vm=$_POST['vm'];
$hypervisor=$_POST['hypervisor'];
$snapshot=$_POST['snapshot'];
$snapshot=str_replace("on","true",$snapshot);
$shapshot=str_replace("off","false",$snapshot);
if (empty ($snapshot))
$snapshot="false";
$source_volume=$_POST['source_volume'];
$machine_type=$_POST['machine_type'];
if (isset($_POST['os_type']));
$os_type=$_POST['os_type'];
if ($machine_type=="simplemachine"||$machine_type=="sourcemachine")
$source_volume="";
if (empty($vm) && empty($hypervisor) && $engine!='OpenStack'){
header("Location: $serviceurl/dashboard.php");
exit;
}
if ($engine != 'OpenStack'){
add_SQL_line("UPDATE vms SET snapshot='$snapshot',source_volume='$source_volume',machine_type='$machine_type', os_type='$os_type' WHERE id='$vm'");
header("Location: $serviceurl/dashboard.php");
exit;
}
else
add_SQL_line("UPDATE vms SET snapshot='$snapshot',source_volume='$source_volume',machine_type='$machine_type', os_type='$os_type' WHERE osInstanceId='$vm'");