-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathapache-groupware.php
executable file
·75 lines (59 loc) · 2.04 KB
/
apache-groupware.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
<?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["ApacheGroupware"])){save();exit;}
js();
function js(){
$page=CurrentPageName();
$tpl=new templates();
$title=$tpl->_ENGINE_parse_body("{APP_GROUPWARE_APACHE}");
$html="YahooWin4('575','$page?popup=yes','$title');";
echo $html;
}
function popup(){
$page=CurrentPageName();
$tpl=new templates();
$sock=new sockets();
$ApacheGroupware=$sock->GET_INFO("ApacheGroupware");
if($ApacheGroupware==null){$ApacheGroupware=1;}
$p=Paragraphe_switch_img("{ENABLE_APACHE_GROUPWARE}","{APP_GROUPWARE_APACHE_TEXT}","ApacheGroupware",$ApacheGroupware);
$html="
<table style='width:100%'>
<tr>
<td valign='top'><img src='img/apache-groupeware-128.png'>
<td>$p<hr>
<div style='width:100%;text-align:right'>". button("{apply}","EnableDisableApacheGroupWare()")."</div>
</td>
</tr>
</table>
<script>
var x_EnableDisableApacheGroupWare=function (obj) {
var results=obj.responseText;
if(results.length>0){alert(results);}
YahooWin4Hide();
}
function EnableDisableApacheGroupWare(){
var XHR = new XHRConnection();
XHR.appendData('ApacheGroupware',document.getElementById('ApacheGroupware').value);
document.getElementById('img_ApacheGroupware').src='img/wait_verybig.gif';
XHR.sendAndLoad('$page', 'GET',x_EnableDisableApacheGroupWare);
}
</script>";
echo $tpl->_ENGINE_parse_body($html);
}
function save(){
$sock=new sockets();
$sock->SET_INFO("ApacheGroupware",$_GET["ApacheGroupware"]);
$sock->SET_INFO("ShowApacheGroupware",$_GET["ApacheGroupware"]);
$sock->getFrameWork("cmd.php?RestartApacheGroupwareForce=yes");
}