예제 #1
0
function page()
{
    $users = new usersMenus();
    $title = $users->hostname . " For Android/Tablets Login.";
    include_once dirname(__FILE__) . "/ressources/class.page.builder.inc";
    $p = new pagebuilder();
    $jsArtica = $p->jsArtica();
    $yahoo = $p->YahooBody();
    $css = $p->headcss();
    $q = new mysql_squid_builder();
    $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM visited_sites WHERE LENGTH(category)=0"));
    $websitesnumsNot = numberFormat($ligne["tcount"], 0, "", " ");
    $html = "\n\t<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n  <meta http-equiv=\"X-UA-Compatible\" content=\"IE=9; IE=8\">\n  <meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-type\" />\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"/css/artica-theme/jquery-ui.custom.css\" />\n  <link rel=\"stylesheet\" type=\"text/css\" href=\"/css/jquery.jgrowl.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/jquery.cluetip.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/jquery.treeview.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/thickbox.css\" media=\"screen\"/>\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/jquery.qtip.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"/fonts.css.php\"/>\n\t\t\n{$css}\n  <title>{$title}</title>\n{$jsArtica}\n<link rel=\"stylesheet\" type=\"text/css\" href=\"/css/android.css\" />\n</head>\n\n<body style=\"margin:0px;padding:0px\">\n<div style=\"postition:absolute;top:0px;left:80%;width:980px;min-height:490px;overflow-y:auto\">\n\t\n\t<table style='width:980px;'>\n\t<tr>\n\t<td valign='top' width=5%>\n\t            <ul class=\"vertical fl\" rel=\"ver1\">\n                <li><a href=\"android.index.php\">{home}</a><span>{main_page}</span></li>\n                <li><a href=\"javascript:LoadAjax('mainpage','android.squidstats.members.php')\">{members}</a><span>{list_your_members}</span></li>\n                <li><a href=\"#\">Under construction</a><span>to define</span></li>\n                <li><a href=\"#\">Under construction</a><span>Under construction</span></li>\n                <li><a href=\"javascript:LoadAjax('mainpage','android.squidstats.nocat.php')\"\">{not_categorized}</a><span><b>{$websitesnumsNot}</b> {websites} {not_categorized}</span></li>\n                <li><a rel=\"#\">About</a><span>{parameters}</span></li>\n            </ul>\n   </td>\n   <td valign='top' width=95%>\n   \t<table style='width:103.5%;margin-left:-23px;margin-top:2px' class=form>\n   \t\t<tr>\n   \t\t\t<td style='margin:0px;padding:0px;border:0px'>\n   \t\t\t\t<div style='margin:0px;padding:0px;border:0px;min-height:475px;height:475px;overflow:auto' id='mainpage'></div>\n   \t\t\t</td>\n   \t\t</tr>\n   \t</table>\n   </tr>\n\t</table>\n</div>\n<script>\n\tLoadAjax('mainpage','android.index.server.php');\n</script>\n{$yahoo}\n</body>\n</html>\n\t\n\t";
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body($html);
}
예제 #2
0
function page()
{
    $template = "android";
    $page = CurrentPageName();
    $users = new usersMenus();
    $tplE = new templates();
    $title = $users->hostname . " For Android/Tablets Login.";
    include_once dirname(__FILE__) . "/ressources/class.page.builder.inc";
    $p = new pagebuilder();
    $jsArtica = $p->jsArtica();
    $tpl = @file_get_contents("ressources/templates/android/logon.html");
    $tpl = str_replace("{TEMPLATE_LANG_LINK}", "", $tpl);
    $tpl = str_replace("{TEMPLATE_BODY_YAHOO}", $p->YahooBody(), $tpl);
    $tpl = str_replace("{TEMPLATE_HEAD}", "<!-- HEAD TITLE: {$TITLE_RESSOURCE} -->\n{$favicon}\n{$jquery}\n{$jsArtica}\n" . @implode("\n", $js) . "\n{$jslogon}\n" . @implode("\n", $css) . "\n" . @implode("\n", $log), $tpl);
    $sock = new sockets();
    $TITLE_RESSOURCE = "ressources/templates/{$template}/TITLE";
    $favicon = $p->favicon($template);
    if (is_file($TITLE_RESSOURCE)) {
        $title = @file_get_contents($TITLE_RESSOURCE);
        $title = str_replace("%server", $users->hostname, $title);
    } else {
        $title = $users->hostname;
    }
    $tpl = str_replace("{COPYRIGHT}", "Copyright 2006 - " . date('Y') . $lang2Link, $tpl);
    $tpl = str_replace("{copy-right}", "Copyright 2006 - " . date('Y') . $lang2Link, $tpl);
    $tpl = str_replace("{TEMPLATE_HEAD}", "<!-- HEAD TITLE: {$TITLE_RESSOURCE} -->\n{$favicon}\n{$jquery}\n{$jsArtica}\n" . @implode("\n", $js) . "\n{$jslogon}\n" . @implode("\n", $css) . "\n" . @implode("\n", $log), $tpl);
    $tpl = str_replace("{ARTICA_VERSION}", @file_get_contents("VERSION"), $tpl);
    $tpl = str_replace("{SQUID_VERSION}", $users->SQUID_VERSION, $tpl);
    $tpl = str_replace("{POSTFIX_VERSION}", $users->POSTFIX_VERSION, $tpl);
    $tpl = str_replace("{SAMBA_VERSION}", $users->SAMBA_VERSION, $tpl);
    $tpl = str_replace("{CROSSROADS_VERSION}", $users->CROSSROADS_VERSION, $tpl);
    $tpl = str_replace("{APACHE_VERSION}", $users->APACHE_VERSION, $tpl);
    $tpl = str_replace("{TEMPLATE_TITLE_HEAD}", $title, $tpl);
    $tpl = str_replace("{MEM_ACCOUNT}", $_COOKIE["mem-logon-user"], $tpl);
    $button = $tplE->_ENGINE_parse_body(button("{login}", "SendLogonStart()", "22px"));
    $tpl = str_replace("{LOGON_BUTTON}", $button, $tpl);
    $tpl = $tplE->_ENGINE_parse_body($tpl);
    $scripts = "\n\t<script>\n\tfunction SendLogon(e){\n\t\tif(checkEnter(e)){SendLogonStart();}\n\t}\n\t\nvar x_AndroidLogon=function(obj){\n\t if(document.getElementById('anim')){document.getElementById('anim').innerHTML='';}\n\t if(document.getElementById('YouCanAnimateIt')){document.getElementById('YouCanAnimateIt').innerHTML='';}\n     var tempvalue=obj.responseText;\n\t var re = new RegExp(/location:(.+)/);\n\t m=re.exec(tempvalue);\n\t  if(m){\n\t\tvar url=m[1]; \n\t\t document.location.href=url;\n\t\t return ;\n      }\t \n\t alert(tempvalue);\n\t document.location.href='{$page}';\n\t}\t\n\t\n\t\n\tfunction SendLogonStart(){\n\t\tif(document.getElementById('YouCanAnimateIt')){document.getElementById('YouCanAnimateIt').innerHTML='<img src=\"/img/preloader.gif\">';}\n\t\tvar XHR = new XHRConnection();\n\t\tif(!document.getElementById('artica_username')){alert('missing tag `artica_username`');}\n\t\tif(!document.getElementById('artica_password')){alert('missing tag `artica_password`');}\n\t\tXHR.appendData('artica_username',document.getElementById('artica_username').value);\n\t\tXHR.appendData('artica_password',MD5(document.getElementById('artica_password').value));\n\t\tSet_Cookie('mem-logon-user', document.getElementById('artica_username').value, '3600', '/', '', '');\n\t\tXHR.sendAndLoad('{$page}', 'POST',x_AndroidLogon);\n\t\t\n\t}\t\n</script>\t\n\t\n\t";
    $tpl = str_replace("{SCRIPTS}", $scripts, $tpl);
    echo $tpl;
}
예제 #3
0
function parseTemplate_SinglePassWord()
{
    session_start();
    include_once dirname(__FILE__) . "/ressources/class.sockets.inc";
    include_once dirname(__FILE__) . "/ressources/class.mysql.inc";
    $sock = new sockets();
    $proto = "http";
    if (isset($_SERVER['HTTPS'])) {
        if (strtolower($_SERVER['HTTPS']) == 'on') {
            $proto = "https";
        }
    }
    $GLOBALS["JS_HEAD_PREPREND"] = "{$proto}://{$_SERVER["SERVER_NAME"]}:{$_SERVER["SERVER_PORT"]}";
    $GLOBALS["JS_NO_CACHE"] = true;
    $t = time();
    include_once dirname(__FILE__) . "/ressources/class.page.builder.inc";
    include_once dirname(__FILE__) . "/ressources/class.templates.inc";
    $page = CurrentPageName();
    $tpl = new templates();
    $ask_password = $tpl->javascript_parse_text("{password}:");
    $url = base64_decode($_GET["url"]);
    $clientaddr = base64_decode($_GET["clientaddr"]);
    $array = parse_url($url);
    $Whitehost = strtolower($array["host"]);
    $pp = new pagebuilder();
    $head = $pp->jsArtica() . "\n\n" . $pp->headcss();
    if (preg_match("#^www.(.+)#", $Whitehost, $re)) {
        $Whitehost = $re[1];
    }
    $yahoo = $pp->YahooBody();
    $t = time();
    $unlock = $tpl->_ENGINE_parse_body("{unlock}");
    $title = "{$unlock} &laquo;{$Whitehost}&raquo;";
    $html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n<html lang=\"en\">\n  <head>\n    <meta charset=\"utf-8\">\n    <title>{$ask_password}</title>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <meta name=\"description\" content=\"\">\n    <meta name=\"author\" content=\"\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/bootstrap/css/bootstrap.css\">\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"/bootstrap/css/bootstrap-responsive.css\">\n\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/mouse.js\"></script>\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/js/md5.js\"></script>\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/XHRConnection.js\"></script>\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/js/float-barr.js\"></script>\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/TimersLogs.js\"></script>\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/js/artica_confapply.js\"></script>\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/js/edit.user.js\"></script>\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/js/cookies.js\"></script>\n\t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/default.js\"></script>    \n  \t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/ressources/templates/endusers/js/jquery-1.8.0.min.js\"></script>\n  \t<script type=\"text/javascript\" language=\"javascript\" src=\"{$GLOBALS["JS_HEAD_PREPREND"]}/ressources/templates/endusers/js/jquery-ui-1.8.23.custom.min.js\"></script>\n  \t<script type='text/javascript' language='javascript' src='{$GLOBALS["JS_HEAD_PREPREND"]}/js/jquery.uilock.min.js'></script>\n  \t<script type='text/javascript' language='javascript' src='{$GLOBALS["JS_HEAD_PREPREND"]}/js/jquery.blockUI.js'></script>      \n   <style type=\"text/css\">\n     body {\n        padding-top: 40px;\n        padding-bottom: 40px;\n        background-color: #f5f5f5;\n      }\n\n      .form-signin {\n        max-width: 300px;\n        padding: 19px 29px 29px;\n        margin: 0 auto 20px;\n        background-color: #fff;\n        border: 1px solid #e5e5e5;\n        -webkit-border-radius: 5px;\n           -moz-border-radius: 5px;\n                border-radius: 5px;\n        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);\n           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);\n                box-shadow: 0 1px 2px rgba(0,0,0,.05);\n      }\n      .form-signin .form-signin-heading,\n      .form-signin .checkbox {\n        margin-bottom: 10px;\n      }\n      .form-signin input[type=\"text\"],\n      .form-signin input[type=\"password\"] {\n        font-size: 16px;\n        height: auto;\n        margin-bottom: 15px;\n        padding: 7px 9px;\n      }\n    </style>    \n    <!--[if IE]>\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"{$GLOBALS["JS_HEAD_PREPREND"]}/bootstrap/css/ie-only.css\" />\n\t<![endif]-->    \n</head>\n<body>\n<input type='hidden' id='LoadAjaxPicture' name=\"LoadAjaxPicture\" value=\"{$GLOBALS["JS_HEAD_PREPREND"]}/ressources/templates/endusers/ajax-loader-eu.gif\">\n    \n\n      <div class=\"form-signin\">\n       <div id='div-{$t}'></div>\n        <h2 class=\"form-signin-heading\">{$title}</h2>\n        <input type=\"password\" class=\"input-block-level\" placeholder=\"Password\" id=\"PASS-{$t}\">\n        <button class=\"btn btn-large btn-primary\" type=\"button\" id=\"signin\">{$unlock}</button>\n      </div>\n\n    \n \n <script type=\"text/javascript\">\n \n \$('#signin').on('click', function (e) {\n\t //if(!checkEnter(e)){return;}\n\t\tSendPass{$t}();\n\n});\n \n \n \$('.input-block-level').keypress(function (e) {\n\t\n\t if (e.which == 13) {\n\t\t SendPass{$t}();\n\t }\n\n});\n\n\n\tvar xSendPass{$t}= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){alert(tempvalue);}\n\t\tdocument.getElementById('div-{$t}').innerHTML='';\n\t\t}\n\t\t\n\tfunction SendPass{$t}(){\n\t\tvar password=MD5(document.getElementById('PASS-{$t}').value);\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('password',password);\n\t\tXHR.appendData('CLIENT','{$clientaddr}');\n\t\tXHR.appendData('Whitehost','{$Whitehost}');\n\t\tAnimateDiv('div-{$t}');\n\t\tXHR.sendAndLoad('{$GLOBALS["JS_HEAD_PREPREND"]}/{$page}', 'POST',xSendPass{$t});     \t\t\n\t}\t\n\n \n </script>\n\n</body>\n</html>";
    echo $html;
    return;
}
예제 #4
0
function page(){
	$tpl=new templates();
	$sock=new sockets();
	$XapianSearchTitle=$sock->GET_INFO("XapianSearchTitle");
	if($XapianSearchTitle==null){$XapianSearchTitle="Xapian Desktop {search}";}
	$XapianRemoveLangage=$sock->GET_INFO("XapianRemoveLangage");
	$XapianRemoveLogon=$sock->GET_INFO("XapianRemoveLogon");	
	

	
	if(!is_numeric($XapianRemoveLangage)){$XapianRemoveLangage=0;}
	if(!is_numeric($XapianRemoveLogon)){$XapianRemoveLogon=0;}	
	
	$XapianSearchTitle=$tpl->_ENGINE_parse_body("$XapianSearchTitle");
	$p=new pagebuilder();
	$page=CurrentPageName();
	$search=$tpl->_ENGINE_parse_body("{search}");
	$languageF=$tpl->_ENGINE_parse_body("{language}");
	$js=$p->jsArtica();
	$info=null;
	$cssJq=$p->JqueryUiCss("artica-theme");
	$Yahoo=$p->YahooBody();
	if (!extension_loaded('xapian')) {
		$s=php_ini_path();
		echo $tpl->_ENGINE_parse_body("<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-gb\" lang=\"en-gb\">
		<head>
			<title>$XapianSearchTitle</title>
			<link rel=\"stylesheet\" type=\"text/css\" rel=\"styleSheet\"  href=\"/ressources/templates/default/blurps.css\" />
			<link rel=\"stylesheet\" type=\"text/css\" href=\"$page?css=yes\" />
			<link href='http://fonts.googleapis.com/css?family=Questrial' rel='stylesheet' type='text/css'>
			
		</head>
		<body >
		
			<center style='margin:90px'>
				<table style='width:99%' class=form>
				<tr>
					<td width=1% valign='top'><img src='img/error-128.png'></td>
					<td valign='top' style='font-size:18px;font-family:Arial,Tahoma'>{ERROR_XAPIAN_NOEXTSION}
					</td>
				</tr>
				</table>
				<div style='width:620px;margin-top:20px' class=form>$s</div>
			</center>
			
		</center>
		</body>
		</html>
		");
		return;
		
	}
	
	$l["none"]="none";
	$l["danish"]="danish";
	$l["dutch"]="dutch";
	$l["english"]="english";
	$l["finnish"]="finnish";
	$l["french"]="french";
	$l["german"]="german";
	$l["german2"]="german2";
	$l["hungarian"]="hungarian";
	$l["italian"]="italian";
	$l["kraaij_pohlmann"]="kraaij_pohlmann";
	$l["lovins"]="lovins";
	$l["norwegian"]="norwegian";
	$l["porter"]="porter";
	$l["portuguese"]="portuguese";
	$l["romanian"]="romanian";
	$l["russian"]="russian";
	$lang="english";
	$language=Field_array_Hash($l,"lang",$_COOKIE["XAPIAN-LANG"],null,null,0,"font-size:14px");
	$login=$tpl->_ENGINE_parse_body("{login}");
	$logged_as=$tpl->_ENGINE_parse_body("{logged_as}");
	$disconnect=$tpl->_ENGINE_parse_body("{disconnect}");
	if($_COOKIE["uid"]==null){
		$logon="<a href=\"javascript:Blurz();\" OnClick=\"javascript:Loadjs('$page?logon-js=yes')\" style='text-decoration:underline;font-weight:bold'>$login</a>";
		
	}else{
		$logon="<span style='font-weight:bold'>$logged_as: {$_COOKIE["uid"]}</span>&nbsp;<a href=\"javascript:Blurz();\" OnClick=\"javascript:Loadjs('$page?loggoff-js=yes')\" style='text-decoration:underline;font-weight:bold'>$disconnect</a>";
		
		if($_COOKIE["uid"]<>null){
			if(!is_dir("/usr/share/artica-postfix/LocalDatabases/xapian-{$_COOKIE["uid"]}")){
				$info=$tpl->_ENGINE_parse_body("&nbsp;<i style='font-size:11px'>{your_home_dir_seems_not_indexed}:$HomDirectory</i>");
			}	
		}		
		
	}
	
	$langs[]="<td width=1% nowrap>$languageF:</td>";
	$langs[]="<td width=1% nowrap>$language</td>";
	
	if($XapianRemoveLangage==1){$langs=array();}
	$infos="<td width=1% nowrap>$logon$info</td>";
	if($XapianRemoveLogon==1){$infos=null;$scriptfel="Delete_Cookie('uid', '/', '');";}
	
	
	$html="
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en-gb\" lang=\"en-gb\">
	<head>
		<title>$XapianSearchTitle</title>
		<link rel=\"stylesheet\" type=\"text/css\" rel=\"styleSheet\"  href=\"/ressources/templates/default/blurps.css\" />
		<link rel=\"stylesheet\" type=\"text/css\" href=\"$cssJq\" />
		
		<link rel=\"stylesheet\" type=\"text/css\" href=\"$page?css=yes\" />
		<link href='http://fonts.googleapis.com/css?family=Questrial' rel='stylesheet' type='text/css'>
				
		$js
	</head>
	<body style='background-color:transparent'>
	$Yahoo
	<center style='margin-top:10px'>
	<table class=form style=' width: 99%;padding:50px'>
	<tr>
		<td style='font-size:22px;font-weight:bold;padding-top:15px' nowrap width=1% valign='top'>$XapianSearchTitle:</td>
		<td width=99% align='left'><input type='text' id='xapsearch' value='{$_COOKIE["XAP-SEARCH"]}' 
		style='font-size:18px;font-weight:bold;border:2px solid #CCCCCC;width:550px;padding:8px'
		OnKeyPress=\"javascript:InstantSearchQueryPress(event);\"
		>
		<table style='width:5%'>
		<tr>
			". @implode("\n", $langs)."
			$infos
		</tr>
		</table>
	</td>
	
</tr>
</table>
<div id='xapresults'></div>
	<script>
	var x_InstantSearchSave= function (obj) {
		var res=obj.responseText;
		document.getElementById('xapresults').innerHTML=res;
	}		
	
function InstantSearchQuery(){
		var xapsearch=document.getElementById('xapsearch').value;
		if(xapsearch.length<2){return;}
		var pp=encodeURIComponent(xapsearch);
		var XHR = new XHRConnection();
		document.getElementById('xapresults').innerHTML='<center style=\"width:100%\"><img src=img/wait_verybig.gif></center>';
		XHR.appendData('xapsearch',pp);
		if(document.getElementById('lang')){
			XHR.appendData('language',document.getElementById('lang').value);
			Set_Cookie('XAPIAN-LANG', document.getElementById('lang').value, '3600', '/', '', '');
		}
		Set_Cookie('XAP-SEARCH', document.getElementById('xapsearch').value, '3600', '/', '', '');
		XHR.sendAndLoad('$page', 'POST',x_InstantSearchSave);
		 		
	}
	
	
	
	function InstantSearchQueryPress(e){
		if(checkEnter(e)){InstantSearchQuery();}
	}
	
	InstantSearchQuery();
	$scriptfel	
	</script>	
	
</html>";

	
echo $html;
	
}
예제 #5
0
function buildPage()
{
    $page = CurrentPageName();
    $users = new usersMenus();
    $sock = new sockets();
    $logo = "logo.gif";
    $logo_bg = "bg_header.gif";
    $bg_color = "#005447";
    $ProductName = "Artica";
    $template = null;
    if ($users->KASPERSKY_WEB_APPLIANCE) {
        $template = "Kav4Proxy";
        $logo = "logo-kav.gif";
    }
    if ($users->ZARAFA_APPLIANCE) {
        $template = "zarafa";
        $logo = "logo-kav.gif";
    }
    if ($users->MYCOSI_APPLIANCE) {
        $logo_bg = "bg_header_kavweb.gif";
        $logo = "logo-mycosi.gif";
        $bg_color = "#FFB683";
        $ProductName = "MyCosi";
    }
    if ($template == null) {
        if ($users->SQUID_INSTALLED) {
            if (!$users->POSTFIX_INSTALLED) {
                if (!$users->SAMBA_INSTALLED) {
                    $SQUIDEnable = $sock->GET_INFO("SQUIDEnable");
                    if (!is_numeric($SQUIDEnable)) {
                        $SQUIDEnable = 1;
                    }
                    if ($SQUIDEnable == 1) {
                        $template = "Squid";
                    }
                }
            }
        }
    }
    if ($template != null) {
        $jquery = null;
        include_once dirname(__FILE__) . "/ressources/class.page.builder.inc";
        $p = new pagebuilder();
        if (is_file("ressources/templates/{$template}/logon.html")) {
        }
        $tpl = @file_get_contents("ressources/templates/{$template}/logon.html");
        foreach (glob("ressources/templates/{$template}/css/*.css") as $filename) {
            //$datas=@file_get_contents("$filename");
            //$datas=str_replace("\n", " ", $datas);
            $css[] = "<link href=\"/{$filename}\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" >";
        }
        foreach (glob("ressources/templates/{$template}/js/*.js") as $filename) {
            $filename = basename($filename);
            if (preg_match("#^jquery-([0-9\\.]+)\\.min\\.js#", $filename)) {
                $log[] = "<!-- jquery = {$filename} -->";
                $jquery = $filename;
                continue;
            }
            $js[] = "<script type=\"text/javascript\" src=\"/ressources/templates/{$template}/js/{$filename}\"></script>";
            $log[] = "<!-- {$filename} -->";
        }
        if ($jquery != null) {
            $jquery = "<script type=\"text/javascript\" src=\"/ressources/templates/{$template}/js/{$jquery}\"></script>";
        }
        $jslogon = "<script type=\"text/javascript\" src=\"logon.php?start=yes\"></script>";
        if ($ProductName != null) {
            $ProductName = "<input type='hidden' id='change-artica-name' value='{$ProductName}'>";
        }
        $jsArtica = $p->jsArtica();
        $sock = new sockets();
        $TITLE_RESSOURCE = "ressources/templates/{$template}/TITLE";
        $favicon = $p->favicon();
        if (is_file($TITLE_RESSOURCE)) {
            $title = @file_get_contents($TITLE_RESSOURCE);
            $title = str_replace("%server", $users->hostname, $title);
        } else {
            $title = $users->hostname;
        }
        $tpl = str_replace("{COPYRIGHT}", "Copyright 2006 - " . date('Y'), $tpl);
        $tpl = str_replace("{copy-right}", "Copyright 2006 - " . date('Y'), $tpl);
        $tpl = str_replace("{TEMPLATE_HEAD}", "<!-- HEAD TITLE: {$TITLE_RESSOURCE} -->\n{$favicon}\n{$jquery}\n{$jsArtica}\n" . @implode("\n", $js) . "\n{$jslogon}\n" . @implode("\n", $css) . "\n" . @implode("\n", $log), $tpl);
        $tpl = str_replace("{ARTICA_VERSION}", @file_get_contents("VERSION"), $tpl);
        $tpl = str_replace("{SQUID_VERSION}", $users->SQUID_VERSION, $tpl);
        $tpl = str_replace("{TEMPLATE_BODY_YAHOO}", $p->YahooBody(), $tpl);
        $tpl = str_replace("{TEMPLATE_LANG_LINK}", "<span id='llang-select'></span><script>LoadAjaxTiny('llang-select','{$page}?TEMPLATE_LANG_LINK=yes')</script>", $tpl);
        $tpl = str_replace("{artica_username}", $_GET["MEM_USERNAME"], $tpl);
        $tpl = str_replace("{LOGON_BUTTON}", "<input type='hidden' id='template' value='{$template}'>{$ProductName}" . button("{login}", "SendLogonStart()", "18px"), $tpl);
        $tpl = str_replace("{TEMPLATE_TITLE_HEAD}", $title, $tpl);
        if (strpos($tpl, "{ZARAFA_VERSION") > 0) {
            $sock = new sockets();
            $tpl = str_replace("{ZARAFA_VERSION}", $sock->getFrameWork("zarafa.php?getversion=yes"), $tpl);
        }
        $tpl2 = new templates();
        return $tpl2->_ENGINE_parse_body($tpl);
    }
    $html = "<html xmlns='http://www.w3.org/1999/xhtml'>\n<head>\n\t<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\t<title></title>\n\t<meta name='keywords' content=''>\n\t<meta name='description' content=\"\">\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" />\n\t<link href='css/styles_main.css'    rel=\"styleSheet\"  type='text/css' />\n\n\t<link href='css/styles_header.css'  rel=\"styleSheet\"  type='text/css' />\n\t<link href='css/styles_middle.css'  rel=\"styleSheet\"  type='text/css' />\n\t<link href='css/styles_tables.css'  rel=\"styleSheet\"  type='text/css' />\n\t<link href=\"css/styles_rounded.css\" rel=\"stylesheet\"  type=\"text/css\" />\n\t<!--[if lt IE 7]>\n\t<link rel='stylesheet' type='text/css' href='css/styles_ie.css' />\n\t<![endif]-->\n\t<!--[if IE 7]>\n\t<link rel='stylesheet' type='text/css' href='css/styles_ie7.css' />\n\t<![endif]-->\n\t\t<link rel=\"stylesheet\" type=\"text/css\" rel=\"styleSheet\"  href=\"ressources/templates/default/contact.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" rel=\"styleSheet\"  href=\"ressources/templates/default/menus_top.css\" />\n\t\t<link href=\"css/calendar.css\" rel=\"stylesheet\" type=\"text/css\">\n\t\t<link href=\"js/jqueryFileTree.css\" rel=\"stylesheet\" type=\"text/css\">\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/uploadify.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/artica-theme/jquery-ui-1.7.2.custom.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.jgrowl.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.cluetip.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.treeview.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/thickbox.css\" media=\"screen\"/>\n\t\t<div id='PopUpInfos' style='position:absolute'></div>\n\t\t<div id='find' style='position:absolute'></div>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"XHRConnection.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"JavaScript\" src=\"mouse.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"default.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/cookies.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery-1.6.1.min.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jqueryFileTree.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.easing.1.3.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery-ui-1.8.custom.min.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/thickbox-compressed.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.simplemodal-1.3.3.min.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.jgrowl_minimized.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.cluetip.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.blockUI.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.treeview.min.js\"></script>\n\t\t<!-- js Artica  -->\n\n\n</head>\n<body>\n<center>\n<div style=\"width:900px;background-image:url(/css/images/{$logo_bg});background-repeat:repeat-x;background-position:center top;margin:0px;padding:0px;\">\n\t<table style=\"width:100%;margin:0px;padding:0px;border:0px;\">\n\t\t<tr>\n\t\t    <td valign=\"top\" style='padding:0px;margin:0px;border:0px;padding-top:24px'>\n\t\t\t<div style=\"height:72px\">\n\t\t\t\t<table style=\"padding:0px;margin:0px;border:0px;margin-left:-6px;\">\n\t\t\t\t<tr>\n\t\t\t   \t\t<td style='padding:0px;border:0px;' valign=\"top\" align=\"left\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<table style=\"margin:0px;border:0px;padding:0px;\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t \t\t\t\t<td style=\"margin:0px;padding:0px;background-color:{$bg_color}\" width=\"160px\">\n\n\t\t\t\t\t\t\t\t<img src='/css/images/{$logo}' style=\"margin:0px;padding:0px;\">\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style=\"margin:0px;padding:0px;\" valign=\"middle\">\n\t\t\t\t\t\t\t\t<div style=\"margin-top:-7px;padding-left:5px\"> </div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style=\"margin:0px;padding:0px;border:0px solid black\" valign=\"middle\" align='right' width=50%>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\n\t\t\t\t\t  </td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t  <td style='height:25px'>\n\t\t\t\t\t<div id='menus_2'><ul></ul></div id='menus_2'>\n\t\t\t\t </td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\n\t\t</div>\n\t\t     </td>\n\t\t  \n\t\t\t\n\t\t \n\t    \t</tr>\n\t\t<tr>\n\t\t<td valign=\"top\" colspan=2 style=\"margin:0px;padding:0px;padding-top:4px;background-color:white;\">\t\n<div id='middle'>\n\t<div id='content' style='background-color:white;'>\n\t\t<table style='width:100%'>\n\t\t\t<tr>\n\n\t\t\t\t<td valign='top' style='padding:0px;margin:0px;width:150px'>\n\t\t\t\t\t\n\t\t\t\t</td>\n\t\t\t\t<td valign='top' style='padding-left:3px'>\n\t\t\t\t\t<div id='template_users_menus'></div>\n\t\t\t\t\t<div id='BodyContentTabs'></div>\n\t\t\t\t\t\t<div id='BodyContent'>\n\t\t\t\t\t\t\t<h1 id='template_title'></h1>\n\t\t\t\t\t\t\t<!-- content -->\n\t\t\t\t\t\t\t\n\n<script>\nfunction SaveSession(){\n\tvar template=document.getElementById('template').value;\n\tvar lang=document.getElementById('lang').value;\n\tSet_Cookie('artica-template', template, '3600', '/', '', '');\n\tSet_Cookie('artica-language', lang, '3600', '/', '', '');\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('lang',lang);\n\tXHR.sendAndLoad('logon.php', 'GET');\t\t\n\tlocation.reload();\n}\n\nfunction LoadModal(){\n\$('#loginform').modal({onOpen: function (dialog) {\n\tdialog.overlay.fadeIn('slow', function () {\n\t\tdialog.container.slideDown('slow', function () {\n\t\t\tdialog.data.fadeIn('slow');\n\t\t});\n\t});\n}});\n\n\n\n}\n\n\n</script>\n\n\n<center>\n\t<div id='loginform'></div>\n</center>\n<!-- content end -->\n\t\t\t\t\t\t</div>\n\n\t\t\t\t</td>\n\n\t\t\t\t<td valign='top'></td>\n\t\t\t</tr>\t\n\t</table>\t\n\n\t<div class='clearleft'></div>\n\t<div class='clearright'></div>\n\t</div id='content'>\n\n</div id='middle'>\n</td>\n</tr>\n<tr>\n<td valign='top' align=left colspan=2 >\n<div style='background-color:#736e6c;font-size:13px;color:white;height:25px;padding:0px;margin:0px;padding-top:5px;width:900px;text-align:center;margin-left:-5px;margin-bottom:-3px'>\n\n<strong>{$ProductName} Copyright 2006-" . date('Y') . "</strong>\n</div>\n</td>\n</tr>\n</table>\n</div>\n</center>\n<script>\ndocument.getElementById('loginform').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';\nLoadjs('logon.php?start=yes');</script>\n\t\t<div id=\"SetupControl\" style='width:0;height:0'></div>\n\t\t<div id=\"dialogS\" style='width:0;height:0'></div> \n\t\t<div id=\"dialogT\" style='width:0;height:0'></div> \n\t\t<div id=\"dialog0\" style='width:0;height:0'></div> \n\t\t<div id=\"dialog1\" style='width:0;height:0'></div>\n\t\t<div id=\"dialog2\" style='width:0;height:0'></div> \n\t\t<div id=\"dialog3\" style='width:0;height:0'></div>\n\t\t<div id=\"dialog4\" style='width:0;height:0'></div>\n\t\t<div id=\"dialog5\" style='width:0;height:0'></div>\n\t\t<div id=\"dialog6\" style='width:0;height:0'></div>\n\t\t<div id=\"YahooUser\" style='width:0;height:0'></div>\n\t\t<div id=\"logsWatcher\" style='width:0;height:0'></div>\n\t\t<div id=\"WinORG\" style='width:0;height:0'></div>\n\t\t<div id=\"WinORG2\" style='width:0;height:0'></div>\n\t\t<div id=\"RTMMail\" style='width:0;height:0'></div>\n\t\t<div id=\"Browse\" style='width:0;height:0'></div>\n\t\t<div id=\"SearchUser\" style='width:0;height:0'></div>\n</body>\n</html>";
    return $html;
}
예제 #6
0
function parseTemplate_LocalDB()
{
    session_start();
    include_once dirname(__FILE__) . "/ressources/class.sockets.inc";
    include_once dirname(__FILE__) . "/ressources/class.mysql.inc";
    $sock = new sockets();
    $SquidGuardServerName = $sock->GET_INFO("SquidGuardServerName");
    $SquidGuardApachePort = $sock->GET_INFO("SquidGuardApachePort");
    $GLOBALS["JS_NO_CACHE"] = true;
    $proto = "http";
    if (isset($_SERVER['HTTPS'])) {
        if (strtolower($_SERVER['HTTPS']) == 'on') {
            $proto = "https";
        }
    }
    $GLOBALS["JS_HEAD_PREPREND"] = "{$proto}://{$_SERVER["SERVER_NAME"]}:{$_SERVER["SERVER_PORT"]}";
    $t = time();
    include_once dirname(__FILE__) . "/ressources/class.page.builder.inc";
    include_once dirname(__FILE__) . "/ressources/class.templates.inc";
    $page = CurrentPageName();
    $tpl = new templates();
    $ask_password = $tpl->javascript_parse_text("{password}:");
    $url = base64_decode($_GET["url"]);
    $clientaddr = base64_decode($_GET["clientaddr"]);
    $array = parse_url($url);
    $Whitehost = strtolower($array["host"]);
    $pp = new pagebuilder();
    $head = $pp->jsArtica() . "\n\n" . $pp->headcss();
    if (preg_match("#^www.(.+)#", $Whitehost, $re)) {
        $Whitehost = $re[1];
    }
    $yahoo = $pp->YahooBody();
    $t = time();
    $html = "\n\t<html>\n\t<head>\n\t<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\t<title>{$ask_password}</title>\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" />\n\t<link href='/css/styles_main.css'    rel=\"styleSheet\"  type='text/css' />\n\t<link href='/css/styles_header.css'  rel=\"styleSheet\"  type='text/css' />\n\t<link href='/css/styles_middle.css'  rel=\"styleSheet\"  type='text/css' />\n\t<link href='/css/styles_tables.css'  rel=\"styleSheet\"  type='text/css' />\n\t<link href=\"/css/styles_rounded.css\" rel=\"stylesheet\"  type=\"text/css\" />\n\t{$head}\n\t</head>\n\t<body style='background: url(\"/css/images/pattern.png\") repeat scroll 0pt 0pt rgb(38, 56, 73); padding: 0px;padding-top: 15px; margin: 0px; border: 0px solid black; width: 100%; cursor: default; -moz-user-select: inherit;'>\n\t{$yahoo}\n\t<div id='div-{$t}'></div>\n\t<table style='width:99%' class=form>\n\t<tr>\n\t<td class=legend style='font-size:16px'>{client}:</td>\n\t<td style='font-size:16px'><strong>{$clientaddr}</strong></td>\n\t</tr>\n\t<tr>\n\t<td class=legend style='font-size:16px'>{website}:</td>\n\t<td style='font-size:16px'><strong>{$Whitehost}</strong></td>\n\t</tr>\n\t<tr>\n\t<td class=legend style='font-size:16px'>{username}:</td>\n\t<td style='font-size:16px'>" . Field_text("USERNAME-{$t}", null, "font-size:16px;font-weight:bolder", null, null, null, false, "SendPassCheck(event)") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend style='font-size:16px'>{password}:</td>\n\t\t<td style='font-size:16px'>" . Field_password("#nolock:PASS-{$t}", null, "font-size:16px", null, null, null, false, "SendPassCheck(event)") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=2 align='right'><hr>" . button("{submit}", "SendPass{$t}()", 18) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\n\t\t\t\t<script>\n\t\t\t\tvar X_SendPass= function (obj) {\n\t\t\t\tvar tempvalue=obj.responseText;\n\t\t\t\tif(tempvalue.length>3){alert(tempvalue);}\n\t\t\t\tdocument.getElementById('div-{$t}').innerHTML='';\n}\n\n\t\t\t\tfunction SendPassCheck(e){\n\t\t\t\tif(checkEnter(e)){SendPass{$t}();}\n}\n\n\t\t\t\tfunction SendPass{$t}(){\n\t\t\t\tvar password=MD5(document.getElementById('PASS-{$t}').value);\n\t\t\t\tvar XHR = new XHRConnection();\n\t\t\t\tXHR.appendData('password',password);\n\t\t\t\tXHR.appendData('USERNAME',document.getElementById('USERNAME-{$t}').value);\n\t\t\t\tXHR.appendData('CLIENT','{$clientaddr}');\n\t\t\t\tXHR.appendData('Whitehost','{$Whitehost}');\n\t\t\t\tAnimateDiv('div-{$t}');\n\t\t\t\tXHR.sendAndLoad('{$page}', 'POST',X_SendPass);\n}\n\t\t\t\tMessagesTophideAllMessages();\n\t\t\t\t</script>\n\t\t\t\t</body>\n\t\t\t\t</html>";
    echo $tpl->_ENGINE_parse_body($html);
}
예제 #7
0
function buildPage(){
	unset($_SESSION);
	if($GLOBALS["DEBUG_TEMPLATE"]){error_log("[{$_SESSION["uid"]}]::START:LANG:[{$_SESSION["detected_lang"]}] => language: _COOKIE=`{$_COOKIE["artica-language"]}` _SESSION=`{$_SESSION["detected_lang"]}` function:".__FUNCTION__." in " . basename(__FILE__). " line ".__LINE__);}
	
	$page=CurrentPageName();
	$users=new usersMenus();
	$langAutodetect=new articaLang();
	$DetectedLanguage=$langAutodetect->get_languages();
	$GLOBALS["FIXED_LANGUAGE"]=$DetectedLanguage;
	$sock=new sockets();
	$logo="logo.gif";
	$logo_bg="bg_header.gif";
	$bg_color="#005447";
	$ProductName="Artica";
	$template=null;
	$FixedLanguage=$sock->GET_INFO("FixedLanguage");
	if($users->KASPERSKY_WEB_APPLIANCE){$template="Kav4Proxy";$logo="logo-kav.gif";}
	if($users->ZARAFA_APPLIANCE){$template="zarafa";$logo="logo-kav.gif";}	
	if($users->MYCOSI_APPLIANCE){$logo_bg="bg_header_kavweb.gif";$logo="logo-mycosi.gif";$bg_color="#FFB683";$ProductName="MyCosi";$template="myCosi";}
	if($users->APACHE_APPLIANCE){$template="Apache";$users->SAMBA_APPLIANCE=false;$logo="logo-kav.gif";}	
	
	if($GLOBALS["VERBOSE"]){echo "<H1>template=$template line ".__LINE__."</H1>";}
	$template="Squid";
	
	
	if($template<>null){
		$jquery=null;
		
		include_once(dirname(__FILE__)."/ressources/class.page.builder.inc");
		$p=new pagebuilder();
		if(is_file("ressources/templates/$template/logon.html"));
		$tpl=@file_get_contents("ressources/templates/$template/logon.html");
		
		foreach (glob("ressources/templates/$template/css/*.css") as $filename) {
			//$datas=@file_get_contents("$filename");
			//$datas=str_replace("\n", " ", $datas);
			$css[]="<link href=\"/$filename\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" >";;
			
		}	
		$css[]="<link href=\"/$filename\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" >";;
		if(!is_file("ressources/templates/$template/blurps.css")){
			$css[]="<link href=\"/ressources/templates/default/blurps.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" >";;
		}
		
		$css[]="<link href=\"/css/jquery.reject.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" >";

		$array=glob("ressources/templates/$template/js/*.js");
		if(is_array($array)){
			foreach ($array as $filename) {
				$filename=basename($filename);
				
				if(preg_match("#^jquery-([0-9\.]+)\.min\.js#", $filename)){
					$log[]="<!-- jquery = $filename -->";
					$jquery=$filename;
					continue;}
				$js[]="<script type=\"text/javascript\" src=\"/ressources/templates/$template/js/$filename\"></script>";
				$log[]="<!-- $filename -->";
			}
		}
		
		
		$lang2Link=null;
		
		
		if($jquery<>null){$jquery="<script type=\"text/javascript\" src=\"/ressources/templates/$template/js/$jquery\"></script>";}
		$jslogon="<script type=\"text/javascript\" src=\"$page?start=yes\"></script>
		
		
		
		";
		if($ProductName<>null){$ProductName="<input type='hidden' id='change-artica-name' value='$ProductName'>";}
		
		$jsArtica=$p->jsArtica();
		$jsArtica=$jsArtica."\n<script type=\"text/javascript\" src=\"js/jquery.reject.js\"></script>";
		$sock=new sockets();
		$TITLE_RESSOURCE="ressources/templates/$template/TITLE";
		$favicon=$p->favicon($template);
		if(is_file($TITLE_RESSOURCE)){$title=@file_get_contents($TITLE_RESSOURCE);$title=str_replace("%server", $users->hostname, $title);}else{$title=$users->hostname;}
		$tpl=str_replace("{COPYRIGHT}","Copyright 2006 - ". date('Y').$lang2Link,$tpl);
		$tpl=str_replace("{copy-right}","Copyright 2006 - ". date('Y').$lang2Link,$tpl);
		$tpl=str_replace("{TEMPLATE_HEAD}","<!-- HEAD TITLE: $TITLE_RESSOURCE -->\n$favicon\n$jquery\n$jsArtica\n". @implode("\n", $js)."\n$jslogon\n".@implode("\n", $css)."\n".@implode("\n", $log), $tpl);
		$tpl=str_replace("{ARTICA_VERSION}",@file_get_contents("VERSION"),$tpl);
		$tpl=str_replace("{SQUID_VERSION}",$users->SQUID_VERSION,$tpl);
		$tpl=str_replace("{POSTFIX_VERSION}",$users->POSTFIX_VERSION,$tpl);
		$tpl=str_replace("{SAMBA_VERSION}",$users->SAMBA_VERSION,$tpl);
		$tpl=str_replace("{CROSSROADS_VERSION}",$users->CROSSROADS_VERSION,$tpl);
		$tpl=str_replace("{APACHE_VERSION}",$users->APACHE_VERSION,$tpl);
		
		
		
		
	
		$tpl=str_replace("{TEMPLATE_BODY_YAHOO}",$p->YahooBody(),$tpl);
		$tpl=str_replace("{TEMPLATE_LANG_LINK}",null,$tpl);
		

		$xtpl=new templates();
		$xtpl->language=$DetectedLanguage;
		$register="<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('$page?register-js=yes');\" 
		style='font-size:16px;text-decoration:underline'>".$xtpl->_ENGINE_parse_body("{register}")."</a>&nbsp;&nbsp;
		<script>LoadAjaxTiny('lostpassworddiv','$page?lostpassworddiv=yes');</script>		
		<script>Loadjs('$page?reject-browser=yes');</script>
		";
		
		$sock=new sockets();
		$SquidEnableISPublicRegister=$sock->GET_INFO("SquidEnableISPublicRegister");
		if(!is_numeric($SquidEnableISPublicRegister)){$SquidEnableISPublicRegister=0;}
		if($SquidEnableISPublicRegister==0){$register=null;}
		
		$tpl=str_replace("{artica_username}",null,$tpl);
		$tpl=str_replace("{LOGON_BUTTON}","$register<input type='hidden' id='template' value='$template'>$ProductName".button("{login}", "SendLogonStart()","18px"),$tpl);
		$tpl=str_replace("{TEMPLATE_TITLE_HEAD}",$title,$tpl);
		
			
		
		if(strpos($tpl,"{ZARAFA_VERSION")>0){
			$sock=new sockets();
			$tpl=str_replace("{ZARAFA_VERSION}",$sock->getFrameWork("zarafa.php?getversion=yes"),$tpl);
			
		}
	
		$tpl=str_replace("User name","{username2}",$tpl);
		$tpl=str_replace("Password","{password}",$tpl);		
		$tpl2=new templates();
		$tpl2->language=$DetectedLanguage;
		$html2=$tpl2->_ENGINE_parse_body($tpl);
		if($GLOBALS["DEBUG_TEMPLATE"]){error_log("[{$_SESSION["uid"]}]::FINISH:LANG:[{$_SESSION["detected_lang"]}] => language: _COOKIE=`{$_COOKIE["artica-language"]}` _SESSION=`{$_SESSION["detected_lang"]}` function:".__FUNCTION__." in " . basename(__FILE__). " line ".__LINE__);}
		return $html2;
	}
	
	
	
$html="<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
	<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />
	<title></title>
	<meta name='keywords' content=''>
	<meta name='description' content=\"\">
	<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" />
	<link href='css/styles_main.css'    rel=\"styleSheet\"  type='text/css' />

	<link href='css/styles_header.css'  rel=\"styleSheet\"  type='text/css' />
	<link href='css/styles_middle.css'  rel=\"styleSheet\"  type='text/css' />
	<link href='css/styles_tables.css'  rel=\"styleSheet\"  type='text/css' />
	<link href=\"css/styles_rounded.css\" rel=\"stylesheet\"  type=\"text/css\" />
	<!--[if lt IE 7]>
	<link rel='stylesheet' type='text/css' href='css/styles_ie.css' />
	<![endif]-->
	<!--[if IE 7]>
	<link rel='stylesheet' type='text/css' href='css/styles_ie7.css' />
	<![endif]-->
		<link rel=\"stylesheet\" type=\"text/css\" rel=\"styleSheet\"  href=\"ressources/templates/default/contact.css\" />
		<link rel=\"stylesheet\" type=\"text/css\" rel=\"styleSheet\"  href=\"ressources/templates/default/menus_top.css\" />
		<link href=\"css/calendar.css\" rel=\"stylesheet\" type=\"text/css\">
		<link href=\"js/jqueryFileTree.css\" rel=\"stylesheet\" type=\"text/css\">
		<link rel=\"stylesheet\" type=\"text/css\" href=\"css/uploadify.css\" />
		<link rel=\"stylesheet\" type=\"text/css\" href=\"css/artica-theme/jquery-ui-1.7.2.custom.css\" />
		<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.jgrowl.css\" />
		<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.cluetip.css\" />
		<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.treeview.css\" />
		<link rel=\"stylesheet\" type=\"text/css\" href=\"css/thickbox.css\" media=\"screen\"/>
		<div id='PopUpInfos' style='position:absolute'></div>
		<div id='find' style='position:absolute'></div>
		<script type=\"text/javascript\" language=\"javascript\" src=\"XHRConnection.js\"></script>
		<script type=\"text/javascript\" language=\"JavaScript\" src=\"mouse.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"default.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/cookies.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery-1.6.1.min.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/jqueryFileTree.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.easing.1.3.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery-ui-1.8.custom.min.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/thickbox-compressed.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.simplemodal-1.3.3.min.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.jgrowl_minimized.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.cluetip.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.blockUI.js\"></script>
		<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.treeview.min.js\"></script>
		<script type='text/javascript' language='javascript' src='/js/jquery.uilock.min.js'></script>
		<script type='text/javascript' language='javascript' src='/js/jquery.blockUI.js'></script>  
		<!-- js Artica  -->


</head>
<body>
<center>
<div style=\"width:900px;background-image:url(/css/images/$logo_bg);background-repeat:repeat-x;background-position:center top;margin:0px;padding:0px;\">
	<table style=\"width:100%;margin:0px;padding:0px;border:0px;\">
		<tr>
		    <td valign=\"top\" style='padding:0px;margin:0px;border:0px;padding-top:24px'>
			<div style=\"height:72px\">
				<table style=\"padding:0px;margin:0px;border:0px;margin-left:-6px;\">
				<tr>
			   		<td style='padding:0px;border:0px;' valign=\"top\" align=\"left\">
						
							<table style=\"margin:0px;border:0px;padding:0px;\">
							<tr>
			 				<td style=\"margin:0px;padding:0px;background-color:$bg_color\" width=\"160px\">

								<img src='/css/images/$logo' style=\"margin:0px;padding:0px;\">
							</td>
							<td style=\"margin:0px;padding:0px;\" valign=\"middle\">
								<div style=\"margin-top:-7px;padding-left:5px\"> </div>
							</td>
							<td style=\"margin:0px;padding:0px;border:0px solid black\" valign=\"middle\" align='right' width=50%>
								
							</td>
							</tr>

							</table>
						
					  </td>
				</tr>
				<tr>
				  <td style='height:25px'>
					<div id='menus_2'><ul></ul></div id='menus_2'>
				 </td>
				</tr>
				</table>

		</div>
		     </td>
		  
			
		 
	    	</tr>
		<tr>
		<td valign=\"top\" colspan=2 style=\"margin:0px;padding:0px;padding-top:4px;background-color:white;\">	
<div id='middle'>
	<div id='content' style='background-color:white;'>
		<table style='width:100%'>
			<tr>

				<td valign='top' style='padding:0px;margin:0px;width:150px'>
					
				</td>
				<td valign='top' style='padding-left:3px'>
					<div id='template_users_menus'></div>
					<div id='BodyContentTabs'></div>
						<div id='BodyContent'>
							<h1 id='template_title'></h1>
							<!-- content -->
							

<script>
function SaveSession(){
	var template=document.getElementById('template').value;
	var lang=document.getElementById('lang').value;
	Set_Cookie('artica-template', template, '3600', '/', '', '');
	Set_Cookie('artica-language', lang, '3600', '/', '', '');
	var XHR = new XHRConnection();
	XHR.appendData('lang',lang);
	XHR.sendAndLoad('logon.php', 'GET');		
	location.reload();
}

function LoadModal(){
$('#loginform').modal({onOpen: function (dialog) {
	dialog.overlay.fadeIn('slow', function () {
		dialog.container.slideDown('slow', function () {
			dialog.data.fadeIn('slow');
		});
	});
}});



}


</script>


<center>
	<div id='loginform'></div>
</center>
<!-- content end -->
						</div>

				</td>

				<td valign='top'></td>
			</tr>	
	</table>	

	<div class='clearleft'></div>
	<div class='clearright'></div>
	</div id='content'>

</div id='middle'>
</td>
</tr>
<tr>
<td valign='top' align=left colspan=2 >
<div style='background-color:#736e6c;font-size:13px;color:white;height:25px;padding:0px;margin:0px;padding-top:5px;width:900px;text-align:center;margin-left:-5px;margin-bottom:-3px'>

<strong>$ProductName Copyright 2006-". date('Y')."</strong>
</div>
</td>
</tr>
</table>
</div>
</center>
<script>
document.getElementById('loginform').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';
Loadjs('logon.php?start=yes');</script>
		<div id=\"SetupControl\" style='width:0;height:0'></div>
		<div id=\"dialogS\" style='width:0;height:0'></div> 
		<div id=\"dialogT\" style='width:0;height:0'></div> 
		<div id=\"dialog0\" style='width:0;height:0'></div> 
		<div id=\"dialog1\" style='width:0;height:0'></div>
		<div id=\"dialog2\" style='width:0;height:0'></div> 
		<div id=\"dialog3\" style='width:0;height:0'></div>
		<div id=\"dialog4\" style='width:0;height:0'></div>
		<div id=\"dialog5\" style='width:0;height:0'></div>
		<div id=\"dialog6\" style='width:0;height:0'></div>
		<div id=\"YahooUser\" style='width:0;height:0'></div>
		<div id=\"logsWatcher\" style='width:0;height:0'></div>
		<div id=\"WinORG\" style='width:0;height:0'></div>
		<div id=\"WinORG2\" style='width:0;height:0'></div>
		<div id=\"RTMMail\" style='width:0;height:0'></div>
		<div id=\"Browse\" style='width:0;height:0'></div>
		<div id=\"SearchUser\" style='width:0;height:0'></div>
</body>
</html>";	

return $html;

}
예제 #8
0
function buildPage()
{
    if ($GLOBALS["VERBOSE"]) {
        echo "<H1>buildPage() function line " . __LINE__ . "</H1>";
    }
    include_once 'ressources/class.templates.inc';
    include_once 'ressources/class.ldap.inc';
    include_once 'ressources/class.user.inc';
    include_once 'ressources/class.langages.inc';
    include_once 'ressources/class.sockets.inc';
    include_once 'ressources/class.mysql.inc';
    include_once 'ressources/class.privileges.inc';
    include_once 'ressources/class.browser.detection.inc';
    include_once dirname(__FILE__) . "/ressources/class.langages.inc";
    $page = CurrentPageName();
    $users = new usersMenus();
    $sock = new sockets();
    unset($_SESSION);
    unset($_COOKIE["artica-template"]);
    $sslcert = null;
    $GLOBALS["DEBUG_TEMPLATE"] = true;
    if ($GLOBALS["VERBOSE"]) {
        echo "<H1>articaLang() function line " . __LINE__ . "</H1>";
    }
    $langAutodetect = new articaLang();
    $DetectedLanguage = $langAutodetect->get_languages();
    if ($GLOBALS["VERBOSE"]) {
        echo "<H1>DetectedLanguage = {$DetectedLanguage} line " . __LINE__ . "</H1>";
    }
    $GLOBALS["FIXED_LANGUAGE"] = $DetectedLanguage;
    $TEMPLATE_INDEX = "logon.html";
    if (!isset($GLOBALS["FixedLanguage"])) {
        $GLOBALS["FixedLanguage"] = $sock->GET_INFO("FixedLanguage");
    }
    $ie = browser_detection();
    if ($ie == "ie") {
        FATAL_ERROR_SHOW_128_NO_IE();
        return;
    }
    $logo = "logo.gif";
    $logo_bg = "bg_header.gif";
    $bg_color = "#005447";
    $ProductName = "Artica";
    $link_company_name = "http://www.articatech.com";
    $OEM_CompanyName = "Artica Tech";
    $template = null;
    $MikrotikTransparent = intval($sock->GET_INFO('MikrotikTransparent'));
    $SquidActHasReverse = $sock->GET_INFO("SquidActHasReverse");
    $AsSquidLoadBalancer = $sock->GET_INFO("AsSquidLoadBalancer");
    $SSlBumpAllowLogon = intval($sock->GET_INFO("SSlBumpAllowLogon"));
    if (!is_numeric($SquidActHasReverse)) {
        $SquidActHasReverse = 0;
    }
    if (!is_numeric($AsSquidLoadBalancer)) {
        $AsSquidLoadBalancer = 0;
    }
    $LOCK_TEMPLATE = false;
    $AsCategoriesAppliance = intval($sock->GET_INFO("AsCategoriesAppliance"));
    $AsMetaServer = intval($sock->GET_INFO("AsMetaServer"));
    $EnableNginx = intval($sock->GET_INFO("EnableNginx"));
    $SQUIDEnable = trim($sock->GET_INFO("SQUIDEnable"));
    if (!is_numeric($SQUIDEnable)) {
        $SQUIDEnable = 1;
    }
    if ($SQUIDEnable == 0) {
        if ($EnableNginx == 1) {
            $SquidActHasReverse = 1;
        }
    }
    $hostname = $sock->GET_INFO("myhostname");
    if ($hostname == null) {
        $hostname = $sock->getFrameWork("system.php?hostname-g=yes");
        $sock->SET_INFO($hostname, "myhostname");
    }
    if ($hostname == null) {
        $hostname = $users->hostname;
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "new templates() line:" . __LINE__ . "<br>\n";
    }
    $tpl2 = new templates();
    if ($users->KASPERSKY_WEB_APPLIANCE) {
        if ($GLOBALS["VERBOSE"]) {
            echo "<div style='background-color:white;color:black'>" . __LINE__ . ": KASPERSKY_WEB_APPLIANCE DETECTED</div>\n";
        }
        $template = "Kav4Proxy";
        $logo = "logo-kav.gif";
    }
    if ($users->ZARAFA_APPLIANCE) {
        $template = "zarafa";
        $logo = "logo-kav.gif";
    }
    if ($users->MYCOSI_APPLIANCE) {
        $logo_bg = "bg_header_kavweb.gif";
        $logo = "logo-mycosi.gif";
        $bg_color = "#FFB683";
        $ProductName = "MyCosi";
        $template = "myCosi";
    }
    if ($users->APACHE_APPLIANCE) {
        $template = "Apache";
        $users->SAMBA_APPLIANCE = false;
        $logo = "logo-kav.gif";
    }
    if ($users->WEBSECURIZE) {
        $LOCK_TEMPLATE = true;
        $users->SQUID_APPLIANCE = false;
        $template = "Websecurize";
        $users->SAMBA_APPLIANCE = false;
        $logo = "logo-kav.gif";
        $ProductName = "Web Securize";
        $link_company_name = "http://www.lemnia.com";
        $OEM_CompanyName = "LEMNIA SAS";
    }
    if ($users->LANWANSAT) {
        $LOCK_TEMPLATE = true;
        $users->SQUID_APPLIANCE = false;
        $template = "LanWanSAT";
        $users->SAMBA_APPLIANCE = false;
        $logo = "logo-kav.gif";
        $ProductName = "LanWanSAT Proxy";
        $link_company_name = "http://lanwansan.synology.me/wordpress/";
        $OEM_CompanyName = "LanWanSan";
    }
    $LinkColor = "white";
    if (is_file("/usr/share/artica-postfix/ressources/templates/{$template}/logon-link-color.conf")) {
        $LinkColor = trim(@file_get_contents("/usr/share/artica-postfix/ressources/templates/{$template}/logon-link-color.conf"));
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "<H1>template={$template} line " . __LINE__ . "</H1>";
    }
    if ($users->SQUID_APPLIANCE) {
        if (!$users->KASPERSKY_WEB_APPLIANCE) {
            if ($GLOBALS["VERBOSE"]) {
                echo "<div style='background-color:{$LinkColor};color:black'>" . __LINE__ . ": SQUID_APPLIANCE DETECTED</div>\n";
            }
            $template = "Squid";
        }
    }
    if (!$LOCK_TEMPLATE) {
        if ($users->LOAD_BALANCE_APPLIANCE) {
            $template = "LoadBalance";
        }
        if ($users->HAPRROXY_APPLIANCE) {
            $template = "LoadBalance";
        }
        if ($users->WEBSTATS_APPLIANCE) {
            $template = "WebStats";
        }
        if ($users->GATEWAY_APPLIANCE) {
            $template = "Gateway";
            $TEMPLATE_INDEX = "logon.html";
        }
        if ($users->WORDPRESS_APPLIANCE) {
            $template = "Wordpress";
        }
        if ($AsCategoriesAppliance == 1) {
            $template = "UfdbCat";
        }
        if ($AsMetaServer == 1) {
            $template = "MetaServer";
        }
    }
    if ($template == null) {
        if ($users->SQUID_INSTALLED) {
            if (!$users->POSTFIX_INSTALLED) {
                if (!$users->SAMBA_INSTALLED) {
                    $SQUIDEnable = $sock->GET_INFO("SQUIDEnable");
                    if (!is_numeric($SQUIDEnable)) {
                        $SQUIDEnable = 1;
                    }
                    if ($SQUIDEnable == 1) {
                        $template = "Squid";
                    }
                }
            }
        }
    }
    if ($template == null) {
        if ($users->POSTFIX_INSTALLED) {
            if ($users->cyrus_imapd_installed) {
                $template = "Postfix";
                $TEMPLATE_INDEX = "logon.html";
            }
            if ($users->ZARAFA_INSTALLED) {
                $template = "zarafa";
                $TEMPLATE_INDEX = "logon.html";
            }
        }
    }
    if ($template == null) {
        if ($users->POSTFIX_INSTALLED) {
            if (!$users->SQUID_INSTALLED) {
                if (!$users->SAMBA_INSTALLED) {
                    $template = "Postfix";
                    $TEMPLATE_INDEX = "logon.html";
                }
            }
        }
    }
    if (trim($template) == null) {
        if ($users->SAMBA_APPLIANCE) {
            $template = "Samba";
        }
    }
    if (trim($template) == null) {
        if ($users->WORDPRESS_INSTALLED) {
            $template = "Wordpress";
        }
    }
    if (trim($template) == null) {
        if ($users->SQUID_INSTALLED) {
            $template = "Squid";
        }
    }
    if (trim($template) == null) {
        if ($users->SAMBA_INSTALLED) {
            $template = "Samba";
        }
    }
    if (trim($template) == null) {
        if ($users->APACHE_INSTALLED) {
            $template = "Apache";
        }
    }
    if ($template == "Squid") {
        if ($SquidActHasReverse == 1) {
            $TEMPLATE_INDEX = "logonr.html";
        }
        if ($AsSquidLoadBalancer == 1) {
            $TEMPLATE_INDEX = "logonb.html";
        }
        if ($MikrotikTransparent == 1) {
            $TEMPLATE_INDEX = "logon_mikrotik.html";
        }
    }
    if ($users->APP_UFDBGUARD_INSTALLED) {
        $q = new mysql_squid_builder();
        $sql = "SELECT COUNT( * ) AS tcount FROM personal_categories WHERE PublicMode=1";
        writelogs($sql, __FUNCTION__, __FILE__, __LINE__);
        $ligneCatz = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup"));
        if ($ligneCatz["tcount"] > 0) {
            $categoriesPublic = "<span style='color:{$LinkColor}'>&nbsp;|&nbsp;</span>\n\t\t\t<a href='public.categories.personnal.php' style='color:{$LinkColor}'>" . $tpl2->_ENGINE_parse_body("{categories}") . "</a>&nbsp;";
        }
    }
    if ($GLOBALS["VERBOSE"]) {
        echo "<H1>template={$template} line " . __LINE__ . "</H1>";
    }
    if ($template != null) {
        $jquery = null;
        include_once dirname(__FILE__) . "/ressources/class.page.builder.inc";
        if ($GLOBALS["VERBOSE"]) {
            echo "new pagebuilder() line " . __LINE__ . "</H1>";
        }
        $p = new pagebuilder();
        if (is_file("ressources/templates/{$template}/{$TEMPLATE_INDEX}")) {
        }
        $tpl = @file_get_contents("ressources/templates/{$template}/{$TEMPLATE_INDEX}");
        if ($GLOBALS["VERBOSE"]) {
            echo "<H1>ressources/templates/{$template}/{$TEMPLATE_INDEX} (" . strlen($tpl) . ") length line " . __LINE__ . "</H1>";
        }
        foreach (glob("ressources/templates/{$template}/css/*.css") as $filename) {
            //$datas=@file_get_contents("$filename");
            //$datas=str_replace("\n", " ", $datas);
            $css[] = "<link href=\"/{$filename}\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" >";
        }
        $log[] = "<!-- TEMPLATE_INDEX:{$TEMPLATE_INDEX} -->";
        if ($GLOBALS["VERBOSE"]) {
            echo "Scanning ressources/templates/{$template}/js/*.js" . __LINE__ . "<br>\n";
        }
        foreach (glob("ressources/templates/{$template}/js/*.js") as $filename) {
            $filename = basename($filename);
            if (preg_match("#^jquery-([0-9\\.]+)\\.min\\.js#", $filename)) {
                $log[] = "<!-- jquery = {$filename} -->";
                $jquery = $filename;
                continue;
            }
            $js[] = "<script type=\"text/javascript\" src=\"/ressources/templates/{$template}/js/{$filename}\"></script>";
            $log[] = "<!-- {$filename} -->";
        }
        $lang2Link = "<a href=\"javascript:blur();\" OnClick=\"javascript:PopupLogonLang()\" style='color:{$LinkColor} !important'>{language}</a>";
        if (trim($GLOBALS["FixedLanguage"]) != null) {
            $lang2Link = null;
        }
        if ($jquery != null) {
            $jquery = "<script type=\"text/javascript\" src=\"/ressources/templates/{$template}/js/{$jquery}\"></script>";
        }
        $jslogon = "<script type=\"text/javascript\" src=\"logon.php?start=yes\"></script>";
        if ($ProductName != null) {
            $ProductName = "<input type='hidden' id='change-artica-name' value='{$ProductName}'>";
        }
        $jsArtica = $p->jsArtica();
        $js[] = "<script type=\"text/javascript\" language=\"javascript\" src=\"/js/jquery.reject.js\"></script>";
        $css[] = "<link href=\"/css/jquery.reject.css\" media=\"screen\" rel=\"stylesheet\" type=\"text/css\" >";
        $sock = new sockets();
        $TITLE_RESSOURCE = "ressources/templates/{$template}/TITLE";
        $favicon = $p->favicon($template);
        if ($GLOBALS["VERBOSE"]) {
            echo "replace tokens line:" . __LINE__ . "<br>\n";
        }
        if (is_file($TITLE_RESSOURCE)) {
            $title = @file_get_contents($TITLE_RESSOURCE);
            $title = str_replace("%server", $users->hostname, $title);
        } else {
            $title = $users->hostname;
        }
        $FPM = null;
        if (method_exists("templates", "parsePHPModules")) {
            $modules = $tpl2->parsePHPModules();
            $PHPVERSION = null;
            if (isset($modules["Core"]["PHP Version"])) {
                if (preg_match("#([0-9\\.]+)#", $modules["Core"]["PHP Version"], $re)) {
                    $PHPVERSION = "&nbsp;|&nbsp;PHP v.{$re[1]}";
                }
            }
            if (isset($modules["cgi-fcgi"]["php-fpm"])) {
                $FPM = " (PHP-FPM)";
            }
        }
        $WizardSavedSettings = unserialize(base64_decode($sock->GET_INFO("WizardSavedSettings")));
        $WizardSavedSettingsSend = $sock->GET_INFO("WizardSavedSettingsSend");
        $UnlockCompanyName = $sock->GET_INFO("UnlockCompanyName");
        if (!is_numeric($WizardSavedSettingsSend)) {
            $WizardSavedSettingsSend = 0;
        }
        $roundcube_uri = roundcube_uri($users);
        if ($roundcube_uri != null) {
            $miniadm = "<span style='color:{$LinkColor} !important'>&nbsp;|&nbsp;</span><a href=\"{$roundcube_uri}\" style='color:{$LinkColor};text-decoration:underline'>WebMail<a>&nbsp;";
        }
        $miniadm = $miniadm . "<span style='color:{$LinkColor}'>&nbsp;|&nbsp;</span><a href='miniadm.logon.php' style='color:{$LinkColor}'>End-User WebAccess</a>&nbsp;";
        if (!isset($WizardSavedSettings["company_name"])) {
            $WizardSavedSettings["company_name"] = null;
        }
        $company_name = $WizardSavedSettings["company_name"];
        if ($UnlockCompanyName != null) {
            $company_name = $UnlockCompanyName;
        }
        if ($company_name != null) {
            $company_name = "<center style='margin:5px;font-size:16px;padding:5px;\n\t\t\t\tborder-top:1px solid {$LinkColor};border-bottom:1px solid {$LinkColor}'>-&nbsp;{$company_name}&nbsp;-</center>";
        }
        $company_name = "<center style='margin:5px;font-size:12px;padding:5px;'>-&nbsp;{$hostname}&nbsp;-</center>{$company_name}";
        $WEBSEVERV = null;
        if (isset($_SERVER["SERVER_SOFTWARE"])) {
            if (preg_match("#Apache\\/([0-9\\.]+)#", $_SERVER["SERVER_SOFTWARE"], $re)) {
                $WEBSEVERV = "&nbsp;|&nbsp;Apache v{$re[1]}";
            }
            if (preg_match("#lighttpd\\/([0-9\\.]+)#", $_SERVER["SERVER_SOFTWARE"], $re)) {
                $WEBSEVERV = "&nbsp;|&nbsp;LigHttpd v{$re[1]}";
            }
        }
        if ($users->SQUID_INSTALLED) {
            if ($SQUIDEnable == 1) {
                if ($GLOBALS["VERBOSE"]) {
                    echo "<div style='background-color:white;color:black'>" . __LINE__ . ": SQUID INSTALLED</div>\n";
                }
                $userslogs = "<span style='color:{$LinkColor}'>&nbsp;|&nbsp;</span><a href='squid.access-sql.php' style='color:{$LinkColor}'>Proxy requests</a>&nbsp;";
                $EnableSquidUrgencyPublic = $sock->GET_INFO("EnableSquidUrgencyPublic");
                if (!is_numeric($EnableSquidUrgencyPublic)) {
                    $EnableSquidUrgencyPublic = 0;
                }
                if ($EnableSquidUrgencyPublic == 1) {
                    $urgency_mode = $tpl2->_ENGINE_parse_body("{urgency_mode}");
                    $userslogs = "<span style='color:{$LinkColor}'>&nbsp;|&nbsp;</span><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.urgency.php',true);\" style='color:{$LinkColor}'>{$urgency_mode}</a>&nbsp;{$userslogs}";
                }
                if ($SSlBumpAllowLogon == 1) {
                    if (is_file("/usr/share/artica-postfix/ressources/squid/certificate.der")) {
                        $certificate = $tpl2->_ENGINE_parse_body("{certificate}");
                        $sslcert = "<span style='color:{$LinkColor}'>&nbsp;|&nbsp;</span>\n\t\t\t\t\t\t\t\t<a href='ressources/squid/certificate.der' style='color:{$LinkColor}'>\n\t\t\t\t\t\t{$certificate}</a>&nbsp;\n\t\t\t\t\t\t\t\t";
                    }
                }
            }
        } else {
            if ($GLOBALS["VERBOSE"]) {
                echo "<div style='background-color:white;color:{$LinkColor}'>" . __LINE__ . ": SQUID !!NOT!! INSTALLED</div>\n";
            }
        }
        if ($users->KAV4PROXY_INSTALLED) {
            $WEBSEVERV = "&nbsp;|&nbsp;Kav4Proxy v{$users->KAV4PROXY_VERSION}";
        }
        $ARTICAVER = @file_get_contents("VERSION") . $WEBSEVERV . $PHPVERSION . $FPM;
        $tpl = str_replace("{COPYRIGHT}", "{$lang2Link}{$miniadm}{$userslogs}{$sslcert}{$categoriesPublic}<br>{$company_name}Copyright 2003 - " . date('Y') . "&nbsp;<a href=\"{$link_company_name}\" style='color:{$LinkColor}'>{$OEM_CompanyName}</a>", $tpl);
        $tpl = str_replace("{copy-right}", "{$lang2Link}{$miniadm}{$userslogs}{$sslcert}{$categoriesPublic}<br>{$company_name}Copyright 2003 - " . date('Y') . "&nbsp;<a href=\"{$link_company_name}\" style='color:{$LinkColor}'>{$OEM_CompanyName}</a>", $tpl);
        $tpl = str_replace("{TEMPLATE_HEAD}", "<!-- HEAD TITLE: {$TITLE_RESSOURCE} -->\n{$favicon}\n{$jquery}\n{$jsArtica}\n" . @implode("\n", $js) . "\n{$jslogon}\n" . @implode("\n", $css) . "\n" . @implode("\n", $log), $tpl);
        $tpl = str_replace("{ARTICA_VERSION}", $ARTICAVER, $tpl);
        if ($SQUIDEnable == 1) {
            $tpl = str_replace("{SQUID_VERSION}", $users->SQUID_VERSION, $tpl);
        } else {
            $tpl = str_replace("{SQUID_VERSION}", null, $tpl);
        }
        $tpl = str_replace("{POSTFIX_VERSION}", $users->POSTFIX_VERSION, $tpl);
        $tpl = str_replace("{SAMBA_VERSION}", $users->SAMBA_VERSION, $tpl);
        $tpl = str_replace("{CROSSROADS_VERSION}", $users->CROSSROADS_VERSION, $tpl);
        $tpl = str_replace("{APACHE_VERSION}", $users->APACHE_VERSION, $tpl);
        if (!function_exists("ldap_connect")) {
            $tpl = str_replace("{LOGON_BUTTON}", "<span id='YouCanAnimateIt'></span><script>Loadjs('{$page}?ldap_connect=yes');</script>", $tpl);
        }
        if ($GLOBALS["VERBOSE"]) {
            echo "p->YahooBody() line:" . __LINE__ . "<br>\n";
        }
        $tpl = str_replace("{TEMPLATE_BODY_YAHOO}", $p->YahooBody(), $tpl);
        if (trim($GLOBALS["FixedLanguage"]) == null) {
            $tpl = str_replace("{TEMPLATE_LANG_LINK}", "<span id='llang-select'></span><script>LoadAjaxTiny('llang-select','{$page}?TEMPLATE_LANG_LINK=yes')</script>", $tpl);
        } else {
            $tpl = str_replace("{TEMPLATE_LANG_LINK}", null, $tpl);
        }
        $tpl = str_replace("{artica_username}", $_GET["MEM_USERNAME"], $tpl);
        $reject_browser_automation = null;
        if (isset($_GET["automation"])) {
            $reject_browser_automation = "&automation=yes";
        }
        $tpl = str_replace("{LOGON_BUTTON}", "<span id='YouCanAnimateIt'></span>\n\t\t\t<script>Loadjs('{$page}?reject-browser=yes{$reject_browser_automation}');</script><input type='hidden' id='template' value='{$template}'>{$ProductName}" . button("{login}", "SendLogonStart()", "18px"), $tpl);
        $tpl = str_replace("{TEMPLATE_TITLE_HEAD}", $title, $tpl);
        if (strpos($tpl, "{ZARAFA_VERSION") > 0) {
            $sock = new sockets();
            $tpl = str_replace("{ZARAFA_VERSION}", $sock->getFrameWork("zarafa.php?getversion=yes"), $tpl);
        }
        if (trim($GLOBALS["FixedLanguage"]) == null) {
            $tpl2->language = $DetectedLanguage;
        }
        if ($GLOBALS["VERBOSE"]) {
            echo "Langage {$tpl2->language} line:" . __LINE__ . "<br>\n";
        }
        $tpl = str_replace("User name", $tpl2->_ENGINE_parse_body("{username2}"), $tpl);
        $tpl = str_replace("Password", $tpl2->_ENGINE_parse_body("{password}"), $tpl);
        if ($GLOBALS["VERBOSE"]) {
            echo "Success return form " . strlen($tpl) . " bytes lenght<br>\n";
        }
        if ($GLOBALS["VERBOSE"]) {
            echo "Success return complete page line " . __LINE__ . "<br>\n";
        }
        return $tpl2->_ENGINE_parse_body($tpl) . "<script>//LockPage();</script>";
    }
    $html = "<html xmlns='http://www.w3.org/1999/xhtml'>\n<head>\n\t<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n\t<title></title>\n\t<meta name='keywords' content=''>\n\t<meta name='description' content=\"\">\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=EmulateIE7\" />\n\t<link href='css/styles_main.css'    rel=\"styleSheet\"  type='text/css' />\n\n\t<link href='css/styles_header.css'  rel=\"styleSheet\"  type='text/css' />\n\t<link href='css/styles_middle.css'  rel=\"styleSheet\"  type='text/css' />\n\t<link href='css/styles_tables.css'  rel=\"styleSheet\"  type='text/css' />\n\t<link href=\"css/styles_rounded.css\" rel=\"stylesheet\"  type=\"text/css\" />\n\t<!--[if lt IE 7]>\n\t<link rel='stylesheet' type='text/css' href='css/styles_ie.css' />\n\t<![endif]-->\n\t<!--[if IE 7]>\n\t<link rel='stylesheet' type='text/css' href='css/styles_ie7.css' />\n\t<![endif]-->\n\t\t<link rel=\"stylesheet\" type=\"text/css\" rel=\"styleSheet\"  href=\"ressources/templates/default/contact.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" rel=\"styleSheet\"  href=\"ressources/templates/default/menus_top.css\" />\n\t\t<link href=\"css/calendar.css\" rel=\"stylesheet\" type=\"text/css\">\n\t\t<link href=\"js/jqueryFileTree.css\" rel=\"stylesheet\" type=\"text/css\">\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/uploadify.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/artica-theme/jquery-ui-1.7.2.custom.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.jgrowl.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.cluetip.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/jquery.treeview.css\" />\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"css/thickbox.css\" media=\"screen\"/>\n\t\t<div id='PopUpInfos' style='position:absolute'></div>\n\t\t<div id='find' style='position:absolute'></div>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"XHRConnection.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"JavaScript\" src=\"mouse.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"default.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/cookies.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery-1.6.1.min.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jqueryFileTree.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.easing.1.3.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery-ui-1.8.custom.min.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/thickbox-compressed.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.simplemodal-1.3.3.min.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.jgrowl_minimized.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.cluetip.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.blockUI.js\"></script>\n\t\t<script type=\"text/javascript\" language=\"javascript\" src=\"js/jquery.treeview.min.js\"></script>\n\t\t<script type='text/javascript' language='javascript' src='/js/jquery.uilock.min.js'></script>\n\t\t<script type='text/javascript' language='javascript' src='/js/jquery.blockUI.js'></script>  \n\t\t<!-- js Artica  -->\n\n\n</head>\n<body>\n<!-- LINE " . __LINE__ . " -->\t\t\n<center>\n<div style=\"width:900px;background-image:url(/css/images/{$logo_bg});background-repeat:repeat-x;background-position:center top;margin:0px;padding:0px;\">\n\t<table style=\"width:100%;margin:0px;padding:0px;border:0px;\">\n\t\t<tr>\n\t\t    <td valign=\"top\" style='padding:0px;margin:0px;border:0px;padding-top:24px'>\n\t\t\t<div style=\"height:72px\">\n\t\t\t\t<table style=\"padding:0px;margin:0px;border:0px;margin-left:-6px;\">\n\t\t\t\t<tr>\n\t\t\t   \t\t<td style='padding:0px;border:0px;' valign=\"top\" align=\"left\">\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<table style=\"margin:0px;border:0px;padding:0px;\">\n\t\t\t\t\t\t\t<tr>\n\t\t\t \t\t\t\t<td style=\"margin:0px;padding:0px;background-color:{$bg_color}\" width=\"160px\">\n\n\t\t\t\t\t\t\t\t<img src='/css/images/{$logo}' style=\"margin:0px;padding:0px;\">\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style=\"margin:0px;padding:0px;\" valign=\"middle\">\n\t\t\t\t\t\t\t\t<div style=\"margin-top:-7px;padding-left:5px\"> </div>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td style=\"margin:0px;padding:0px;border:0px solid black\" valign=\"middle\" align='right' width=50%>\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t</tr>\n\n\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\n\t\t\t\t\t  </td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t  <td style='height:25px'>\n\t\t\t\t\t<div id='menus_2'><ul></ul></div id='menus_2'>\n\t\t\t\t </td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\n\t\t</div>\n\t\t     </td>\n\t\t  \n\t\t\t\n\t\t \n\t    \t</tr>\n\t\t<tr>\n\t\t<td valign=\"top\" colspan=2 style=\"margin:0px;padding:0px;padding-top:4px;background-color:white;\">\t\n<div id='middle'>\n\t<div id='content' style='background-color:white;'>\n\t\t<table style='width:100%'>\n\t\t\t<tr>\n\n\t\t\t\t<td valign='top' style='padding:0px;margin:0px;width:150px'>\n\t\t\t\t\t\n\t\t\t\t</td>\n\t\t\t\t<td valign='top' style='padding-left:3px'>\n\t\t\t\t\t<div id='template_users_menus'></div>\n\t\t\t\t\t<div id='BodyContentTabs'></div>\n\t\t\t\t\t\t<div id='BodyContent'>\n\t\t\t\t\t\t\t<h1 id='template_title'></h1>\n\t\t\t\t\t\t\t<!-- content -->\n\t\t\t\t\t\t\t\n\n<script>\nfunction SaveSession(){\n\tvar template=document.getElementById('template').value;\n\tvar lang=document.getElementById('lang').value;\n\tSet_Cookie('artica-template', template, '3600', '/', '', '');\n\tSet_Cookie('artica-language', lang, '3600', '/', '', '');\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('lang',lang);\n\tXHR.sendAndLoad('logon.php', 'GET');\t\t\n\tlocation.reload();\n}\n\nfunction LoadModal(){\n\$('#loginform').modal({onOpen: function (dialog) {\n\tdialog.overlay.fadeIn('slow', function () {\n\t\tdialog.container.slideDown('slow', function () {\n\t\t\tdialog.data.fadeIn('slow');\n\t\t});\n\t});\n}});\n\n\n\n}\n\n\n</script>\n\n\n<center>\n\t<div id='loginform'></div>\n</center>\n<!-- content end -->\n\t\t\t\t\t\t</div>\n\n\t\t\t\t</td>\n\n\t\t\t\t<td valign='top'></td>\n\t\t\t</tr>\t\n\t</table>\t\n\n\t<div class='clearleft'></div>\n\t<div class='clearright'></div>\n\t</div id='content'>\n\n</div id='middle'>\n</td>\n</tr>\n<tr>\n<td valign='top' align=left colspan=2 >\n<div style='background-color:#736e6c;font-size:13px;color:{$LinkColor};height:25px;padding:0px;margin:0px;padding-top:5px;\nwidth:900px;text-align:center;margin-left:-5px;margin-bottom:-3px'>\n\n<strong>{$ProductName} Copyright 2006-" . date('Y') . "</strong>\n</div>\n</td>\n</tr>\n</table>\n</div>\n</center>\n<script>\ndocument.getElementById('loginform').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';\nLoadjs('logon.php?start=yes',true);</script>\n\t\t<div id=\"SetupControl\" style='width:0;height:0'></div>\n\t\t<div id=\"dialogS\" style='width:0;height:0'></div> \n\t\t<div id=\"dialogT\" style='width:0;height:0'></div> \n\t\t<div id=\"dialog0\" style='width:0;height:0'></div> \n\t\t<div id=\"dialog1\" style='width:0;height:0'></div>\n\t\t<div id=\"dialog2\" style='width:0;height:0'></div> \n\t\t<div id=\"dialog3\" style='width:0;height:0'></div>\n\t\t<div id=\"dialog4\" style='width:0;height:0'></div>\n\t\t<div id=\"dialog5\" style='width:0;height:0'></div>\n\t\t<div id=\"dialog6\" style='width:0;height:0'></div>\n\t\t<div id=\"YahooUser\" style='width:0;height:0'></div>\n\t\t<div id=\"logsWatcher\" style='width:0;height:0'></div>\n\t\t<div id=\"WinORG\" style='width:0;height:0'></div>\n\t\t<div id=\"WinORG2\" style='width:0;height:0'></div>\n\t\t<div id=\"RTMMail\" style='width:0;height:0'></div>\n\t\t<div id=\"Browse\" style='width:0;height:0'></div>\n\t\t<div id=\"SearchUser\" style='width:0;height:0'></div>\n</body>\n</html>";
    return $html;
}