-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathclamav.update.php
100 lines (72 loc) · 2.32 KB
/
clamav.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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
session_start();
include_once('ressources/class.templates.inc');
include_once('ressources/class.ldap.inc');
include_once('ressources/class.sockets.inc');
if(isset($_GET["page"])){page();exit;}
if(isset($_GET["events"])){events();exit;}
js();
function js(){
$tpl=new templates();
$title=$tpl->_ENGINE_parse_body('{UPDATE_CLAMAV}');
$page=CurrentPageName();
$html="
var FreshClam_timerID = null;
var FreshClam_tant=0;
var FreshClam_reste=0;
function FreshClam_demarre(){
FreshClam_tant = FreshClam_tant+1;
FreshClam_reste=FreshClam_tant;
if(!YahooWin5Open()){return false;}
if (FreshClam_tant <10 ) {
FreshClam_timerID = setTimeout(\"FreshClam_demarre()\",1000);
} else {
FreshClam_tant = 0;
FreshClam_ChargeLogs();
FreshClam_demarre(); //la boucle demarre !
}
}
function FreshClam_ChargeLogs(){
LoadAjax('freshclamevents','$page?events=yes');
}
function LoadFreshClam(){
YahooWin5(750,'$page?page=yes','$title');
setTimeout(\"FreshClam_Start()\",1000);
}
function FreshClam_Start(){
if(document.getElementById('dialog5').innerHTML.length==0){
setTimeout(\"FreshClam_Start()\",1000);
return false;
}
setTimeout(\"FreshClam_ChargeLogs()\",1000);
FreshClam_demarre();
}
LoadFreshClam();
";
echo $html;
}
function page(){
$html="<H1>{UPDATE_CLAMAV}</H1>
<div style='width:100%;text-align:right;float:right'><input type='button' OnClick=\"javascript:FreshClam_ChargeLogs();\" value='{refresh} »'></div><p class=caption>{UPDATE_CLAMAV_EXPLAIN}</p>
<div style='width:100%;height:250px;overflow:auto' id='freshclamevents'></div>";
$sock=new sockets();
$sock->getfile('FreshClamStartDebug');
$tpl=new templates();
echo $tpl->_ENGINE_parse_body($html);
}
function events(){
$sock=new sockets();
$datas=$sock->getfile('FreshClamStartLoadDebug');
$tbl=explode("\n",$datas);
$html="<table style='width:100%'>";
$count=0;
while (list ($num, $ligne) = each ($tbl) ){
if(trim($ligne)==null){continue;}
$count=$count+1;
$ligne=htmlentities($ligne);
$html=$html . "<tr><td width=1%>$count. </td><td><div style='font-size:11px'><code>$ligne</code></div></td></tr>\n";
}
$html=$html . "</table>";
echo RoundedLightWhite($html);
}
?>