forked from dtouzeau/artica-1.5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclamav.unofficial.php
executable file
·102 lines (76 loc) · 2.16 KB
/
clamav.unofficial.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
101
102
<?php
include_once('ressources/class.templates.inc');
include_once('ressources/class.users.menus.inc');
if(!GetRigths()){
$tpl=new templates();
echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
die();exit();
}
if(isset($_GET["popup"])){popup();exit;}
if(isset($_GET["enable_clamav_unofficial"])){save();exit;}
js();
function js(){
$tpl=new templates();
$clamav_unofficial=$tpl->_ENGINE_parse_body("{clamav_unofficial}");
$page=CurrentPageName();
$html="
function clamav_unofficial(){
YahooWin2('400','$page?popup=yes','$clamav_unofficial');
}
clamav_unofficial();
";
echo $html;
}
function popup(){
$page=CurrentPageName();
$sock=new sockets();
$EnableClamavUnofficial=$sock->GET_INFO("EnableClamavUnofficial");
$tpl=new templates();
$level=Paragraphe_switch_img('{enable_clamav_unofficial}',"{clamav_unofficial_text}",
"enable_clamav_unofficial",$EnableClamavUnofficial,null,550);
$html="
<table style='widht:100%'>
<tr>
<td valign='top'>
<div id='enable_clamav_unofficial_id'>
$level
</div>
</td>
</tr>
<tr>
<td valign='top' align='right'>
<hr>". button("{apply}","clamav_unofficial_save()")."
</td>
</tr>
</table>
<script>
var x_clamav_unofficial_save= function (obj) {
var response=obj.responseText;
if(response){alert(response);}
YahooWin2Hide();
}
function clamav_unofficial_save(){
var XHR = new XHRConnection();
XHR.appendData('enable_clamav_unofficial',document.getElementById('enable_clamav_unofficial').value);
document.getElementById('enable_clamav_unofficial_id').innerHTML='<img src=\"img/wait_verybig.gif\">';
XHR.sendAndLoad('$page', 'GET',x_clamav_unofficial_save);
}
</script>
";
echo $tpl->_ENGINE_parse_body($html);
}
function save(){
$sock=new sockets();
$sock->SET_INFO("EnableClamavUnofficial",$_GET["enable_clamav_unofficial"]);
if($_GET["enable_clamav_unofficial"]==1){
$sock->getFrameWork("cmd.php?update-clamav=yes");
}
}
function GetRigths(){
$user=new usersMenus();
if($user->AsPostfixAdministrator){return true;}
if($user->AsSquidAdministrator){return true;}
if($user->AsSambaAdministrator){return true;}
return false;
}
?>