function refresh_service_status() { if (!$GLOBALS["VERBOSE"]) { if (GET_CACHED(__FILE__, __FUNCTION__, md5($_GET["refresh-service-status"]), false, 1)) { return; } } $refresh["C-ICAP"] = "APP_C_ICAP"; if (preg_match("#SERVICE-STATUS-ROUND-(.+)#", $_GET["refresh-service-status"], $re)) { $tpl = new templates(); $key = $re[1]; if ($GLOBALS["VERBOSE"]) { echo "Prod: {$key}\n<br>"; } $content = GetIniContent($key); if ($content == null) { if (!is_file("ressources/logs/global.status.ini")) { return; } $bsini = new Bs_IniHandler("ressources/logs/global.status.ini"); } else { $bsini = new Bs_IniHandler(); $bsini->loadString($content); } if ($bsini->_params[$key]["service_name"] == null) { return null; } $prod = $bsini->_params[$key]["service_name"]; $status = DAEMON_STATUS_ROUND($key, $bsini); $html = $tpl->_ENGINE_parse_body($status); SET_CACHED(__FILE__, __FUNCTION__, md5($_GET["refresh-service-status"]), $html); echo $html; } }
function tabs() { if (GET_CACHED(__FILE__, __FUNCTION__)) { return; } $squid = new squidbee(); $tpl = new templates(); $users = new usersMenus(); $page = CurrentPageName(); $sock = new sockets(); $array["popup"] = '{parameters}'; $array["schedules"] = '{schedules}'; $array["events"] = '{events}'; $fontsize = 18; $t = time(); while (list($num, $ligne) = each($array)) { if ($num == "schedules") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"schedules.php?ForceTaskType=69\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n"); continue; } if ($num == "events") { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"cyrus.watchdog-events.php\" style='font-size:{$fontsize}px'><span>{$ligne}</span></a></li>\n"); continue; } $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}={$t}\" style='font-size:{$fontsize}'><span>{$ligne}</span></a></li>\n"); } $html = build_artica_tabs($html, 'main_cyrus_backup'); SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; }
function menus() { include_once 'ressources/class.templates.inc'; if (GET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__)) { return null; } $users = new usersMenus(); if (!$users->AsSystemAdministrator) { $html = "\n\t\t<input type='hidden' id='isanuser' name ='isanuser' value='1'>\n\t\t<center><H2 style='color:red'>{logoff}</H2></center>\n\t\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); exit; } $sock = new sockets(); $AllowShutDownByInterface = $sock->GET_INFO('AllowShutDownByInterface'); $DisableRebootOrShutDown = $sock->GET_INFO('DisableRebootOrShutDown'); if ($AllowShutDownByInterface == 1) { $AllowShutDownByInterface_tr = "\n\t\t<td align='center'>\n\t\t\t" . imgtootltip('shutdown-computer-64.png', '{shutdown}', "Loadjs('logoff.php?shutdown-js=yes')") . "\n\t\t</td>\t\t\n\t\t"; } $reboot = imgtootltip('reboot-computer-64.png', '{restart_computer}', 'RestartComputer()'); if ($DisableRebootOrShutDown == 1) { $reboot = imgtootltip('reboot-computer-64-grey.png', '{restart_computer}'); if ($AllowShutDownByInterface_tr != null) { $AllowShutDownByInterface_tr = "<td align='center'>" . imgtootltip('shutdown-computer-64-grey.png', '{shutdown}') . "</td>"; } } $html = "\n\t<input type='hidden' id='shutdown_computer_text' value='{shutdown_computer_text}'>\n\t<input type='hidden' id='restart_computer_text' value='{restart_computer_text}'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td align='center'>\n\t\t\t" . imgtootltip('64-disconnect.png', '{logoff}', "MyHref('logoff.php')") . "\n\t\t</td>\t\t\n\t\t<td align='center'>\n\t\t\t{$reboot}\n\t\t</td>\n\t\t{$AllowShutDownByInterface_tr}\t\t\n\t</tr>\n\t</table>\n\t"; $tpl = new templates(); $page = $tpl->_ENGINE_parse_body($html); SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $page); echo $page; }
function tabs() { $html = GET_CACHED(__FILE__, __FUNCTION__, $_GET["newinterface"], TRUE); if ($html != null) { echo $html; } $page = CurrentPageName(); $users = new usersMenus(); $array["popup-main"] = "{BUILD_OPENVPN_CLIENT_CONFIG}"; $array["help"] = "{help}"; $font = "font-size:18px"; $newinterface = "&newinterface=yes"; while (list($num, $ligne) = each($array)) { if ($num == "OPENVPN_SCHEDULE_RUN") { $tab[] = "<li><a href=\"index.openvpn.schedule.php?popup=yes\"><span style='{$font}'>{$ligne}</span></a></li>\n"; continue; } $tab[] = "<li><a href=\"{$page}?{$num}=yes{$newinterface}\"><span style='{$font}'>{$ligne}</span></a></li>\n"; } $tpl = new templates(); $html = build_artica_tabs($tab, "main_openvpn_builclientconfig"); $tpl = new templates(); $html = $tpl->_ENGINE_parse_body($html); SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; }
function popup() { if (GET_CACHED(__FILE__, __FUNCTION__)) { return; } $html = "\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>\n\t\t\t<img src='img/change-mysql-128.png'>\n\t\t</td>\n\t\t<td valign='top'><div class=explain>{MYSQL_PASSWORD_USER_TEXT}</div>\n\t\t\t<table style='width:99.5%' class=form>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='top' class=legend nowrap>{username}:</td>\n\t\t\t\t\t<td valign='top'>" . Field_text('username', null, "font-size:14px;padding:3px") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td valign='top' class=legend>{password}:</td>\n\t\t\t\t\t<td valign='top'>" . Field_password('password', null, "font-size:14px;padding:3px;width:120px") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=2 align='right'>\n\t\t\t\t\t\t<hr>" . button("{change}", "ChangeMysqlPassword()") . "\n\t\t\t\t\t\t\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</table>\t\t\n\t\t</td>\n\t</tr>\n\t</table><hr>\n\t<div id='mysqldivForLogs' style='height:250px;overflow:auto'></div>\n\t"; $tpl = new templates(); $html = $tpl->_ENGINE_parse_body($html, "mysql.index.php"); SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; }
function page() { $sock = new sockets(); $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance"); $MalwarePatrolDatabasesCount = $sock->getFrameWork("cmd.php?MalwarePatrolDatabasesCount=yes"); if (GET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__)) { return; } $page = CurrentPageName(); $tpl = new templates(); $q = new mysql_squid_builder(); $users = new usersMenus(); $websitesnums = $q->COUNT_ROWS("visited_sites"); $websitesnums = numberFormat($websitesnums, 0, "", " "); $sql = "DELETE FROM categorize WHERE LENGTH(pattern)=0"; $q->QUERY_SQL($sql); $export = $q->COUNT_ROWS("categorize"); $export = numberFormat($export, 0, "", " "); $categories = $q->COUNT_CATEGORIES(); $categories = numberFormat($categories, 0, "", " "); $tablescat = $q->LIST_TABLES_CATEGORIES(); $tablescatNUM = numberFormat(count($tablescat), 0, "", " "); $q = new mysql_squid_builder(); $requests = $q->EVENTS_SUM(); $requests = numberFormat($requests, 0, "", " "); $PhishingURIS = $q->COUNT_ROWS("uris_phishing"); $PhishingURIS = numberFormat($PhishingURIS, 0, "", " "); $MalwaresURIS = $q->COUNT_ROWS("uris_malwares"); $MalwaresURIS = numberFormat($MalwaresURIS, 0, "", " "); $Computers = $q->COUNT_ROWS("webfilters_nodes"); $Computers = numberFormat($Computers, 0, "", " "); $DAYSNumbers = $q->COUNT_ROWS("tables_day"); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT SUM(totalsize) as tsize FROM tables_day")); $totalsize = FormatBytes($ligne["tsize"] / 1024); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT AVG(cache_perfs) as pourc FROM tables_day")); $pref = round($ligne["pourc"]); $ligne = mysql_fetch_array($q->QUERY_SQL("SELECT COUNT(sitename) as tcount FROM visited_sites WHERE LENGTH(category)=0")); $websitesnumsNot = numberFormat($ligne["tcount"], 0, "", " "); $CachePermformance = $q->CachePerfHour(); if ($CachePermformance > -1) { $color = "#E01313"; if ($CachePermformance > 20) { $color = "#6DBB6A"; } $cachePerfText = "\n\t\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b style='color:{$color}'>{$CachePermformance}%</b> {cache_performance} ({now})</td>\n\t\t</tr>\n\t\t"; } $mouse = "OnMouseOver=\";this.style.cursor='pointer';\" OnMouseOut=\";this.style.cursor='default';\""; $submenu = "\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$totalsize}</b> {downloaded_flow}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$pref}%</b> {cache_performance}</td>\n\t</tr>\n\t"; $main_table = "\n\t<table style='width:98%' class=form>\n\t<tr><td style='font-size:16px'>{statistics}::{status}</td></tr>\n\t{$cachePerfText}\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;><b>{$DAYSNumbers}</b> {daysOfStatistics}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$requests}</b> {requests}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px'><b>{$Computers}</b> {computers}</td>\n\t</tr>\t\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$websitesnums}</b> {visited_websites}</td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$categories}</b> {websites_categorized}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$PhishingURIS}</b> {phishing_uris}</td>\n\t</tr>\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$MalwaresURIS}</b> {viruses_uris}</td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$MalwarePatrolDatabasesCount}</b> Malware Patrol</td>\n\t</tr>\t\t\t\t\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$websitesnumsNot}</b> {not_categorized}</td>\n\t</tr>\t\t\t\t\n\t<tr>\n\t\t<td valign='top' style='font-size:14px;'><b>{$tablescatNUM}</b> {categories}</td>\n\t</tr>\n\t</table>\t\n"; $main_table = $tpl->_ENGINE_parse_body($main_table); SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $main_table); echo $main_table; }
function js() { if (GET_CACHED(__FILE__, __FUNCTION__, "js")) { return; } $tpl = new templates(); $title = $tpl->_ENGINE_parse_body("{organizations}"); $page = CurrentPageName(); $html = "\n\tvar timeout=0;\n\t\n\tfunction LoadOrg(){\n\t\t\$('#BodyContent').load('{$page}?js-pop=yes');\n\t}\n\t\n\tfunction OrgfillpageButton(){\n\tvar content=document.getElementById('orgs').innerHTML;\n\tif(content.length<90){\n\t\tsetTimeout('OrgfillpageButton()',900);\n\t\treturn;\n\t}\n\t\n\tLoadAjax('butadm','{$page}?butadm=yes');\n\t\n\t}\n\t\n\tLoadOrg();\n\t"; SET_CACHED(__FILE__, __FUNCTION__, "js", $html); echo $html; }
function popup() { if (GET_CACHED(__FILE__, __FUNCTION__, null)) { return null; } $page = CurrentPageName(); $html = "<p style='font-size:13px'>{smtpd_sasl_exceptions_networks_text}<br>{smtpd_sasl_exceptions_networks_explain}</p>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>\n\t\t\t<div id='smtpd_sasl_exceptions_networks_list'></div>\n\t\t</td>\n\t\t<td valign='top'>\n\t\t\t<div id='smtpd_sasl_exceptions_toolbox'></div>\n\t\t\t\n\t\t</td>\n\t</tr>\n\t</table>\n\t<script>\n\t\tLoadAjax('smtpd_sasl_exceptions_networks_list','{$page}?popup-list=yes');\n\t\tLoadAjax('smtpd_sasl_exceptions_toolbox','{$page}?popup-toolbox=yes');\n\t</script>\n\t"; $tpl = new templates(); $html = $tpl->_ENGINE_parse_body($html); SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; }
function js() { if (GET_CACHED(__FILE__, __FUNCTION__, null)) { return null; } $prefix = "smtpd_sasl_exceptions_networks_"; $page = CurrentPageName(); $users = new usersMenus(); $tpl = new templates(); $title = $tpl->_ENGINE_parse_body('{smtpd_sasl_exceptions_networks}'); $give_the_new_network = $tpl->javascript_parse_text("{give the new network}"); $html = "\n\nfunction SaslExceptionsNetworksLoadpage(){\n\tYahooWin5(550,'{$page}?popup=yes','{$title}');\n\t}\n\t\nvar X_smtpd_sasl_exceptions_networks_add= function (obj) {\n\tLoadAjax('smtpd_sasl_exceptions_networks_list','{$page}?popup-list=yes');\n\t}\n\t\t\n\n\nfunction smtpd_sasl_exceptions_networks_add(){\n\tvar a=prompt('{$give_the_new_network}');\n\t\tif(a){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('smtpd_sasl_exceptions_networks_add',a);\n\t\t\tdocument.getElementById('smtpd_sasl_exceptions_networks_list').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',X_smtpd_sasl_exceptions_networks_add);\n\t\t\t}\t\t\n\t}\n\t\nfunction smtpd_sasl_exceptions_delete(id_encrypted){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('smtpd_sasl_exceptions_networks_del',id_encrypted);\n\tdocument.getElementById('smtpd_sasl_exceptions_networks_list').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\tXHR.sendAndLoad('{$page}', 'GET',X_smtpd_sasl_exceptions_networks_add);\n\t\n\t}\n\n\t\nvar X_SmtpdSaslExceptionsMynetSave= function (obj) {\n\t\tLoadAjax('smtpd_sasl_exceptions_networks_list','{$page}?popup-list=yes');\n\t\tLoadAjax('smtpd_sasl_exceptions_toolbox','{$page}?popup-toolbox=yes');\n\t}\t\n\t\nfunction SmtpdSaslExceptionsMynetSave(){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('smtpd_sasl_exceptions_mynet',document.getElementById('smtpd_sasl_exceptions_mynet').value);\n\t\t\tdocument.getElementById('smtpd_sasl_exceptions_toolbox').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',X_SmtpdSaslExceptionsMynetSave);\n}\n\t\n\t\n\t\n\tSaslExceptionsNetworksLoadpage();\n"; SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; }
function popup_js() { if (GET_CACHED(__FILE__, __FUNCTION__, null)) { return true; } $page = CurrentPageName(); $js1 = file_get_contents("js/samba.js"); $js2 = file_get_contents("js/json.js"); $tpl = new templates(); $title = $tpl->_ENGINE_parse_body('{APP_SAMBA}'); $idmd = 'SambaIndex_'; //smb-status //dialogS_content $html = "var {$idmd}timerID = null;\nvar {$idmd}timerID1 = null;\nvar {$idmd}tant=0;\nvar {$idmd}reste=0;\nvar {$idmd}timeout=0;\n\n\tfunction {$idmd}demarre(){\n\t\tif(!document.getElementById('main_samba_config')){return;}\n\t\t\n\t\t{$idmd}tant = {$idmd}tant+1;\n\t\t{$idmd}reste=10-{$idmd}tant;\n\t\tif ({$idmd}tant < 10 ) { \n\t\t\t{$idmd}timerID = setTimeout(\"{$idmd}demarre()\",3000);\n\t } else {\n\t\t\t{$idmd}tant = 0;\n\t\t\t{$idmd}ChargeLogs();\n\t\t\t{$idmd}demarre(); \n\t }\n\t}\n\n\n\tfunction {$idmd}ChargeLogs(){\n\t\tLoadAjax('smb-status','{$page}?smb-status=yes');\n\t}\t\n\t\n\tfunction refresh_services(){\n\t\t{$idmd}ChargeLogs();\n\t}\n\t\n\tfunction StartPage(){\n\t\t\$('#BodyContent').load('{$page}?popup=yes');\n\t\t\n\t\n\t\t//YahooWinS(750,'{$page}?popup=yes','{$title}');\n\t\t//setTimeout(\"{$idmd}WaitToStart();\",500);\t\n\t\t\n\t}\n\t\n\tfunction {$idmd}WaitToStart(){\n\t\t{$idmd}timeout={$idmd}timeout+1;\n\t\tif({$idmd}timeout>30){alert('time-out');return ;}\n\t\tif(!document.getElementById('smb-status')){\n\t\t\tsetTimeout(\"{$idmd}WaitToStart();\",800);\n\t\t\treturn;\n\t\t}\n\t\t{$idmd}timeout=0;\n\t\tsetTimeout(\"{$idmd}ChargeLogs();\",500);\t\n\t\tsetTimeout(\"{$idmd}demarre()\",500);\t\n\t\n\t}\n\t\n\t{$js1}\n\t{$js2}\n\tStartPage();\n\t\n\t"; SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; }
function popup() { if (GET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__)) { return; } $ldap = new clladp(); $usersnumber = $ldap->COUNT_DE_USERS(); $ldap->ldap_close(); $tpl = new templates(); $users = $tpl->_ENGINE_parse_body("<i>{this_server_store}: <strong>{$usersnumber}</strong> {users}</i>"); $page = CurrentPageName(); $html = "<H1>{organizations}</H1>\n<input type='hidden' name='add_new_organisation_text' id='add_new_organisation_text' value='{add_new_organisation_text}'>\n<div style='font-size:16px;text-align:left;padding-bottom:5px;border-bottom:1px solid #CCCCCC'>{about_organization}</div>\n<div style='font-size:11px;text-align:right;padding-top:5px;'><span id='countdeusers'>{$users}</span></div>\n<div id='orgs' style='width:720px;height:350px;overflow:auto'></div>\n\n"; $tpl = new templates(); $html = $tpl->_ENGINE_parse_body($html); SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $html); echo $html; }
function js(){ if(GET_CACHED(__FILE__,__FUNCTION__,"js")){return;} $tpl=new templates(); $title=$tpl->_ENGINE_parse_body("{organizations}"); $page=CurrentPageName(); $html=" var timeout=0; function LoadOrg(){ $('#BodyContent').load('$page?js-pop=yes', function() {Orgfillpage();}); //LoadWinORG('760','$page?js-pop=yes','$title'); //setTimeout('Orgfillpage()',900); } function Orgfillpage(){ timeout=timeout+1; if(timeout>10){return;} if(!document.getElementById('orgs')){ setTimeout('Orgfillpage()',900); return; } LoadAjax('orgs','$page?ShowOrganizations=yes'); OrgfillpageButton(); } function OrgfillpageButton(){ var content=document.getElementById('orgs').innerHTML; if(content.length<90){ setTimeout('OrgfillpageButton()',900); return; } LoadAjax('butadm','$page?butadm=yes'); } LoadOrg(); "; SET_CACHED(__FILE__,__FUNCTION__,"js",$html); echo $html; }
function quicklinks_postfix() { if (GET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__)) { return; } $page = CurrentPageName(); $tpl = new templates(); $sock = new sockets(); $users = new usersMenus(); $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance"); $InnoDBFilePerTableAsk = $sock->GET_INFO("InnoDBFilePerTableAsk"); if (!is_numeric($EnablePostfixMultiInstance)) { $EnablePostfixMultiInstance = 0; } if (!is_numeric($InnoDBFilePerTableAsk)) { $InnoDBFilePerTableAsk = 0; } $the_specified_module_is_not_installed = $tpl->javascript_parse_text("{the_specified_module_is_not_installed}"); if ($users->POSTFIX_INSTALLED) { if ($users->AsPostfixAdministrator) { $tr[] = paragrapheWin("messaging-server-white-64.png", "{APP_POSTFIX}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','quicklinks.postfix.php?function=section_postfix')"); $tr[] = paragrapheWin("64-transport-white.png", "{transport_table}", "AnimateDiv('BodyContent');\n\t\t\t\tLoadAjax('BodyContent','postfix.transport.table.php?hostname=master')"); } } if ($users->POSTFIX_INSTALLED) { if ($users->ZARAFA_INSTALLED) { if ($users->AsMailBoxAdministrator) { $tr[] = paragrapheWin("zarafa-white-64.png", "{APP_ZARAFA}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','quicklinks.postfix.php?function=section_zarafa')"); $tr[] = paragrapheWin("webmail-64.png", "WebMail", "AnimateDiv('BodyContent');LoadAjax('BodyContent','zarafa.webmail.php')"); $tr[] = paragrapheWin("push-mail-64.png", "{smartphones}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','zarafa.zpush.php')"); } } } //$postfix_multiple=$tpl->_ENGINE_parse_body(quicklinks_paragraphe("postfix-multi-48.png", "multiple_instances",null, "QuickLinkPostfixMulti()")); if ($users->POSTFIX_INSTALLED) { if ($users->cyrus_imapd_installed) { if ($users->AsMailBoxAdministrator) { $tr[] = paragrapheWin("bg-cyrus-white-64.png", "{mailboxes}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','cyrus.index.php?popup-index=yes');"); if ($users->roundcube_installed) { $tr[] = paragrapheWin("webmail-white-64.png", "WebMail", "Loadjs('roundcube.index.php?script=yes&in-front-ajax=yes&newinterface=yes');"); } else { $tr[] = paragrapheWin("64-deny-white.png", "WebMail", "alert('{$the_specified_module_is_not_installed}');"); } $tr[] = paragrapheWin("database-check-64-white.png", "{backup}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','cyrus.backup.php?tabs=yes');"); } } if ($users->AsQuarantineAdministrator) { $tr[] = paragrapheWin("quarantine-64-white.png", "{quarantine}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','domains.quarantine.php?SuperAdmin=yes');"); } } //certified-64-white.png $opendkim = Paragraphe('certified-64.png', '{APP_OPENDKIM}', '{APP_OPENDKIM_TEXT}', "javascript:Loadjs('opendkim.php?mail=master')", null, 210, null, 0, true); $tr[] = paragrapheWin("folder-64-backup-white.png", "{backupemail_behavior}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','postfix.backup.fly.php?hostname=master')"); $tr[] = paragrapheWin("certified-64-white.png", "{APP_OPENDKIM}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','opendkim.php?popup=yes&mail=master')"); //$backup=Paragraphe('folder-64-backup-grey.png','{backupemail_behavior}','{feature_disabled}',"",null,210,100); //$backup=Paragraphe('folder-64-backup.png','{backupemail_behavior}','{backupemail_behavior_text}',"javascript:Loadjs('$page?script=backup')",null,210,100,0,true); if ($EnablePostfixMultiInstance == 0) { $postfix_multiple = null; } if (!$users->cyrus_imapd_installed) { $cyrus = null; } //$tr[]=$postfix_multiple; if ($users->POSTFIX_INSTALLED) { if ($users->AsPostfixAdministrator) { $tr[] = paragrapheWin("queue-64-white.png", "{queue_management}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','quicklinks.postfix.php?function=section_queue')"); $tr[] = paragrapheWin("whitelisting-white-64.png", "{white list}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','quicklinks.postfix.php?function=section_whitelist')"); if ($users->MAILMAN_INSTALLED) { if (!$users->LIGHT_INSTALL) { $tr[] = paragrapheWin("mailing-white-64.png", "mailman", "Loadjs('mailman.php?script=yes')"); } } $tr[] = paragrapheWin("fetch-white-64.png", "{APP_FETCHMAIL}", "AnimateDiv('BodyContent');LoadAjax('BodyContent','fetchmail.index.php?quicklinks=yes');"); } } $html = $tpl->_ENGINE_parse_body(CompileTr5_win($tr, true)); SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $html); echo $html; }
function main_network(){ if(GET_CACHED(__FILE__,__FUNCTION__,null)){return;} $users=new usersMenus(); $fw=Paragraphe('folder-64-firewall-grey.png','{APP_IPTABLES}','{error_app_not_installed_disabled}','','error_app_not_installed_disabled'); $nmap=Paragraphe('folder-64-nmap-grey.png','{APP_NMAP}','{error_app_not_installed_disabled}','','error_app_not_installed_disabled'); $network=Paragraphe('network-connection2.png','{net_settings}','{net_settings_text}',"javascript:Loadjs('system.nic.config.php?js=yes')",'net_settings_text'); $pdns=Buildicon64('DEF_ICO_PDNS'); $crossroads=Paragraphe('load-blancing-64-grey.png','{APP_CROSSROADS}','{load_balancing_intro_text}',""); if($users->IPTABLES_INSTALLED){ $fw=Paragraphe('folder-64-firewall.png','{APP_IPTABLES}','{APP_IPTABLES_TEXT}','iptables.index.php'); } if($users->HAMACHI_INSTALLED){ $hamachi=Paragraphe('logmein_logo-64.gif','{APP_AMACHI}','{APP_AMACHI_TEXT}',"javascript:Loadjs('hamachi.php')"); } if($users->nmap_installed){ $nmap=Paragraphe('folder-64-nmap.png','{APP_NMAP}','{APP_NMAP_TEXT}','nmap.index.php'); } $gateway=Paragraphe('relayhost.png','{APP_ARTICA_GAYTEWAY}','{APP_ARTICA_GAYTEWAY_TEXT}',"javascript:Loadjs('index.gateway.php?script=yes')"); $dhcp=Buildicon64('DEF_ICO_DHCP'); if($users->OPENVPN_INSTALLED){ $openvpn=Buildicon64('DEF_ICO_OPENVPN'); } $EmergingThreats=Paragraphe('emerging-threads-64-grey.png','{EmergingThreats}','{EmergingThreats_text}'); if($users->IPSET_INSTALLED){ $EmergingThreats=Paragraphe('emerging-threads-64.png','{EmergingThreats}', '{EmergingThreats_text}',"javascript:Loadjs('system.EmergingThreats.php')"); } $IpBlocksA=Paragraphe('ipblock-64-grey.png','{block_countries}','{ipblocks_text}'); if($users->IPSET_INSTALLED){ $IpBlocksA=Paragraphe('ipblock-64.png','{block_countries}', '{ipblocks_text}',"javascript:Loadjs('system.ipblock.php')"); } if(!$user->POWER_DNS_INSTALLED){$pdns=Paragraphe('dns-64-grey.png','{APP_PDNS}','{APP_PDNS_TEXT}');} if($users->KASPERSKY_SMTP_APPLIANCE){ $openvpn=null; $dhcp=null; $nmap=null; $fw=null; $gateway=null; } if($user->crossroads_installed){ $crossroads=Paragraphe('load-blancing-64.png','{APP_CROSSROADS}','{load_balancing_intro_text}', "javascript:Loadjs('crossroads.index.php')"); } $sock=new sockets(); $EnableQOSInterface=$sock->GET_INFO("EnableQOSInterface"); if($EnableQOSInterface==null){$EnableQOSInterface=1;} if($sock->GET_INFO("EnableQOSInterface")==1){ $qos=Paragraphe("qos-64.png","{Q.O.S}","{qos_intro}","javascript:Loadjs('qos.php')"); if(!$users->qos_tools_installed){ $qos=Paragraphe("qos-64-grey.png","{Q.O.S}","{qos_intro}",""); } } if($users->KASPERSKY_WEB_APPLIANCE){ $dhcp=null; $EmergingThreats=null; $fw=null; $nmap=null; $openvpn=null; } $tr[]=$network; $tr[]=$gateway; $tr[]=$dhcp; $tr[]=$qos; $tr[]=$pdns; $tr[]=$openvpn; $tr[]=$nmap; $tr[]=$crossroads; $tr[]=$fw; $tr[]=$EmergingThreats; $tr[]=$IpBlocksA; $tables[]="<table style='width:100%'><tr>"; $t=0; while (list ($key, $line) = each ($tr) ){ $line=trim($line); if($line==null){continue;} $t=$t+1; $tables[]="<td valign='top'>$line</td>"; if($t==3){$t=0;$tables[]="</tr><tr>";} } if($t<3){ for($i=0;$i<=$t;$i++){ $tables[]="<td valign='top'> </td>"; } } $tables[]="</table>"; $html=implode("\n",$tables); $tpl=new templates(); $html=$tpl->_ENGINE_parse_body($html); SET_CACHED(__FILE__,__FUNCTION__,null,$html); echo $html; }
function js_mysql_interface() { if (GET_CACHED(__FILE__, __FUNCTION__, null)) { return; } $content = MYSQL_MAX_EVENTS(); $tpl = new templates(); SET_CACHED(__FILE__, __FUNCTION__, null, $content); echo $tpl->_ENGINE_parse_body($content); }
function startpage() { $html = GET_CACHED(__FILE__, __FUNCTION__, $_GET["newinterface"], TRUE); if ($html != null) { return $html; } $page = CurrentPageName(); $users = new usersMenus(); if (!$users->OPENVPN_INSTALLED) { echo FATAL_ERROR_SHOW_128("{OPENVPN_NOT_INSTALLED}"); return; } $array["index"] = '{index}'; // $array["server-settings"] = "{service_parameters}"; $array["clients-scripts"] = "{clients_scripts}"; $array["additional_routes"] = "{additional_routes}"; $array["remote-sites"] = "{REMOTE_SITES_VPN}"; $array["events-session"] = "{sessions}"; $array["OPENVPN_SCHEDULE_RUN"] = "{OPENVPN_SCHEDULE_RUN}"; $array["events"] = "{events}"; $width = 755; if (isset($_GET["newinterface"])) { $width = "100%"; $newinterface = "&newinterface=yes"; } $font = "font-size:20px"; while (list($num, $ligne) = each($array)) { if ($num == "OPENVPN_SCHEDULE_RUN") { $tab[] = "<li><a href=\"index.openvpn.schedule.php?popup=yes\"><span style='{$font}'>{$ligne}</span></a></li>\n"; continue; } if ($num == "clients-scripts") { $tab[] = "<li><a href=\"index.openvpn.clients.php\"><span style='{$font}'>{$ligne}</span></a></li>\n"; continue; } if ($num == "additional_routes") { $tab[] = "<li><a href=\"index.openvpn.routes.php\"><span style='{$font}'>{$ligne}</span></a></li>\n"; continue; } if ($num == "remote-sites") { $tab[] = "<li><a href=\"openvpn.remotesites.php?infront=yes{$newinterface}\"><span style='{$font}'>{$ligne}</span></a></li>\n"; continue; } $tab[] = "<li><a href=\"{$page}?{$num}=yes{$newinterface}\"><span style='{$font}'>{$ligne}</span></a></li>\n"; } $tpl = new templates(); $html = build_artica_tabs($tab, "main_openvpn_config", 1490); $tpl = new templates(); $html = $tpl->_ENGINE_parse_body($html); SET_CACHED(__FILE__, __FUNCTION__, null, $html); return $html; }
function ptx_status($asroot=false){ $page=CurrentPageName(); if(GET_CACHED(__FILE__, __FUNCTION__,__FUNCTION__)){return;} $sock=new sockets(); $DisableAnyCache=$sock->GET_INFO("DisableAnyCache"); if(!is_numeric($DisableAnyCache)){$DisableAnyCache=0;} $SquidCacheLevel=$sock->GET_INFO("SquidCacheLevel"); if(!is_numeric($SquidCacheLevel)){$SquidCacheLevel=4;} if($SquidCacheLevel==0){$DisableAnyCache=1;} $SquidBoosterMem=$sock->GET_INFO("SquidBoosterMem"); if(!is_numeric($SquidBoosterMem)){$SquidBoosterMem=0;} $ptxt="<a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('squid.booster.php');\" style='font-size:12px;text-decoration:underline'>{squid_booster}</a>"; if($SquidBoosterMem>0){ if($DisableAnyCache==0){ $pourc=$sock->getFrameWork("squid.php?boosterpourc=yes"); $ptxt=" <table> <tr> <td>$ptxt</td> <td>". pourcentage($pourc)."</td> </tr> </table>"; } } SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $ptxt."<script>UnlockPage();</script>"); if($asroot){ return; } $tpl=new templates(); echo $tpl->_ENGINE_parse_body($ptxt)."<script>UnlockPage();</script>"; }
function rttm_logs() { if (!isset($_GET["force-refresh"])) { if (GET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__)) { return null; } } $sql = __sql_domain($_GET["ou"]); $q = new mysql(); $results = $q->QUERY_SQL($sql, "artica_events"); while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) { $count = $count + 1; $tr = $tr . format_line($ligne); } $tpl = new templates(); $html = $tpl->_ENGINE_parse_body("\n\t<hr><div style='text-align:right;padding:4px'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshRTMMTableForce()") . "</div>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<th> </th>\n\t\t<th>{date}</th>\n\t\t<th>{from}</th>\n\t\t<th> </th>\n\t\t<th>{to}</th>\n\t\t<th>{status}</th>\n\t</tr>\n\t{$tr}</table>"); SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $html); echo $html; }
function main_graphs() { if (GET_CACHED(__FILE__, __FUNCTION__)) { return; } $page = CurrentPageName(); $t = time() . rand(0, time()); $html = "\n\t<div id='{$t}-1' style='width:990px;height:450px'></div>\n\t\n\t<div id='{$t}-2' style='width:990px;height:450px'></div>\n\t\n\t<div id='{$t}-3' style='width:990px;height:450px'></div>\n\t<script>\n\t\tAnimateDiv('{$t}-1');\n\t\tAnimateDiv('{$t}-2');\n\t\tAnimateDiv('{$t}-3');\n\t\t\n\t\tfunction F1{$t}(){\n\t\t\tLoadjs('{$page}?graph1=yes&container={$t}-1');\n\t\t}\n\t\t\n\t\tfunction F2{$t}(){\n\t\t\tLoadjs('{$page}?graph2=yes&container={$t}-2');\n\t\t}\t\t\n\n\t\t\n\t\tfunction F3{$t}(){\n\t\t\tLoadjs('{$page}?graph3=yes&container={$t}-3');\n\t\t}\t\t\n\t\tsetTimeout('F1{$t}()',500);\n\t\tsetTimeout('F2{$t}()',1000);\n\t\tsetTimeout('F3{$t}()',1500);\n\t\t\n\t</script>\n\t"; SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; }
function popup_status(){ if(GET_CACHED(__FILE__, __FUNCTION__)){return;} $page=CurrentPageName(); $tpl=new templates(); $sock=new sockets(); $datas=base64_decode($sock->getFrameWork('cmd.php?Global-Applications-Status=yes')); $ini=new Bs_IniHandler(); $ini->loadString($datas); $users=new usersMenus(); if($users->YAFFAS_INSTALLED){ $yaffas="<div class=text-info>{APP_YAFFAS_TEXT}</div>"; } if($ini->_params["APP_ZARAFA"]["master_version"]==null){unset($ini->_params["APP_ZARAFA"]["master_version"]);} if(!isset($ini->_params["APP_ZARAFA"]["master_version"])){ $datas=base64_decode($sock->getFrameWork('cmd.php?zarafa-status=yes')); $ini->loadString($datas); } $html=" <table style='width:100%'> <tr> <td valign='top' width=1%><span id='zarafa-box'></span></td> <td valign='top' width=99%> <H3 style='font-size:22px;font-weight:bold'>{APP_ZARAFA} v{$ini->_params["APP_ZARAFA"]["master_version"]}</H3> <div id='zarafa-error' style='color:#FB0808;font-weight:bold;font-size:14px'></div> <div class=text-info style='font-size:14px'>{APP_ZARAFA_TEXT}</div>$yaffas <table style='width:100%'> <tr> <td width=1%><img src='img/arrow-right-24.png'></td> <td nowrap> <a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('postfix.events.new.php?js-zarafa=yes');\" style='font-size:13px;text-decoration:underline'>{APP_ZARAFA}:{events}</a> </td> </tr> <tr> <td width=1%><img src='img/arrow-right-24.png'></td> <td nowrap><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('zarafa.audit.logs.php');\" style='font-size:13px;text-decoration:underline'>{APP_ZARAFA}:{audit}</a></td> </tr> <tr> <td width=1%><span id='mysql-dedie-img'></span></td> <td nowrap><a href=\"javascript:blur();\" OnClick=\"javascript:Loadjs('ZarafaDB.wizard.php')\" id='mysql-dedie-text' style='font-size:13px;text-decoration:underline'></a></td> </tr> </table> </td> </tr> </table> <div id='zarafa-services-status' style='width:100%;'></div> <script> LoadAjax('zarafa-services-status','$page?services-status=yes'); LoadAjaxTiny('zarafa-box','$page?zarafa-box=yes'); </script> "; $html=$tpl->_ENGINE_parse_body($html); SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; }
function organization_users_find_member() { $t = time(); $html = "\n\t<div id='{$t}'></div>\n\t<script>\n\t\tLoadAjax('{$t}','domains.manage.org.findusers.php?ou={$ou}');\n\t</script>\n\t"; echo $html; return; $keycached = "{$_GET["finduser"]}{$_GET["ou"]}"; if (GET_CACHED(__FILE__, __FUNCTION__, $keycached)) { return true; } $sock = new sockets(); $tofind = $_GET["finduser"]; $tpl = new templates(); $page = CurrentPageName(); $EnableManageUsersTroughActiveDirectory = $sock->GET_INFO("EnableManageUsersTroughActiveDirectory"); if (!is_numeric($EnableManageUsersTroughActiveDirectory)) { $EnableManageUsersTroughActiveDirectory = 0; } if (is_base64_encoded($_GET["ou"])) { $ou_encoded = $_GET["ou"]; $ou = base64_decode($_GET["ou"]); } else { $ou = $_GET["ou"]; $ou_encoded = base64_encode($_GET["ou"]); } writelogs("Find users {$tofind} in {$ou} (encoded={$_GET["ou"]}) EnableManageUsersTroughActiveDirectory:{$EnableManageUsersTroughActiveDirectory}", __FUNCTION__, __FILE__, __LINE__); if ($_SESSION["uid"] != -100) { $ou = $_SESSION["ou"]; } if ($tofind == null) { $tofind = '*'; } else { $tofind = "*{$tofind}*"; } $filter = "(&(objectClass=userAccount)(|(cn={$tofind})(mail={$tofind})(displayName={$tofind})(uid={$tofind}) (givenname={$tofind})))"; $attrs = array("displayName", "uid", "mail", "givenname", "telephoneNumber", "title", "sn", "mozillaSecondEmail", "employeeNumber", "sAMAccountName"); if ($EnableManageUsersTroughActiveDirectory == 1) { $cc = new ldapAD(); $hash = $cc->find_users($ou, $tofind); } else { $ldap = new clladp(); $dn = "ou={$ou},dc=organizations,{$ldap->suffix}"; $hash = $ldap->Ldap_search($dn, $filter, $attrs, 150); } $users = new user(); $number = $hash["count"]; if (!is_numeric($number)) { $number = 0; } $bg = "#FFFFFF"; writelogs("Find users {$tofind} in ou {$ou} DN:\"{$dn}\" (encoded={$_GET["ou"]}) {$number} items", __FUNCTION__, __FILE__, __LINE__); $html = "\n\t\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td valign='top'>\n\t\t<div style='width:100%;height:560px;overflow:auto'>\t\n\t\t<table cellspacing='0' cellpadding='0' border='0' class='tableView' style='width:100%'>\n\t\t<thead class='thead'>\n\t\t\t<tr>\n\t\t\t\t<th colspan=4>{$tofind}</th>\n\t\t\t</tr>\n\t\t</thead>\n\t\t<tbody class='tbody'>\n\t\t\t\t\n\t"; $add_user_disabled = Paragraphe('folder-useradd-64-grey.png', '{create_user}', '{create_user_text}'); $add_user = Paragraphe('folder-useradd-64.png', '{create_user}', '{create_user_text}', "javascript:Loadjs('domains.add.user.php?ou={$ou}')", null, 210, null, 0, true); $groups = Paragraphe('folder-group-64.png', '{manage_groups}', '{manage_groups_text}', "javascript:Loadjs('domains.edit.group.php?ou={$ou_encoded}&js=yes')", null, 210, 100, 0, true); $delete_all_users = Paragraphe('member-64-delete.png', '{delete_all_users}', '{delete_all_users_text}', "javascript:DeleteAllusers()", null, 210, 100, 0, true); if ($EnableManageUsersTroughActiveDirectory == 1) { $delete_all_users = Paragraphe('member-64-delete-grey.png', '{delete_all_users}', '{delete_all_users_text}', "", null, 210, 100, 0, true); } $usermenus = new usersMenus(); if ($usermenus->ARTICA_META_ENABLED) { if ($sock->GET_INFO("AllowArticaMetaAddUsers") != 1) { $add_user = $add_user_disabled; } } if ($EnableManageUsersTroughActiveDirectory == 1) { $add_user = $add_user_disabled; } $delete_all_users_warn = $tpl->javascript_parse_text("{delete_all_users_warn}"); for ($i = 0; $i < $number; $i++) { $userARR = $hash[$i]; $uid = $userARR["uid"][0]; if ($EnableManageUsersTroughActiveDirectory == 1) { $uid = $userARR["samaccountname"][0]; } if ($uid == "squidinternalauth") { continue; } $js = MEMBER_JS($uid, 1, 1); if ($userARR["sn"][0] == null && $userARR["givenname"][0] == null) { $userARR["sn"][0] = $uid; } $sn = texttooltip($userARR["sn"][0], "{display}:{$uid}", $js, null, 0, "font-size:13px"); $givenname = texttooltip($userARR["givenname"][0], "{display}:{$uid}", $js, null, 0, "font-size:13px"); $title = texttooltip($userARR["title"][0], "{display}:{$uid}", $js, null, 0, "font-size:13px"); $mail = texttooltip($userARR["mail"][0], "{display}:{$uid}", $js, null, 0, "font-size:13px"); $telephonenumber = texttooltip($userARR["telephonenumber"][0], "{display}:{$uid}", $js, null, 0, "font-size:13px"); if ($classtr == "oddRow") { $classtr = null; } else { $classtr = "oddRow"; } $img = imgtootltip("contact-48.png", "{apply}", $js); if ($userARR["telephonenumber"][0] == null) { $userARR["telephonenumber"][0] = " "; } if ($userARR["mail"][0] == null) { $userARR["mail"][0] = " "; } $html = $html . "<tr class={$classtr}>\n\t\t\t\t\t\t<td width=1% style='font-size:12px'>{$img}</td>\n\t\t\t\t\t\t<td width=50% style='font-size:12px'>{$userARR["sn"][0]} {$userARR["givenname"][0]}<div><i>{$userARR["title"][0]}</i></div></td>\n\t\t\t\t\t\t<td width=1% style='font-size:12px'>{$userARR["telephonenumber"][0]}</td>\n\t\t\t\t\t\t<td width=50% style='font-size:12px' nowrap>{$userARR["mail"][0]}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\n\t\t"; } $html = $html . "</table>\n\t</div>\n\t</td>\n\t<td valign='top' width=1%>{$add_user}<br>{$groups}<br>{$delete_all_users}</td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\t\n\tvar X_DeleteAllusers= function (obj) {\n\t\tvar results=trim(obj.responseText);\n\t\tif(results.length>0){alert(results);}\n\t\tLoadAjax('org_user_list','{$page}?finduser=&ou='+escape('{$ou}'));\n\t\t}\t\t\n\n\t\tfunction DeleteAllusers(){\n\t\t\tif(confirm('{$delete_all_users_warn}')){\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('DeleteAllUsersInOu','yes');\n\t\t\tXHR.appendData('ou','{$ou}');\n\t\t\tdocument.getElementById('org_user_list').src='img/wait_verybig.gif'; \t\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',X_DeleteAllusers);\n\t\t\t}\n\t\t\n\t\t}\n\t\n</script>\t\n\t"; $html = $tpl->_ENGINE_parse_body($html); SET_CACHED(__FILE__, __FUNCTION__, $keycached, $html); echo $html; }
function tweaks() { if (GET_CACHED(__FILE__, __FUNCTION__, null)) { return; } $sock = new sockets(); $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance"); $users = new usersMenus(); $page = CurrentPageName(); $tpl = new templates(); if ($users->ALTERMIME_INSTALLED) { $altermime = Paragraphe('icon_settings-64.png', '{disclaimer}', '{disclaimer_text}', "javascript:Loadjs('amavis.index.php?altermime-js=yes')", 90); } else { //$altermime=ParagrapheTEXT_disabled('icon_settings-48.png','{disclaimer}','{disclaimer_text}',null,90); } if ($users->POMMO_INSTALLED) { $pommo = Paragraphe('64-pommo.png', '{APP_POMMO}', '{APP_POMMO_TEXT}', "javascript:Loadjs('pommo.index.php?pommo-js=yes')", 90); } else { //$pommo=ParagrapheTEXT_disabled('48-pommo.png','{APP_POMMO}','{APP_POMMO_TEXT}',null,90); } if ($users->zip_installed) { if ($users->AMAVIS_INSTALLED) { if ($users->EnableAmavisDaemon == 1) { $winzip = Paragraphe('64-winzip.png', '{auto-compress}', '{auto-compress_text}', "javascript:Loadjs('auto-compress.php?script=winzip')", 90); } } } if ($users->POSTMULTI) { $multi = Paragraphe('postfix-multi-64.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', "javascript:Loadjs('postfix.network.php?POSTFIX_MULTI_INSTANCE_JS=yes')", 90); } else { //$multi=ParagrapheTEXT_disabled('postfix-multi-48.png','{POSTFIX_MULTI_INSTANCE}','{POSTFIX_MULTI_INSTANCE_TINY_TEXT}',null,90); } if ($users->MEM_TOTAL_INSTALLEE < 700000) { $multi = ParagrapheTEXT_disabled('postfix-multi-64.png', '{POSTFIX_MULTI_INSTANCE}', '{POSTFIX_MULTI_INSTANCE_TINY_TEXT}', null, 90); $multi = null; } $postfixStop = Paragraphe('pause-64.png', '{stop_messaging}', '{stop_messaging_text}', "javascript:Loadjs('postfix.stop.php',true)", 90); //$postfix_restrictions_classes=Paragraphe('folder-64-restrictions-classes.png','{postfix_restrictions_classes}','{restriction_classes_minitext}',"javascript:Loadjs('postfix.restrictions.classes.php?js=yes')",90); $events = Paragraphe('64-mailevents.png', '{postfix_events}', '{logs_viewer_text}', "javascript:s_PopUp('postfix.events.php?pop=true',450,400)", 90); //$storage=Paragraphe('folder-storage2-64.png','{storage_rules}','{storage_rules_text}',"javascript:Loadjs('postfix.storage.rules.php')",90); //$main_src=Paragraphe('folder-script-database-64.png','{main_ldap}','{main_ldap_explain}',"javascript:s_PopUp(\"postfix.report.php\",500,500,true)",90); $watchdog_queue = Paragraphe('folder-watch-64.png', '{watchdog_queue}', '{watchdog_queue_text}', "javascript:Loadjs('postfix.postqueuep.php',true)", 90); $postmaster = Paragraphe('postmaster-64.png', '{postmaster}', '{postmaster_text}', "javascript:Loadjs('postfix.postmaster.php')", 90); $postmaster_identity = Paragraphe('postmaster-identity.png', '{postmaster_identity}', '{postmaster_identity_text}', "javascript:Loadjs('postfix.postmaster-ident.php',true)", 90); $UnknownUsers = Paragraphe('unknown-user-64.png', '{unknown_users}', '{postfix_unknown_users_tinytext}', "javascript:Loadjs('postfix.luser_relay.php',true)", 90); $RemoveMessaging = Paragraphe('delete-64.png', '{disable_messaging}', '{disable_messaging_text}', "javascript:Loadjs('postfix.disable.php',true)", 90); $ActiveDirectory = Paragraphe('wink-64.png', '{active_directory_link}', '{active_directory_linkmail_text}', "javascript:Loadjs('{$page}?active_directory_link=yes')", 90); //$massmailing=ParagrapheTEXT_disabled('mass-mailing-postfix-48.png','{emailings}','{ENABLE_MASSMAILING_TEXT}',null,90); if ($users->EMAILRELAY_INSTALLED) { $massmailing = Paragraphe('mass-mailing-postfix-64.png', '{emailings}', '{ENABLE_MASSMAILING_TEXT}', "javascript:Loadjs('postfix.massmailing.php',true)", 90); } //$multi_infos=ParagrapheTEXT_disabled('postfix-multi-48-info.png','{POSTFIX_MULTI_INSTANCE_INFOS}', ///'{POSTFIX_MULTI_INSTANCE_INFOS_TEXT}',null,90); if ($EnablePostfixMultiInstance == 1) { $main_src = null; $performances = ParagrapheTEXT_disabled('folder-performances-64.png', '{performances_settings}', '{performances_settings_text}', null, 90); $performances = null; $mastercf = null; $maincfedit = null; $maincf = null; $postfix_restrictions_classes = null; $storage = null; $other = null; $multi_infos = Paragraphe('postfix-multi-64-info.png', '{POSTFIX_MULTI_INSTANCE_INFOS}', '{POSTFIX_MULTI_INSTANCE_INFOS_TEXT}', "javascript:Loadjs('postfix.multiple.instances.infos.php')"); $postfixStop = Paragraphe('pause-64-grey.png', '{stop_messaging}', '{stop_messaging_text}', "", 90); } $q = new mysql(); $table_storage = $q->TABLE_STATUS("storage", "artica_backup"); if ($table_storage["Rows"] > 0) { $backup_query = Paragraphe('64-backup.png', "{$table_storage["Rows"]} {backuped_mails}", '{all_mailbackup_text}', "javascript:Loadjs('domains.backup.php?js=yes&Master=yes')"); } if ($users->MAILMAN_INSTALLED) { $mailman = Paragraphe('mailman-64.png', '{APP_MAILMAN}', '{manage_distribution_lists}', "javascript:Loadjs('mailman.php?script=yes')"); } $tr[] = $multi; $tr[] = $multi_infos; $tr[] = $postfixStop; $tr[] = $RemoveMessaging; $tr[] = $watchdog_queue; $tr[] = $massmailing; $tr[] = $pommo; $tr[] = $postmaster; $tr[] = $postmaster_identity; $tr[] = $UnknownUsers; $tr[] = $backup_query; $tr[] = $mailman; $tr[] = $events; $tr[] = $altermime; $tr[] = $maincf; $tr[] = $main_src; $tr[] = $maincfedit; $tr[] = $mastercf; $tr[] = $storage; $tr[] = $postfix_restrictions_classes; $tr[] = $other; $icons = CompileTr2($tr, 'form'); $refresh = "<div style='width:100%;text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "RefreshIndexPostfixAjax()") . "</div>"; $main = "<input type='hidden' id='monitor_page' value='1' name='monitor_page'>\n{$refresh}\n<table style='width:100%'>\n<tbody>\n<tr>\n\t<td style='width:99%'>{$icons}</td>\n\t<td style='vertical-align:top'><div id='Postfixservinfos' style='width:450px'></div>\n</tr>\n</tbody>\n</table>\n"; $html = "{$main}\n\n<script>\n\t\t\n</script>\n"; $datas = $tpl->_ENGINE_parse_body($html); $datas = $datas . "\n<script>\n\tLoadAjax('Postfixservinfos','{$page}?postfix-status=yes');\n</script>\n"; SET_CACHED(__FILE__, __FUNCTION__, null, $datas); return $datas; }
function left_menus_actions() { $cachePage = dirname(__FILE__) . "/ressources/logs/web/" . basename(__FILE__) . "." . __FUNCTION__; if (!$GLOBALS["AS_ROOT"]) { if (is_file($cachePage)) { $users = new usersMenus(); if ($users->AsSystemAdministrator) { $data = @file_get_contents($cachePage); if (strlen($data) > 45) { $tpl = new templates(); echo $tpl->_ENGINE_parse_body($data) . wizards(); return; } } } } $users = new usersMenus(); if (!$GLOBALS["AS_ROOT"]) { if ($GLOBALS["VERBOSE"]) { echo __LINE__ . " Saving {$cachePage}\n"; } if (GET_CACHED(__FILE__, __FUNCTION__, null, false, 1)) { return; } if (internal_load() > 1.2) { if (GET_CACHED(__FILE__, __FUNCTION__)) { return; } } } else { $users->AsPostfixAdministrator = true; $users->AsAnAdministratorGeneric = true; $users->AsWebStatisticsAdministrator = true; $users->AsPostfixAdministrator = true; } if ($GLOBALS["VERBOSE"]) { echo __LINE__ . " Saving {$cachePage}\n"; } $sock = new sockets(); $tpl = new templates(); $f = array(); $EnableRemoteStatisticsAppliance = $sock->GET_INFO("EnableRemoteStatisticsAppliance"); if (!is_numeric($EnableRemoteStatisticsAppliance)) { $EnableRemoteStatisticsAppliance = 0; } $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance"); if ($EnableWebProxyStatsAppliance == 1) { $users->SQUID_INSTALLED = true; } $OnlySMTP = false; if ($users->SMTP_APPLIANCE) { $OnlySMTP = true; } if ($users->KASPERSKY_SMTP_APPLIANCE) { $OnlySMTP = true; } if ($GLOBALS["VERBOSE"]) { echo __LINE__ . " Saving {$cachePage}\n"; } if (!$users->PROXYTINY_APPLIANCE) { if ($users->SQUID_INSTALLED) { if ($users->AsWebStatisticsAdministrator) { $SQUIDEnable = $sock->GET_INFO("SQUIDEnable"); if (!is_numeric($SQUIDEnable)) { $SQUIDEnable = 1; } if ($EnableRemoteStatisticsAppliance == 0) { if ($SQUIDEnable == 1) { if (!$users->SQUID_REVERSE_APPLIANCE) { $f[] = left_menus_format("CATEGORIZE_A_WEBSITE", "32-categories-add.png", "Loadjs('squid.visited.php?add-www=yes')", "ADDWEBSITE_PROXY_EXPLAIN"); $f[] = left_menus_format("whitelist_website", "domain-whitelist-w32.png", "Loadjs('squid.urlrewriteaccessdeny.php?add-www-js=yes')", "whitelist_website_explain"); $f[] = left_menus_format("test_categories", "loupe-32.png", "Loadjs('squid.category.tests.php')", "squid_test_categories_explain"); } } } } } } if ($GLOBALS["VERBOSE"]) { echo __LINE__ . " Saving {$cachePage}\n"; } if ($users->POSTFIX_INSTALLED) { $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance"); if (!is_numeric($EnablePostfixMultiInstance)) { $EnablePostfixMultiInstance = 0; } if ($EnablePostfixMultiInstance == 1) { if ($users->AsPostfixAdministrator) { $f[] = left_menus_format("NEW_SMTP_INSTANCE", "32-network-server-add.png", "Loadjs('postfix.multiple.instances.wizard.php')"); } } $EnableAmavisDaemon = trim($sock->GET_INFO("EnableAmavisDaemon", true)); if (!is_numeric($EnableAmavisDaemon)) { $EnableAmavisDaemon = 0; } if ($users->AsAnAdministratorGeneric) { $f[] = left_menus_format("check_recipients", "check-32.png", "only:Loadjs('postfix.debug.mx.php')"); if ($users->AMAVIS_INSTALLED) { if ($users->spamassassin_installed) { if ($EnableAmavisDaemon == 1) { $f[] = left_menus_format("SPAMASSASSIN_RULES", "script-32.png", "only:Loadjs('spamassassin.rules.php?byid=admin-start_page')"); } } } } } if ($GLOBALS["VERBOSE"]) { echo __LINE__ . " Saving {$cachePage} users->POWER_DNS_INSTALLED = {$users->POWER_DNS_INSTALLED} users->AsAnAdministratorGeneric={$users->AsAnAdministratorGeneric}\n"; } if ($users->AsAnAdministratorGeneric) { if (!$OnlySMTP) { $f[] = left_menus_format("explorer", "explorer-32.png", "only:Loadjs('tree.php');", 'SHARE_FOLDER_TEXT'); } if (!$OnlySMTP) { $f[] = left_menus_format("ADD_COMPUTER", "computer-32-add.png", "only:YahooUser(1051,'domains.edit.user.php?userid=newcomputer\$&ajaxmode=yes','New computer');", "ADD_COMPUTER_TEXT"); } if ($users->POWER_DNS_INSTALLED) { $DisablePowerDnsManagement = $sock->GET_INFO("DisablePowerDnsManagement"); $EnablePDNS = $sock->GET_INFO("EnablePDNS"); $PowerDNSMySQLEngine = $sock->GET_INFO("PowerDNSMySQLEngine"); if (!is_numeric($EnablePDNS)) { $EnablePDNS = 0; } if (!is_numeric($PowerDNSMySQLEngine)) { $PowerDNSMySQLEngine = 1; } if (!is_numeric($DisablePowerDnsManagement)) { $DisablePowerDnsManagement = 0; } if ($DisablePowerDnsManagement == 0) { if ($EnablePDNS == 1) { $f[] = left_menus_format("new_dns_entry", "filter-add-32.png", "only:YahooWin5('550','pdns.mysql.php?item-id=0&t={$t}','PowerDNS');", "new_dns_entry"); } } } } if ($GLOBALS["VERBOSE"]) { echo __LINE__ . " Saving {$cachePage} -> " . count($f) . "\n"; } if (count($f) > 0) { $html = "\n\t\t<hr>\n\t\t<div style='font-size:16px;color:white;margin-top:8px;text-transform:capitalize;'>{actions}:</div>\n\t\t<table style='width:99%' class=form><tbody>\n\t\t" . @implode("\n", $f) . "\n\t\t</tbody>\n\t\t</table;\n\t\t"; if ($GLOBALS["VERBOSE"]) { echo __LINE__ . " AS ROOT={$GLOBALS["AS_ROOT"]}\n"; } if ($GLOBALS["AS_ROOT"]) { if ($GLOBALS["VERBOSE"]) { echo __LINE__ . " Saving {$cachePage}\n"; } @mkdir(dirname($cachePage), 0777, true); @file_put_contents($cachePage, $html); @chmod($cachePage, 0777); return; } if ($GLOBALS["VERBOSE"]) { echo __LINE__ . " Saving {$cachePage} ->" . count($f) . "\n"; } $html = $tpl->_ENGINE_parse_body($html); SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; } }
function main_artica_update_tabs() { if (GET_CACHED(__FILE__, __FUNCTION__)) { return; } $page = CurrentPageName(); $array["config"] = '{parameters}'; $array["events"] = '{events}'; $tpl = new templates(); while (list($num, $ligne) = each($array)) { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?main_artica_update={$num}\"><span>{$ligne}</span></li>\n"); } $html = "\n\t<div id=main_config_artica_update style='width:100%;height:460px;overflow:auto'>\n\t\t<ul>" . implode("\n", $html) . "</ul>\n\t</div>\n\t\t<script>\n\t\t\t\t\$(document).ready(function(){\n\t\t\t\t\t\$('#main_config_artica_update').tabs({\n\t\t\t\t load: function(event, ui) {\n\t\t\t\t \$('a', ui.panel).click(function() {\n\t\t\t\t \$(ui.panel).load(this.href);\n\t\t\t\t return false;\n\t\t\t\t });\n\t\t\t\t }\n\t\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\t});\n\t\t</script>"; SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; }
function status_computer() { if (!$GLOBALS["AS_ROOT"]) { if (!$GLOBALS["VERBOSE"]) { if (is_file("/usr/share/artica-postfix/ressources/logs/web/admin.index.memory.html")) { $data = @file_get_contents("/usr/share/artica-postfix/ressources/logs/web/admin.index.memory.html"); if (strlen($data) > 45) { $tpl = new templates(); echo $tpl->_ENGINE_parse_body($data); return; } } } } $page = CurrentPageName(); $sock = new sockets(); $newfrontend = false; if (isset($_GET["newfrontend"])) { $newfrontend = true; } if (!$GLOBALS["VERBOSE"]) { if (!$GLOBALS["AS_ROOT"]) { if (GET_CACHED(__FILE__, __FUNCTION__, "time", false, 3)) { return; } if (internal_load() > 1.2) { if (GET_CACHED(__FILE__, __FUNCTION__)) { return; } } } } if ($newfrontend) { $ajaxadd = "&newfrontend=yes"; } include_once dirname(__FILE__) . "/ressources/class.os.system.tools.inc"; $html = "<div id='admin-index-status-mysql'></div>\n\t<script>LoadAjaxTiny('admin-index-status-mysql','{$page}?admin-index-status-mysql=yes');</script>"; $os = new os_system(); if ($GLOBALS["VERBOSE"]) { echo "os->html_Memory_usage()<br>\n"; } $html = $html . RoundedLightGrey($os->html_Memory_usage()) . "<br>\n\t<script>\n\tif(document.getElementById('left_status')){\n\t\tvar content=document.getElementById('left_status').innerHTML;\n\t\tif(content.length<5){\n\t\t\tLoadAjax('left_status','{$page}?status=left{$ajaxadd}',true);\n\t\t}\n\t}\n\t</script>\n\t\n\t\n\t"; if ($GLOBALS["AS_ROOT"]) { include_once dirname(__FILE__) . '/framework/class.unix.inc'; include_once dirname(__FILE__) . '/framework/frame.class.inc'; @file_put_contents("/usr/share/artica-postfix/ressources/logs/web/admin.index.memory.html", $html); return; } SET_CACHED(__FILE__, __FUNCTION__, $html); SET_CACHED(__FILE__, __FUNCTION__, "time", $html); echo $html; }
function tabs() { if (GET_CACHED(__FILE__, __FUNCTION__)) { return; } $squid = new squidbee(); $tpl = new templates(); $users = new usersMenus(); $page = CurrentPageName(); $sock = new sockets(); $array["table"] = "{your_categories}"; $fontsize = 18; $t = time(); while (list($num, $ligne) = each($array)) { if ($num == "table") { $html[] = $tpl->_ENGINE_parse_body("<li style='font-size:{$fontsize}px'>\n\t\t\t<a href=\"{$page}?categories=yes\" style='font-size:{$fontsize}'><span>{$ligne}</span></a></li>\n"); continue; } $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}={$t}\" style='font-size:{$fontsize}'><span>{$ligne}</span></a></li>\n"); } $html = build_artica_tabs($html, 'main_perso_categories', 1024); SET_CACHED(__FILE__, __FUNCTION__, null, $html); echo $html; }
function index() { if (GET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__)) { return; } $page = CurrentPageName(); $back = Paragraphe("setup-90-back.png", "{back_system}", "{back_system_text}", "javascript:YahooSetupControlHide();Loadjs('system.index.php?js=yes&load-tab=services')"); $prefix = "SetupControlCenter"; $synchro = Paragraphe("software-synchronize-64.png", "{sync_packages}", "{sync_packages_explain}", "javascript:SynSysPackages()"); $refresh = Paragraphe("64-recycle.png", "{refresh_index_file}", "{refresh_index_file}", "javascript:TestConnection()"); $additionals = Paragraphe("64-update-settings.png", "{mandatories_packages}", "{mandatories_packages_text}", "javascript:Loadjs('setup-ubuntu.php')"); // $intro = "\n<div class=explain style='font-size:14px'>{setup_index_explain}</div>\t\n<center>\n<table style='width:565px' class=form>\n\t<tbody>\n\t<tr>\n\t<td width=1% valign='top'>\n\t\t<img src='img/software-install-256.png' style='margin-rigth:30px;margin-left:30px'>\n\t</td>\n\t<td valign='top'>\n\t\t\n\t\t{$synchro}\n\t\t{$refresh}\n\t\t{$additionals}\n\t</td>\n\t</tr>\n\t</tbody>\n</table>\n</center>\n<input type='hidden' id='tabnum' name='tbanum' value='{$_GET["main"]}'>\n<script>\n\tsetTimeout(\"{$prefix}Launch()\",300);\n\tvar x_SynSysPackages= function (obj) {\n\t\tvar results=obj.responseText;\n\t\tif(results.length>2){alert(results);}\n\t}\n\t\nfunction SynSysPackages(app){\n var XHR = new XHRConnection();\n\tXHR.appendData('SynSysPackages','yes');\n\tXHR.sendAndLoad('{$page}', 'GET',x_SynSysPackages);\n\t}\t\n</script>"; $html = "{$intro}"; $tpl = new templates(); $html = $tpl->_ENGINE_parse_body($html); SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $html); echo $html; }
function popup_filter() { $array_time[null] = "{select}"; $array_time["d0"] = "{today}"; $array_time["d1"] = "{last_24_h}"; $array_time["d2"] = "{last_48_h}"; $array_time["w1"] = "{this_week}"; $array_time["w2"] = "{last_week}"; $cache = GET_CACHED("squid_filter", "filter", "settings", true); if ($cache != null) { $settings = unserialize($cache); } if ($settings["Q_EVENTS_NUM"] == null) { $settings["Q_EVENTS_NUM"] = 200; } $tous_les_clients = tous_les_clients(); $tous_les_clients[] = "{select}"; $html = "\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td class=legend>{computer}:</td>\n\t\t<td>" . Field_array_Hash($tous_les_clients, 'Q_CLIENT', $settings["Q_CLIENT"], null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{when}:</td>\n\t\t<td>" . Field_array_Hash($array_time, 'Q_TIME', $settings["Q_TIME"], null, null, 0, "font-size:13px;padding:3px") . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{events}:</td>\n\t\t<td>" . Field_text("Q_EVENTS_NUM", $settings["Q_EVENTS_NUM"], "font-size:13px;padding:3px;width:35px") . "</td>\n\t</tr>\t\t\n\t\n\t<tr>\n\t<td colspan=2 align='right'>\n\t\t<hr>\n\t\t\t" . button("{apply}", "SaveQueryFilter()") . "\n\t</td>\n\t</tr>\n\t</table>\n\t\n\t\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function networks_tabs() { if (GET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__)) { return; } $page = CurrentPageName(); $array["browse-networks"] = "{edit_networks}"; $fontsize = "font-size:18px;"; while (list($index, $ligne) = each($array)) { $eth = new system_nic($interface); $html[] = "<li><a href=\"{$page}?{$index}=yes\" style='{$fontsize}' ><span>{$ligne}</span></a></li>\n"; } $html = build_artica_tabs($html, 'main_networks', 995) . "\n\t\t<script>LeftDesign('256-networks-white-opac20.png');</script>"; SET_CACHED(__FILE__, __FUNCTION__, __FUNCTION__, $html); echo $html; }
function main_switch() { if (GET_CACHED(__FILE__, __FUNCTION__, $_GET["main"])) { return null; } switch ($_GET["main"]) { case "index": $html = main_index(); SET_CACHED(__FILE__, __FUNCTION__, $_GET["main"], $html); echo $html; break; case "net_share": $html = main_samba(); SET_CACHED(__FILE__, __FUNCTION__, $_GET["main"], $html); echo $html; break; case "ftp_share": $html = main_pureftpd(); SET_CACHED(__FILE__, __FUNCTION__, $_GET["main"], $html); echo $html; break; case "rsync": $html = main_rsync(); SET_CACHED(__FILE__, __FUNCTION__, $_GET["main"], $html); echo $html; break; default: $html = main_samba(); $_GET["main"] = "NULL"; SET_CACHED(__FILE__, __FUNCTION__, $_GET["main"], $html); echo $html; $_GET["main"] = null; break; } }