forked from Seitanas/kvm-vdi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
backend.php
32 lines (32 loc) · 1.08 KB
/
backend.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');
slash_vars();
$pass=$_POST['pass'];
if (isset($_POST['vm']))
$vm=$_POST['vm'];
if (isset($_POST['spice_password']))
$spice_password=$_POST['spice_password'];
$spice_port='';
if (isset($_POST['spice_port']))
$spice_port=$_POST['spice_port'];
if ($pass==$backend_pass){
if (isset($_POST['data']))
$data=$_POST['data'];
if (isset($vm)&&isset($data)){
if ($data<100)
add_SQL_line("UPDATE vms SET filecopy='$data' WHERE id='$vm'");
else
add_SQL_line("UPDATE vms SET filecopy='' WHERE id='$vm'");
}
if(isset($vm)&&isset($spice_password)){
$spice_password=$_POST['spice_password'];
if ($engine=='OpenStack')
add_SQL_line("UPDATE vms SET spice_password='$spice_password', osInstancePort='$spice_port' WHERE osInstanceName='$vm'");
else
add_SQL_line("UPDATE vms SET spice_password='$spice_password' WHERE name='$vm'");
$v_reply=get_SQL_line("SELECT snapshot FROM vms WHERE name='$vm'");
echo $v_reply[0];
}
}
?>