forked from poppyred/1.6.x
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rsync.server.folders.php
executable file
·82 lines (54 loc) · 1.53 KB
/
rsync.server.folders.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
include_once(dirname(__FILE__)."/ressources/class.user.inc");
include_once(dirname(__FILE__)."/ressources/class.templates.inc");
include_once(dirname(__FILE__)."/ressources/class.rsync.inc");
$users=new usersMenus();
if(!$users->AsAnAdministratorGeneric){
$error=$tpl->_ENGINE_parse_body("{ERROR_NO_PRIVS}");
echo "alert('$error')";
die();
}
if(isset($_GET["popup"])){popup();exit;}
if(isset($_GET["dev-list"])){popup_list();exit;}
js();
function js(){
$page=CurrentPageName();
$tpl=new templates();
$title=$tpl->_ENGINE_parse_body('{APP_RSYNC_FOLDERS}');
$html="
YahooWin4(500,'$page?popup=yes','$title')";
echo $html;
}
function popup(){
$page=CurrentPageName();
$html=RoundedLightWhite("<div style='width:100%;height:250px;overflow:auto' id='APP_RSYNC_FOLDERS'></div>")."
<script>
LoadAjax('APP_RSYNC_FOLDERS','$page?dev-list=yes');
</script>
";
$tpl=new templates();
echo $tpl->_ENGINE_parse_body($html);
}
function popup_list(){
$rsync=new rsync();
if(!is_array($rsync->ou_storages)){return null;}
$html="<table class=form style='width:99%'>
<tr>
<th>{organization}</th>
<th>{mounted}</th>
</tr>
";
while (list ($num, $array) = each ($rsync->ou_storages) ){
if($bg=="#cce0df"){$bg="#FFFFFF";}else{$bg="#cce0df";}
$html=$html."
<tr style='background-color:$bg'>
<td><strong>{$array["OU"]}</strong></td>
<td><strong>{$array["mounted"]}</strong></td>
</tr>
";
}
$html=$html."</table>";
$tpl=new templates();
echo $tpl->_ENGINE_parse_body($html);
}
?>