forked from dtouzeau/artica-1.5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clamav.enable.php
executable file
·74 lines (58 loc) · 1.94 KB
/
clamav.enable.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
<?php
session_start();
if($_SESSION["uid"]==null){echo "window.location.href ='logoff.php';";die();}
include_once('ressources/class.templates.inc');
include_once('ressources/class.ldap.inc');
include_once('ressources/class.users.menus.inc');
$user=new usersMenus();
if($user->AsPostfixAdministrator==false){
$tpl=new templates();
echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
die();exit();
}
if(isset($_GET["popup"])){popup();exit;}
if(isset($_GET["EnableClamavDaemon"])){save();exit;}
js();
function js(){
$page=CurrentPageName();
$tpl=new templates();
$title=$tpl->_ENGINE_parse_body("{ENABLE_CLAMAV}");
$html="YahooWin4('575','$page?popup=yes','$title');";
echo $html;
}
function popup(){
$page=CurrentPageName();
$tpl=new templates();
$sock=new sockets();
$EnableClamavDaemon=$sock->GET_INFO("EnableClamavDaemon");
if($EnableClamavDaemon==null){$EnableClamavDaemon=1;}
$p=Paragraphe_switch_img("{ENABLE_CLAMAV}","{ENABLE_CLAMAV_TEXT}","EnableClamavDaemon",$EnableClamavDaemon);
$html="
<table style='width:100%'>
<tr>
<td valign='top'><img src='img/clamav-104.png'>
<td>$p<hr>
<div style='width:100%;text-align:right'>". button("{apply}","EnableClamavDaemonSave()")."</div>
</td>
</tr>
</table>
<script>
var x_EnableClamavDaemonSave=function (obj) {
var results=obj.responseText;
if(results.length>0){alert(results);}
YahooWin4Hide();
}
function EnableClamavDaemonSave(){
var XHR = new XHRConnection();
XHR.appendData('EnableClamavDaemon',document.getElementById('EnableClamavDaemon').value);
document.getElementById('img_EnableClamavDaemon').src='img/wait_verybig.gif';
XHR.sendAndLoad('$page', 'GET',x_EnableClamavDaemonSave);
}
</script>";
echo $tpl->_ENGINE_parse_body($html);
}
function save(){
$sock=new sockets();
$sock->SET_INFO("EnableClamavDaemon",$_GET["EnableClamavDaemon"]);
$sock->getFrameWork("cmd.php?clamd-restart=yes");
}