forked from Seitanas/kvm-vdi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebsocket.php
More file actions
33 lines (33 loc) · 796 Bytes
/
websocket.php
File metadata and controls
33 lines (33 loc) · 796 Bytes
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
33
<?php
/*
KVM-VDI
Tadas Ustinavičius
2016-09-05
Vilnius, Lithuania.
*/
include ('functions/config.php');
require_once('functions/functions.php');
if (!check_client_session()&&!check_session()){
header ("Location: $serviceurl/?error=1");
exit;
}
slash_vars();
$token=$_POST['token'];
$value=$_POST['value'];
if (empty($token)||empty($value)){
exit;
}
if (!file_exists('/tmp/kvm-vdi/')) {
mkdir('/tmp/kvm-vdi', 0777, true);
}
$token=remove_specialchars($token);
$value=str_replace('/','',$value);
$value=str_replace(' ','',$value);
$value=str_replace('$','',$value);
$value=str_replace('(','',$value);
$value=str_replace('"','',$value);
$value=str_replace("'",'',$value);
$value=str_replace(')','',$value);
file_put_contents("/tmp/kvm-vdi/$token","$token: $value");
echo "OK";
exit;