예제 #1
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;
}
예제 #2
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;
}
예제 #3
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;

}
예제 #4
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;
}