-
Notifications
You must be signed in to change notification settings - Fork 1
/
download.php
66 lines (54 loc) · 1.17 KB
/
download.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
include("model.classes.php");
include_once("controller.guard.php");
if ( isset($_GET['dl']) )
{
if ( $_GET['dl']=="rdp" )
{
if ( isset($_GET['server']) )
{
$a_server = new user_server();
$a_server->get_from_hashrange($u->id_user,$_GET['server']);
if ($a_server->id_user!="undefined")
{
$ip_address=$a_server->ip_address;
$rdp_content="auto connect:i:1\r\nfull address:s:$ip_address\r\nusername:s:Administrator";
file_download($a_server->name.".rdp",$rdp_content);
exit;
}
}
}
}
$qn="";
if ( isset($_GET['q']) )
{
$qn=$_GET['q'];
}
if ( strlen($qn)>0 )
{
if ( isset($_GET['file']) )
{
if ($_GET['file']=="hisfunctionxmlexport")
{
$u->build();
$q = new hf_id_user();
$q->get_from_hashrange($u->id_user,$qn);
$q->build();
$hf_name = $q->name;
$chars = ' !@#$%^&*()_+-=[]{}\|;\':"<>?,./;';
for ($i=0;$i<strlen($chars)-2;$i++)
{
$char = substr($chars,$i,1);
$hf_name = str_replace($char,"_",$hf_name);
}
//$hf_name = urlencode($hf_name);
$hf_name = "".$hf_name.".hf.xml";
$export=$q->toxml(true);
$export=$q->toxml(true);
file_download($hf_name,$export);
exit;
}
}
} // end if
exit;
?>