forked from poppyred/1.6.x
/
squid.bubble.php
executable file
·91 lines (78 loc) · 2.64 KB
/
squid.bubble.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
<?php
if(isset($_GET["verbose"])){$GLOBALS["VERBOSE"]=true;ini_set('display_errors', 1);ini_set('error_reporting', E_ALL);ini_set('error_prepend_string',null);ini_set('error_append_string',null);}
include_once('ressources/class.templates.inc');
include_once('ressources/class.ldap.inc');
include_once('ressources/class.users.menus.inc');
include_once('ressources/class.squid.inc');
$usersmenus=new usersMenus();
if(!$usersmenus->AsSquidAdministrator){
$tpl=new templates();
$alert=$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}');
echo "alert('$alert');";
die();
}
if(isset($_GET["popup"])){popup();exit;}
if(isset($_POST["SquidBubbleMode"])){SquidBubbleMode();exit;}
js();
function js(){
header("content-type: application/x-javascript");
$page=CurrentPageName();
$tpl=new templates();
$YahooWin=2;
if(isset($_GET["YahooWin"])){$YahooWin=$_GET["YahooWin"];$YahooWinUri="&YahooWin={$_GET["YahooWin"]}";}
$title=$tpl->_ENGINE_parse_body("{HotSpot}");
$html="
var YahooWinx=$YahooWin;
if(YahooWinx==2){
YahooWin2Hide();
YahooWin6Hide();
}
YahooWin$YahooWin('700','$page?popup=yes$YahooWinUri','$title')";
echo $html;
}
function popup(){
$tpl=new templates();
$sock=new sockets();
$page=CurrentPageName();
$t=time();
$EnableRemoteStatisticsAppliance=0;
$SquidBubbleMode=$sock->GET_INFO('SquidBubbleMode');
if(!is_numeric($SquidBubbleMode)){$SquidBubbleMode=0;}
$html="
<div id='$t-animate'></div>
<div id='$t' class=explain style='font-size:14px'>{bubble_mode_explain}</div>
<div id='$t' class=explain style='font-size:14px'>{advanced_settings_in_miniadm}</div>
<table style='width:99%' class=form>
<tr>
<td colspan=2>". Paragraphe_switch_img("{activate_bubble_mode}","{activate_bubble_explain}",
"SquidBubbleMode",$SquidBubbleMode,null,"450")."
</td>
</tr>
<tr>
<td colspan=2 align='right'><hr>". button("{apply}","SaveHotSpot$t()","16px")."</td>
</tr>
</table>
<script>
var x_SaveHotSpot$t= function (obj) {
var results=obj.responseText;
if(results.length>3){alert(results);}
document.getElementById('$t-animate').innerHTML='';
Loadjs('squid.compile.progress.php');
RefreshTab('squid_main_svc');
}
function SaveHotSpot$t(){
var lock=$EnableRemoteStatisticsAppliance;
if(lock==1){Loadjs('squid.newbee.php?error-remote-appliance=yes');return;}
var XHR = new XHRConnection();
XHR.appendData('SquidBubbleMode',document.getElementById('SquidBubbleMode').value);
AnimateDiv('$t-animate');
XHR.sendAndLoad('$page', 'POST',x_SaveHotSpot$t);
}
</script>
";
echo $tpl->_ENGINE_parse_body($html);
}
function SquidBubbleMode(){
$sock=new sockets();
$sock->SET_INFO("SquidBubbleMode", $_POST["SquidBubbleMode"]);
}