/
postfix.status.allservices.php
59 lines (44 loc) · 1.44 KB
/
postfix.status.allservices.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
<?php
if(posix_getuid()==0){die();}
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');
include_once('ressources/class.ini.inc');
include_once('ressources/class.main_cf.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;}
js();
function js(){
$page=CurrentPageName();
$tpl=new templates();
$title="{POSTFIX_ALL_SERVICES}";
$html="YahooWin6(550,'$page?popup=yes','$title')";
echo $html;
}
function popup(){
$tpl=new templates();
if(is_file("ressources/logs/global.status.ini")){
$ini=new Bs_IniHandler("ressources/logs/global.status.ini");
}else{
writelogs("ressources/logs/global.status.ini no such file");
$sock=new sockets();
$datas=base64_decode($sock->getFrameWork('cmd.php?Global-Applications-Status=yes'));
$ini=new Bs_IniHandler($datas);
}
$sock=new sockets();
$datas=$sock->getFrameWork('cmd.php?refresh-status=yes');
$array=array_postfix_status();
while (list ($num, $ligne) = each ($array) ){
$st=DAEMON_STATUS_LINE($ligne,$ini,null,1);
if($st==null){continue;}
$status=$status .$st."\n";
}
echo $tpl->_ENGINE_parse_body($status);
}