function postfix_status() { $user = new usersMenus(); if (!$user->POSTFIX_INSTALLED) { return null; } $user->LoadModulesEnabled(); $q = new mysql(); $fetchmail_count = 0; if ($user->fetchmail_installed) { BuildingExecRightStatus("Building fetchmail statistics...", 25); $sql = "SELECT COUNT(ID) as tcount FROM `fetchmail_events` WHERE DATE_FORMAT(zDate,'%Y-%m-%d')=DATE_FORMAT( NOW( ) ,'%Y-%m-%d' )"; $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_events')); $fetchmail_count = $ligne["tcount"]; $sql = "SELECT SUM(size) as tcount FROM `fetchmail_events` WHERE DATE_FORMAT(zDate,'%Y-%m-%d')=DATE_FORMAT( NOW( ) ,'%Y-%m-%d' )"; $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_events')); $fetchmail_size = FormatBytes($ligne["tcount"] / 1024); events("fetchmail_count={$fetchmail_count}, fetchmail_size={$fetchmail_size}"); } else { events('Fetchmail is not installed'); } BuildingExecRightStatus("Building storage statistics...", 30); $sql = "SELECT COUNT( MessageID ) as tcount FROM storage WHERE DATE_FORMAT( zDate, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ) , '%Y-%m-%d' ) "; $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup')); $backuped_mails = $ligne["tcount"]; BuildingExecRightStatus("Building quarantine statistics...", 35); $sql = "SELECT COUNT( MessageID ) as tcount FROM quarantine WHERE DATE_FORMAT( zDate, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ) , '%Y-%m-%d' ) "; $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_backup')); $quarantine_mails = $ligne["tcount"]; BuildingExecRightStatus("Building messages number statistics...", 40); $sql = "SELECT COUNT(ID) as tcount FROM `smtp_logs` WHERE DATE_FORMAT( time_sended, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ) , '%Y-%m-%d' )"; $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_events')); $flow_mails = $ligne["tcount"]; if ($user->cyrus_imapd_installed) { BuildingExecRightStatus("Building imap/pop3 number statistics...", 45); $sql = "SELECT COUNT(ID) as tcount FROM `mbx_con` WHERE DATE_FORMAT( zDate, '%Y-%m-%d' ) = DATE_FORMAT( NOW( ) , '%Y-%m-%d' )"; $ligne = @mysql_fetch_array($q->QUERY_SQL($sql, 'artica_events')); $mbx_con = $ligne["tcount"]; $mbx_con = "<tr>\n\t\t\t<td class=legend nowrap>{mbx_con}:</td>\n\t\t\t<td style='font-size:12px;font-weight:bold'>{$mbx_con} {connections}</td>\n\t\t</tr>"; } if ($fetchmail_count > 0) { $fetchmail = "<tr>\n\t\t\t<td class=legend nowrap>{fetchmail_recup}:</td>\n\t\t\t<td style='font-size:12px;font-weight:bold'>{$fetchmail_count} {emails} ({$fetchmail_size})</td>\n\t\t</tr>"; } $html = "\n\t<H5>Postfix: {today}</h5>\n\t<table class=table_form>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{received_mails}:</td>\n\t\t\t<td style='font-size:12px;font-weight:bold'>{$flow_mails}</td>\n\t\t</tr>\n\t\t{$mbx_con}\t\n\t\t{$fetchmail}\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{backuped_mails}:</td>\n\t\t\t<td style='font-size:12px;font-weight:bold'>{$backuped_mails}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap>{quarantine_mails}:</td>\n\t\t\t<td style='font-size:12px;font-weight:bold'>{$quarantine_mails}</td>\n\t\t</tr>\n\t</table>\n\t\t\t\t\t\t\n\t\n\t"; if ($user->AMAVIS_INSTALLED) { if ($user->EnableAmavisDaemon) { BuildingExecRightStatus("Building Amavis statistics...", 50); $ini = new Bs_IniHandler(); $sock = new sockets(); $ini->loadString($sock->getfile('amavisstatus')); $status_amavis = DAEMON_STATUS_ROUND("AMAVISD", $ini, null); $status_amavismilter = DAEMON_STATUS_ROUND("AMAVISD_MILTER", $ini, null); $status = "<br>{$status_amavis}<br>{$status_amavismilter}"; } } $html = RoundedLightGrey($html) . $status . "<br>"; file_put_contents('/usr/share/artica-postfix/ressources/logs/status.postfix.flow.html', $html); system('/bin/chmod 755 /usr/share/artica-postfix/ressources/logs/status.postfix.flow.html'); BuildingExecRightStatus("Building done...", 100); }
function popup() { $users = new usersMenus(); $users->LoadModulesEnabled(); $page = CurrentPageName(); $tpl = new templates(); $kas_enabled = 0; $amavis_enabled = 0; $kas = new kas_mysql("default"); if ($kas->GET_KEY("ACTION_SPAM_MODE") == 2) { $ACTION_SPAM_MODE = 1; } if ($kas->GET_KEY("ACTION_PROBABLE_MODE") == 2) { $ACTION_PROBABLE_MODE = 1; } if ($kas->GET_KEY("ACTION_FORMAL_MODE") == 2) { $ACTION_FORMAL_MODE = 1; } $amavis = new amavis(); $sa_tag3_level_defltl = $tpl->_ENGINE_parse_body('{sa_tag3_level_deflt}'); if ($users->kas_installed) { if ($users->KasxFilterEnabled == 1) { $kas_enabled = 1; } } if ($users->AMAVIS_INSTALLED) { if ($users->EnableAmavisDaemon == 1) { $amavis_enabled = 1; } } $html = "\n\t<div id='kas3feature'>\n\t\t<table style='width:100%' class=form>\n\t\t<tr>\n\t\t\t<td colspan=2><strong style='font-size:16px'>{APP_KAS3}</strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{spam option 1}</td>\n\t\t\t<td>" . Field_checkbox("ACTION_SPAM_MODE", 1, $ACTION_SPAM_MODE) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{spam option 2}</td>\n\t\t\t<td>" . Field_checkbox("ACTION_PROBABLE_MODE", 1, $ACTION_PROBABLE_MODE) . "</td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend>{spam option 4}</td>\n\t\t\t<td>" . Field_checkbox("ACTION_FORMAL_MODE", 1, $ACTION_FORMAL_MODE) . "</td>\n\t\t</tr>\t\n\t\t</table>\n\t</div>\n\t\n\t<div id='amavisfeature'>\n\t\t<table style='width:100%' class=form>\n\t\t\t<tr>\n\t\t\t\t<td colspan=2><strong style='font-size:16px'>{APP_AMAVIS}/{APP_SPAMASSASSIN}</strong></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{spam option 1} <b>({score} {$amavis->main_array["BEHAVIORS"]["sa_tag3_level_deflt"]})</b></td>\n\t\t\t\t<td>" . Field_checkbox("EnableQuarantineSpammy2", 1, $amavis->EnableQuarantineSpammy2) . "</td>\n\t\t\t</tr>\t\t\t\n\t\t\t<tr>\n\t\t\t\t<td class=legend>{spam option 2} <b>({score} {$amavis->main_array["BEHAVIORS"]["sa_tag2_level_deflt"]})</b></td>\n\t\t\t\t<td>" . Field_checkbox("EnableQuarantineSpammy", 1, $amavis->EnableQuarantineSpammy) . "</td>\n\t\t\t</tr>\n\t\n\t\t\t</table>\n\t</div>\n\t\n\t\n\t<div style='text-align:right;width:100%'><hr>" . button("{apply}", "SaveQuarPolicies()") . "</div>\n\t\n\t<script>\n\t\tfunction DisableQuarPolicies(){\n\t\t\tvar kas_enabled={$kas_enabled};\n\t\t\tvar amavis_enabled={$amavis_enabled};\n\t\t\tif(kas_enabled!==1){\n\t\t\t\tdocument.getElementById('ACTION_SPAM_MODE').disabled=true;\n\t\t\t\tdocument.getElementById('ACTION_PROBABLE_MODE').disabled=true;\n\t\t\t\tdocument.getElementById('ACTION_FORMAL_MODE').disabled=true;\n\t\t\t}\n\t\t\t\n\t\t\tif(amavis_enabled!==1){\n\t\t\t\tdocument.getElementById('EnableQuarantineSpammy2').disabled=true;\n\t\t\t\tdocument.getElementById('EnableQuarantineSpammy').disabled=true;\n\t\t\t}\t\t\t\n\t\t\n\t\t}\n\t\t\nvar x_SaveQuarPolicies= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue);}\n\tYahooWin3Hide();\n}\t\t\n\t\n\t\n\t\tfunction SaveQuarPolicies(){\n\t\t\tvar kas_enabled={$kas_enabled};\n\t\t\tvar amavis_enabled={$amavis_enabled};\t\t\n\t\t\tvar XHR = new XHRConnection();\n\t\t\tXHR.appendData('SAVE_QUAR',1);\n\t\t\tif(kas_enabled==1){\n\t\t\t\tXHR.appendData('SAVE_KAS',1);\n\t\t\t\tif(document.getElementById('ACTION_SPAM_MODE').checked){XHR.appendData('ACTION_SPAM_MODE',1);}else{XHR.appendData('ACTION_SPAM_MODE',0);}\n\t\t\t\tif(document.getElementById('ACTION_PROBABLE_MODE').checked){XHR.appendData('ACTION_PROBABLE_MODE',1);}else{XHR.appendData('ACTION_PROBABLE_MODE',0);}\n\t\t\t\tif(document.getElementById('ACTION_FORMAL_MODE').checked){XHR.appendData('ACTION_FORMAL_MODE',1);}else{XHR.appendData('ACTION_FORMAL_MODE',0);}\n\t\t\t}\n\t\t\t\n\t\t\tif(amavis_enabled==1){\n\t\t\t\tXHR.appendData('SAVE_AMAVIS',1);\n\t\t\t\tif(document.getElementById('EnableQuarantineSpammy2').checked){XHR.appendData('EnableQuarantineSpammy2',1);}else{XHR.appendData('EnableQuarantineSpammy2',0);}\n\t\t\t\tif(document.getElementById('EnableQuarantineSpammy').checked){XHR.appendData('EnableQuarantineSpammy',1);}else{XHR.appendData('EnableQuarantineSpammy',0);}\n\t\t\t}\n\t\t\t\n\t\t\tdocument.getElementById('kas3feature').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\tdocument.getElementById('amavisfeature').innerHTML='<center><img src=img/wait_verybig.gif></center>';\n\t\t\tXHR.sendAndLoad('{$page}', 'GET',x_SaveQuarPolicies);\t\t\t\n\t\t\n\t\t}\n\t\n\t\n\tDisableQuarPolicies();\n\t</script>\n\t\n\t\n\n\n"; echo $tpl->_ENGINE_parse_body($html); }
function addressbook_front() { $server = $_SERVER['SERVER_NAME']; $ldap = new clladp(); if (preg_match('#^(.+?):#', $server, $re)) { $server = $re[1]; } $usr = new usersMenus(); $usr->LoadModulesEnabled(); if ($usr->EnableNonEncryptedLdapSession == 1) { $portadd = ",389"; } $users = new user($_SESSION["uid"]); $settings = "\n\t\t<table style='width:100%'>\n\t\t<tr>\n\t\t\t<td colspan=2><H3>{your_parameters}</h3><p class=caption>{your_parameters_text}</p></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{hostname}:</td>\n\t\t\t<td style='font-size:13px'><strong><code>{$server}</code></strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend>{listen_port}:</td>\n\t\t\t<td style='font-size:13px'><strong><code>636{$portadd}</code></strong></td>\n\t\t</tr>\t\n\t\t<tr>\n\t\t\t<td class=legend valign='top'>{base_dn}:</td>\n\t\t\t<td style='font-size:13px'><strong><code>ou={$users->cn},ou=People,dc={$users->ou},dc=NAB,{$ldap->suffix}</code></strong></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td class=legend nowrap valign='top'>{bind_dn}:</td>\n\t\t\t<td style='font-size:13px'><strong><code>{$users->dn}</code></strong></td>\n\t\t</tr>\t\t\t\t\t\t\n\t\t</table>\n\t\n\t\n\t\n\t"; $settings = RoundedLightWhite($settings); $html = "<H1>{your_address_book}</H1>\n\t<p class=caption>{your_address_book_text}</p>\n\t{$settings}\n\t\n\t\n\t"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html); }
function checkprivs() { $_POST["userid"] = trim($_POST["userid"]); include "ressources/settings.inc"; $socks = new sockets(); if (strtolower($_POST["userid"]) == strtolower($_GLOBAL["ldap_admin"])) { if ($_POST["password"] != $_GLOBAL["ldap_password"]) { die("bad password"); } $dans = new dansguardian_rules(null, 1); $dans->Add_exceptionsitelist(1, $_POST["uri"]); AddEvents("Manager", $_POST["uri"]); $sock = new sockets(); $sock->getFrameWork("reload-dansguardian"); die("SUCCESS"); } $ldap = new clladp(); writelogs('This is not Global admin, so test user...', __FUNCTION__, __FILE__); $hash = $ldap->UserDatas($_POST["userid"]); $userPassword = $hash["userPassword"]; if (trim($hash["uid"]) == null) { writelogs('Unable to get user infos abort', __FUNCTION__, __FILE__); die("Unknown user"); } if (trim($_POST["password"]) == trim($userPassword)) { $users = new usersMenus($ldap->_Get_privileges_userid($_POST["userid"])); $priv_array = $users->_ParsePrivieleges($ldap->_Get_privileges_userid($_POST["userid"])); $users->_TranslateRights($priv_array); if ($users->AllowDansGuardianBanned) { $dans = new dansguardian_rules(null, 1); $dans->Add_exceptionsitelist(1, $_POST["uri"]); $sock = new sockets(); AddEvents($_POST["userid"], $_POST["uri"]); $sock->getFrameWork("cmd.php?reload-dansguardian"); die("SUCCESS"); } } else { die("BAD PASSWORD"); } die("No privileges"); }
function tabs(){ if(!isset($_GET["main"])){$_GET["main"]="network";}; $hostname=$_GET["hostname"]; $ou=$_GET["ou"]; $users=new usersMenus(); $users->LoadModulesEnabled(); $tpl=new templates(); $filters_settings=$tpl->_ENGINE_parse_body('{filters_settings}'); if(strlen($filters_settings)>25){$filters_settings=texttooltip(substr($filters_settings,0,22).'...',$filters_settings,null,null,1);} $page=CurrentPageName(); $array["status"]='{status}'; $array["transport"]='{transport_settings}'; $array["security"]='{security_settings}'; $array["filters"]=$filters_settings; while (list ($num, $ligne) = each ($array) ){ $html[]=$tpl->_ENGINE_parse_body("<li><a href=\"$page?$num=yes&hostname=$hostname&ou=$ou\"><span>$ligne</span></a></li>\n"); } echo " <div id=main_multi_config_postfix style='width:100%;height:550px;overflow:auto'> <ul>". implode("\n",$html)."</ul> </div> <script> $(document).ready(function(){ $('#main_multi_config_postfix').tabs(); }); </script>"; }
function login() { $tpl = new templates(); $ldap = new clladp(); $att = array("userPassword", "DisplayName"); $sr = @ldap_search($ldap->ldap_connection, "dc=organizations,{$ldap->suffix}", "(uid={$_POST["uid"]})", $att); if (!$sr) { echo $sr; return $tpl->_ENGINE_parse_body('{unknown_user}'); } $entry_id = ldap_first_entry($ldap->ldap_connection, $sr); if (!$entry_id) { writelogs("INFOS: bad value {$entry_id}: (' . {$entry_id} . ') find: (uid={$_POST["uid"]}) -> aborting function search engine doesn`t found the pattern", __LINE__, __FILE__); return $tpl->_ENGINE_parse_body('{unknown_user}'); } $attrs = ldap_get_attributes($ldap->ldap_connection, $entry_id); $passw = $attrs["userPassword"][0]; $passw = md5($passw); if (!$_GET["credentials"]) { $_POST["password"] = md5($_POST["password"]); } if ($passw != $_POST["password"]) { return $tpl->_ENGINE_parse_body('{bad_password}'); } unset($_SESSION["MLDONKEY_{$_POST["uid"]}"]); $_SESSION["NOM"] = $attrs["DisplayName"][0]; $privs = $ldap->_Get_privileges_userid($_POST["uid"]); $_SESSION["privileges"]["ArticaGroupPrivileges"] = $privs; $users = new usersMenus(); $uid_class = new user($_POST["uid"]); $_SESSION["ou"] = $uid_class->ou; $_SESSION["privs"] = $users->_ParsePrivieleges($privs); if ($_SESSION["privs"]["ForceLanguageUsers"] != null) { $_COOKIE["ArticaForceLanguageUsers"] = $_SESSION["privs"]["ForceLanguageUsers"]; } else { unset($_COOKIE["ArticaForceLanguageUsers"]); } }
function USER_FETCHMAIL($uid) { include_once dirname(__FILE__) . '/ressources/class.fdm.inc'; $fdm = new fdm($uid); $users = new usersMenus(); if (!$users->fdm_installed) { $warning = "<strong>{fdm_not_installed}</strong>"; } $users->LoadModulesEnabled(); if ($users->EnableFDMFetch != 1) { $warning = $warning . "<br><strong>{fdm_not_enabled}</strong>"; } if (!$users->fdm_cache) { $warning = $warning . "<br><strong>{fdm_cache_not_exists}</strong>"; } if (strlen($warning) > 0) { $warning = RoundedLightYellow($warning); } $html = "\n\t<hr>\n\t<H3>{$uid}::{fetch_mails}</H3>{$warning}\n\t\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' style='vertical-align:top' style='vertical-align:top'><br><div id='fdm_list' style='width:450px'>" . USER_FETCHMAIL_LIST($uid) . "</div></td>\n\t<td valign='top' style='vertical-align:top' style='vertical-align:top' width=1%>\n\t\n\t<table style='width:100%'><tr>\n\t<td>" . imgtootltip('add-fetchmail-48.png', '{add_rule}', "fdm_addrule('{$uid}')") . "</td>\n\t<td>" . imgtootltip('48-logs.png', '{all_events}', "fdm_events('{$uid}')") . "</td>\n\t\n\t</tr>\n\t</table>\n\t\n\t"; $tpl = new templates(); return $tpl->_ENGINE_parse_body($html); }
function main_status_milter() { if ($_GET["hostname"] == null) { $hostname = $users->hostname; $_GET["hostname"] = $hostname; } else { $hostname = $_GET["hostname"]; } $ini = new Bs_IniHandler(); $users = new usersMenus(); $users->LoadModulesEnabled(); $sock = new sockets(); if ($users->MimeDefangEnabled == 1) { include_once 'ressources/class.mimedefang.inc'; $ini->loadString($sock->getfile('mimedefangstatus', $_GET["hostname"])); $mime = new mimedefang(); if ($mime->ScriptConf_array["BUILD"]["ENABLE_SA"] == 1) { $title = "{managed_by_mimedefang}"; $milter_status = DAEMON_STATUS_ROUND('MIMEDEFANG', $ini, $title); } else { $title = "{managed_by_mimedefang_not_enabled}"; $milter_status = DAEMON_STATUS_ROUND('MIMEDEFANG', $ini, $title); } } else { $ini->loadString($sock->getfile('MILTER_SPAMASS_STATUS', $_GET["hostname"])); $milter_status = DAEMON_STATUS_ROUND('SPAMASS_MILTER', $ini); } $tpl = new templates(); return $tpl->_ENGINE_parse_body($milter_status); }
function organization_management() { $ou = $_GET["ou"]; $ou_encoded = base64_encode($ou); $ldap = new clladp(); $sock = new sockets(); if (trim($ou == null)) { if (isset($_COOKIE["SwitchOrgTabsOu"])) { $_GET["ou"] = $_COOKIE["SwitchOrgTabsOu"]; } } $usersmenus = new usersMenus(); $usersmenus->LoadModulesEnabled(); if ($usersmenus->AllowAddUsers or $usersmenus->AsOrgAdmin or $usersmenus->AsMessagingOrg) { $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} ({$ou})", '{manage_groups_text}', "javascript:Loadjs('domains.edit.group.php?ou={$ou_encoded}&js=yes&popup=yes')", null, 210, 100, 0, true); } $find_members = Paragraphe('find-members-64.png', '{find_members}', '{find_members_text}', "javascript:Loadjs('domains.find.user.php?ou={$ou}')", null, 210, null, 0, true); if ($usersmenus->AsArticaAdministrator) { $delete = Paragraphe('64-cancel.png', "{delete_ou} {$ou}", '{delete_ou_text}', "javascript:Loadjs('domains.delete.org.php?ou={$ou}');", null, 210, 100, 0, true); } if ($usersmenus->AsOrgAdmin) { $img = $ldap->get_organization_picture($ou, 64); $ad_import = Paragraphe('folder-import-ad-64.png', '{ad_import}', '{ad_import_text}', "javascript:Loadjs('domains.ad.import.php?ou={$ou}')", null, 210, 0, 0, true); $ldap_import = Paragraphe('database-restore-64.png', '{ldap_importation}', '{ldap_importation_text}', "javascript:Loadjs('domains.ldap.import.php?ou={$ou}')", null, 210, 0, 0, true); $orgsettings = Paragraphe($img, '{ORG_SETTINGS}', '{ORG_SETTINGS_TEXT}', "javascript:Loadjs('domains.organization-settings.php?ou={$ou}')", null, 210, 0, 0, true); $orgsduplicate = Paragraphe('org-duplicate-64.png', '{EXPORT_ORG}', '{duplicate_to_remote_server}', "javascript:Loadjs('domains.organization-settings.php?ou={$ou}&js-export=yes')", null, 210, 0, 0, true); } if (!isset($_GET["miniadm"])) { if ($usersmenus->AsOrgAdmin or $usersmenus->AsMessagingOrg) { $transport = Paragraphe('folder-transport-64.png', '{localdomains}', '{localdomains_text}', "javascript:Loadjs('domains.edit.domains.php?js=yes&ou={$ou}')", null, 210, null, 0, true); if ($usersmenus->POSTFIX_INSTALLED) { $sendmail = "<div style='float:left'>" . Buildicon64('DEF_ICO_SENDTOALL', 210, 100, "?ou={$ou}") . "</div>"; } } } if ($usersmenus->ARTICA_META_ENABLED) { if ($sock->GET_INFO("AllowArticaMetaAddUsers") != 1) { $add_user = null; } } if ($usersmenus->POSTFIX_INSTALLED) { $transport = null; } if ($usersmenus->EnableManageUsersTroughActiveDirectory or $ldap->IsOUUnderActiveDirectory($ou)) { $ad_import = Paragraphe('folder-import-ad-64-grey.png', '{ad_import}', '{ad_import_text}'); $orgsduplicate = Paragraphe('org-duplicate-64-grey.png', '{EXPORT_ORG}', '{duplicate_to_remote_server}'); $delete = Paragraphe('64-cancel-grey.png', '{delete_ou}', '{delete_ou_text}'); $add_user = Paragraphe('folder-useradd-64-grey.png', '{create_user}', '{create_user_text}'); $orgsettings = Paragraphe('64-org-settings-grey.png', '{ORG_SETTINGS}', '{ORG_SETTINGS_TEXT}'); $ldap_import = Paragraphe('database-restore-64-grey.png', '{ldap_importation}', '{ldap_importation_text}'); } $tr[] = $add_user; $tr[] = $groups; $tr[] = $find_members; $tr[] = $transport; $tr[] = $ad_import; $tr[] = $ldap_import; $tr[] = $orgsettings; $tr[] = $orgsduplicate; $tr[] = $sendmail; $tr[] = $delete; $tables[] = "<table style='width:99%' class=form><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>"; } } $html = "<center><div style='width:700px'>" . implode("\n", $tables) . "</div></center>"; return $html; }
function GROUP_SETTINGS_PAGE_CONTENT() { $ldap = new clladp(); $page = CurrentPageName(); $num = $_GET["LoadGroupSettings"]; $groupID = $num; writelogs("Loading group {$num}", __FUNCTION__, __FILE__, __LINE__); if (is_base64_encoded($_GET["ou"])) { $_GET["ou"] = base64_decode($_GET["ou"]); } $ou_conn = $_GET["ou"]; if (!$ldap->EnableManageUsersTroughActiveDirectory) { if (!is_numeric($num)) { return null; } } if (trim($num) == null) { $num = 0; } if ($num == 0) { if (isset($_GET["byGroupName"])) { $num = $ldap->GroupIDFromName($_GET["ou"], $_GET["byGroupName"]); writelogs("Numeric identifier=0, try to get numeric identifier by {$_GET["ou"]}/{$_GET["byGroupName"]}={$num}", __FUNCTION__, __FILE__, __LINE__); if ($num == 0) { return; } } } $group = new groups($num); if (trim($_GET["ou"]) != null) { if ($group->ou != $_GET["ou"]) { $tpl = new templates(); $error = "<center style='border:2px solid red;padding:10px;margin:10px'><span style='font-size:13px;font-weight:bold;color:red'>Group: {$num}/{$_GET["ou"]}<br> {error_group_not_in_your_organization}</span></center>"; //echo $tpl->_ENGINE_parse_body($error); writelogs("ERROR: group {$num} from organization \"{$group->ou}\" is different from requested organization \"{$_GET["ou"]}\"", __FUNCTION__, __FILE__); return null; } } $text_disbaled = "{ERROR_NO_PRIVILEGES_OR_PLUGIN_DISABLED}"; $user = new usersMenus(); $user->LoadModulesEnabled(); $sock = new sockets(); $SambaEnabled = $sock->GET_INFO("SambaEnabled"); if (!is_numeric($SambaEnabled)) { $SambaEnabled = 1; } if ($SambaEnabled == 0) { $user->SAMBA_INSTALLED = false; } $SAMBA_GROUP = Paragraphe('64-group-samba-grey.png', '{MK_SAMBA_GROUP}', $text_disbaled, ''); $mailing_list = Paragraphe('64-mailinglist-grey.png', "{mailing_list}", "{$text_disbaled}"); //$hash=$ldap->GroupDatas($num); $members = count($group->members); if ($user->POSTFIX_INSTALLED == true) { $mailing_list_count = $group->CountMailingListes(); $js = "javascript:Loadjs('domains.edit.group.php?LoadMailingList-js={$_GET['ou']}')"; $mailing_list = Paragraphe('64-mailinglist.png', "({$mailing_list_count}) {mailing_list}", "{mailing_list_text}", "{$js}"); } if ($user->DANSGUARDIAN_INSTALLED == true) { $DANSGUARDIAN = Paragraphe('icon-chevallier-564.png', '{dansguardian_rules}', '{dansguardian_rules_text}', "javascript:DansGuardianRules({$num})"); // } $automount = Paragraphe('folder-64-automount.png', '{shared_folders}', '{shared_folders_text}', "javascript:Loadjs('SharedFolders.groups.php?gpid={$num}')"); if ($user->cyrus_imapd_installed) { $sieve_auto = Paragraphe('64-learning.png', '{sieve_auto_script}', '{sieve_auto_script_text}', "javascript:Loadjs('{$page}?sieve-js={$num}')"); } if ($user->SAMBA_INSTALLED) { $COMPUTERS = Paragraphe('computers-64.png', '{computers}', '{computers_text}', "javascript:LoadComputerGroup({$num})"); $SAMBA_GROUP = Paragraphe('64-group-samba.png', '{MK_SAMBA_GROUP}', '{MK_SAMBA_GROUP_text}', "javascript:Change_group_settings({$num})"); $LOGON_SCRIPT = Paragraphe('script-64.png', '{LOGON_SCRIPT}', '{LOGON_SCRIPT_TEXT}', "javascript:Loadjs('domains.edit.group.login.script.php?gpid={$num}')"); } if ($DANSGUARDIAN == null) { $DANSGUARDIAN = Paragraphe('icon-chevallier-564-grey.png', '{dansguardian_rules}', $text_disbaled, ''); } if ($automount == null) { $automount = Paragraphe('folder-64-automount-grey.png', '{shared_folders}', $text_disbaled, ''); } if ($COMPUTERS == null) { $COMPUTERS = Paragraphe('computers-64-grey.png', '{computers}', $text_disbaled, ''); } if (!$user->cyrus_imapd_installed) { if ($user->SAMBA_INSTALLED) { $sieve_auto = $LOGON_SCRIPT; $LOGON_SCRIPT = null; } } $RENAME_GROUP = Paragraphe('group_rename-64.png', '{GROUP_RENAME}', '{GROUP_RENAME_TEXT}', "javascript:Loadjs('domains.edit.group.rename.php?group-id={$num}&ou={$_GET["ou"]}')"); $OPTIONS_DEFAULT_PASSWORD = Paragraphe('64-key.png', '{group_default_password}', '{group_default_password_text}', "javascript:YahooWin('400','{$page}?default_password=yes&gpid={$num}')"); $PRIVILEGES = Paragraphe('members-priv-64.png', '{privileges}', '{privileges_text}', "javascript:GroupPrivileges({$num})"); $ou_encoded = base64_encode($_GET["ou"]); $delete_group = imgtootltip("32-cancel.png", "{delete}::{$group->groupName}", "Loadjs('domains.delete.group.php?gpid={$num}')"); $quotaDisk = Paragraphe("rename-disk-64.png", '{disk_user_quota}', '{disk_group_quota_text}', "javascript:Loadjs('domains.edit.user.quota.php?uid=@{$group->group_id}&ou={$group->ou}&userid=@{$group->group_id}')", null, 210, 'font-size:12px;font-weight:bold'); $quotaDisk_disabled = Paragraphe("rename-disk-64-grey.png", '{disk_user_quota}', '{disk_group_quota_text}'); if (!$user->QUOTA_INSTALLED) { $quotaDisk = $quotaDisk_disabled; } if ($user->EnableManageUsersTroughActiveDirectory) { $SAMBA_GROUP = Paragraphe('64-group-samba-64.png', '{MK_SAMBA_GROUP}', '{MK_SAMBA_GROUP_text}'); $mailing_list = Paragraphe('64-mailinglist-grey.png', "({$mailing_list_count}) {mailing_list}", "{mailing_list_text}"); $automount = Paragraphe('folder-64-automount-grey.png', '{shared_folders}', '{shared_folders_text}'); $DANSGUARDIAN = null; $PRIVILEGES = Paragraphe('members-priv-64-grey.png', '{privileges}', '{privileges_text}'); $delete_group = null; } $GroupSettingsID = null; if (isset($_GET["GroupSettingsID"])) { $GroupSettingsID = $_GET["GroupSettingsID"]; } $html_tab1 = "\n\t\n\t<div style='width:98%' class=form>\n\t<table>\n\t<tr>\n\t<td valign='top'>{$PRIVILEGES}</td>\n\t<td valign='top'>{$COMPUTERS}</td>\n\t<td valign='top'>{$SAMBA_GROUP}</td>\n\t</tr>\n\t<tr>\n\t<td valign='top'>{$mailing_list}</td>\n\t<td valign='top'>{$automount}</td>\n\t<td valign='top'></td>\n\t</tr>\n\t</table></div>"; $html_tab2 = "<div style='width:98%' class=form>\t<table>\n\t<tr>\n\t<td valign='top'> </td>\n\t<td valign='top'> </td>\n\t<td valign='top'> </td>\n\t</tr>\n\t<tr>\n\t<td valign='top'> </td>\n\t<td valign='top'> </td>\n\t<td valign='top'> </td>\n\t</tr>\n\t</table></div>"; $html_tab3 = "<div style='width:98%' class=form>\t\n\t<table>\n\t\t<tr>\n\t\t\t<td valign='top'>{$DANSGUARDIAN}</td>\n\t\t\t<td valign='top'> </td>\n\t\t\t<td valign='top'> </td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td valign='top'> </td>\n\t\t\t<td valign='top'> </td>\n\t\t\t<td valign='top'> </td>\n\t\t</tr>\n\t</table></div>"; $t[] = $RENAME_GROUP; $t[] = $OPTIONS_DEFAULT_PASSWORD; $t[] = $sieve_auto; $t[] = $LOGON_SCRIPT; $t[] = $quotaDisk; $html_tab4 = "<div style='width:98%' class=form><table>" . CompileTr3($t) . "</table></div>"; if ($_GET["tab"] == 'asav') { $html_tab1 = $html_tab2; } if ($_GET["tab"] == 'proxy') { $html_tab1 = $html_tab3; } if ($_GET["tab"] == 'options') { $html_tab1 = $html_tab4; } $html = $html_tab1; $tpl = new templates(); $group_description = $tpl->_ENGINE_parse_body("{group_description}"); $barre_principale = "\n\t<input type='hidden' id='group_delete_text' value='{group_delete_text}'>\n\t<table style='width:100%'>\n\t<tr>\n\t\t<td width=3%><div style='height:1px;border-bottom:1px solid #CCCCCC;width:100%;float:right'> </div></td>\n\t\t<td width=1% nowrap><H5 style='border-bottom:0px'>{group} « {$group->groupName} »</h5></td>\n\t\t<td><div style='height:1px;border-bottom:1px solid #CCCCCC;width:100%;float:right'> </div></td>\n\t\t<td width=1%>{$delete_group}</td>\n\t</tr>\n\t<tr>\n\t\t<td colspan=4 align='right'><div style='margin-top:-5px;padding-right:50px'>\n\t\t\t<a href=\"javascript:blur();\" OnClick=\"ChangeGroupDescription()\" \n\t\t\tstyle='font-size:11px;text-decoration:underline;font-style:italic'>{$group->description}</a></div></td>\n\t</tr>\n\t</table>\n\t\n\t<script>\n\t\tfunction ChangeGroupDescription(){\n\t\t\tYahooWin5('360','{$page}?ChangeGroupDescription=yes&gpid={$groupID}&ou={$ou_conn}','{$group->groupName}::{$group_description}');\n\t\t\n\t\t}\n\t\t\n\t</script>\n\t"; echo $tpl->_ENGINE_parse_body("{$barre_principale}{$tab}{$html}"); }
function page() { $usersmenus = new usersMenus(); $usersmenus->LoadModulesEnabled(); $html = $html . "\n<table style='margin:0px;padding:0px;'>\n<tr>\n<td valign='top' style='margin:0px;padding:0px;'>{$awstats_mail}</td>\n<td valign='top' style='margin:0px;padding:0px;'>{$graph_defang}</td>\n<td valign='top' style='margin:0px;padding:0px;'>{$collectd}</td>\n<tr>\n<td valign='top' style='margin:0px;padding:0px;'>{$kas}</td>\n<td valign='top' style='margin:0px;padding:0px;'>{$mailspy}</td>\n<td valign='top' style='margin:0px;padding:0px;'>{$awstats_squid}</td>\n</tr>\n<tr>\n<td valign='top' style='margin:0px;padding:0px;'>{$bind}<td>\n<td valign='top' style='margin:0px;padding:0px;'></td>\n<td valign='top' style='margin:0px;padding:0px;'> </td>\n</tr>\n</table>\n"; $tpl = new template_users('{statistics}', $html); echo $tpl->web_page; }
function whitelist_global_list() { $tpl = new templates(); $users = new usersMenus(); $users->LoadModulesEnabled(); $q = new mysql(); $EnableAmavisDaemon = $users->EnableAmavisDaemon; if (!$users->AMAVIS_INSTALLED) { $EnableAmavisDaemon = 0; } if (!is_numeric($EnableAmavisDaemon)) { $EnableAmavisDaemon = 0; } if ($EnableAmavisDaemon == 1) { $amavis = new amavis(); $max_score = $amavis->main_array["BEHAVIORS"]["sa_tag2_level_deflt"]; } $max_score_white_text = $tpl->javascript_parse_text("{max_score_white_text}\\n{score}:{$max_score}"); $search = '%'; $table = "postfix_global_whitelist"; $page = 1; $FORCE_FILTER = "AND `hostname`='{$_GET["hostname"]}' "; $total = 0; $MyPage = CurrentPageName(); if (!$q->TestingConnection()) { json_error_show("Connection to MySQL server failed"); } if ($q->COUNT_ROWS($table, "artica_backup") == 0) { json_error_show("{$table} empty"); } if (isset($_POST["sortname"])) { if ($_POST["sortname"] != null) { $ORDER = "ORDER BY {$_POST["sortname"]} {$_POST["sortorder"]}"; } } if (isset($_POST['page'])) { $page = $_POST['page']; } $searchstring = string_to_flexquery(); if ($searchstring != null) { $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$FORCE_FILTER} {$searchstring}"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if (!$q->ok) { json_error_show($q->mysql_error . " LINE:" . __LINE__); } $total = $ligne["TCOUNT"]; } else { $sql = "SELECT COUNT(*) as TCOUNT FROM `{$table}` WHERE 1 {$FORCE_FILTER}"; $ligne = mysql_fetch_array($q->QUERY_SQL($sql, "artica_backup")); if (!$q->ok) { json_error_show($q->mysql_error . " LINE:" . __LINE__); } $total = $ligne["TCOUNT"]; } if (isset($_POST['rp'])) { $rp = $_POST['rp']; } $pageStart = ($page - 1) * $rp; $limitSql = "LIMIT {$pageStart}, {$rp}"; $data = array(); $data['page'] = $page; $data['total'] = $total; $data['rows'] = array(); $sql = "SELECT * FROM `{$table}` WHERE 1 {$searchstring} {$FORCE_FILTER} {$ORDER} {$limitSql}"; $results = $q->QUERY_SQL($sql, "artica_backup"); if (!$q->ok) { json_error_show($q->mysql_error . " LINE:" . __LINE__); } if (mysql_num_rows($results) == 0) { json_error_show("no row"); } $score = 0; while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) { $allmxText = null; $disable = Field_checkbox("enabled_{$ligne["ID"]}", 1, $ligne["enabled"], "GlobalWhiteDisable('{$ligne["ID"]}')"); $delete = imgsimple("delete-32.png", "{delete}", "GlobalWhiteDelete('{$ligne["ID"]}')"); $modifyScore = "<a href=\"javascript:blur();\" OnClick=\"javascript:GlobalScoreModify('{$ligne["ID"]}','{$score}');\" style='text-decoration:underline;font-weight:bold'>"; $allmx = unserialize($ligne["allmx"]); if ($score == 0) { $score = "{no}"; } else { $score = "-{$ligne["score"]}"; } $icon = "datasource-32.png"; if ($EnableAmavisDaemon == 0) { $score = "{disabled}"; } if (count($allmx) > 0) { $allmxText = "<div style='font-size:11px'><i>" . @implode(", ", $allmx) . "</i></div>"; } $data['rows'][] = array('id' => $ligne['ID'], 'cell' => array("<img src='img/{$icon}'>", "<span style='font-size:16px'><code>{$ligne["sender"]}</code></span>{$allmxText}", $tpl->_ENGINE_parse_body("<span style='font-size:14px'><strong style='font-size:14px' id='score_{$ligne["ID"]}'>{$modifyScore}{$score}</a></strong></span>"), "{$disable}", $delete)); } echo json_encode($data); }
function fetch_index() { $users = new usersMenus(); $tpl = new templates(); $page = CurrentPageName(); $fetchmail_rules_text = $tpl->_ENGINE_parse_body("{fetchmail_rules}"); $users->LoadModulesEnabled(); if ($users->EnableFetchmail == 0) { echo fetch_popup_enable(); exit; } if ($_GET["md"] == null) { $_GET["md"] = time(); } $add_fetchmail = Paragraphe('add-fetchmail-64.png', '{add_new_fetchmail_rule}', '{fetchmail_explain}', "javascript:add_fetchmail_rules()", null); $daemon_settings = Paragraphe('folder-tools2-64.png', '{daemon_settings}', '{daemon_settings_text}', "javascript:YahooWin('550','fetchmail.daemon.settings.php?ajax=yes','{fetchmail_daemon_settings}')"); //$rules=Paragraphe('fetchmail-rule-64.png','{fetchmail_rules}','{fetchmail_rules_text}',"javascript:YahooWin('600','fetchmail.daemon.rules.php?ajax=yes','$fetchmail_rules_text')"); //$logs=Paragraphe('64-logs.png','{events}','{events_text}',"javascript:s_PopUpScroll('fetchmail.index.php?events=true',800,600);"); $update = Paragraphe('64-recycle.png', '{update_now}', '{update_fetchmail_now}', "javascript:ReloadFetchMail();"); $apply = Paragraphe('user-config-download-64.png', '{apply_parameters}', '{compile_rules}', "javascript:Loadjs('fetchmail.compile.progress.php');"); $help = Paragraphe("help-64.png", "{help}", "{online_help}", "javascript:s_PopUpFull('http://www.mail-appliance.org/index.php?cID=126','1024','900');"); $fetchmailrc = Paragraphe('script-view-64.png', '{configuration_file}', '{display_generated_configuration_file}', "javascript:Loadjs('fetchmailrc.php')"); $html = "\n<table style='width:100%'>\n<tr>\n\t<td valign='top'>\n\t\t<div id='{$_GET["md"]}'></div>\n\t\t<div style='width:100%;text-align:right'>" . imgtootltip("refresh-24.png", "{refresh}", "LoadAjax('{$_GET["md"]}','{$page}?fetch_status=yes');") . "</div>\t\n\t</td>\n\t<td valign='top'>\n\n\n\t<table style='width:99%' class=form>\n\t<tr>\n\t\t\n\t\t<td valign='top'>{$update}</td>\n\t\t<td valign='top'>{$add_fetchmail}</td>\t\n\t\t\n\t</tr>\n\t<tr>\n\t\t\n\t\t<td valign='top'>{$apply}</td>\n\t\t<td valign='top'>{$fetchmailrc}</td>\t\n\t\t\n\t</tr>\n\t<tr>\n\t\t\n\t\t<td valign='top'>{$help}</td>\n\t\t<td valign='top'> </td>\t\n\t\t\n\t</tr>\t\n\t\n\t\n\t<tr>\n\t\t<td colspan=2><div class=text-info style='text-align:left;font-size:16px'>{fetchmail_about}</div></td>\n\t</tr>\n\t</table>\n\t\n\t</td>\n</tr>\n</table>\n\n<script>\n\t LoadAjax('{$_GET["md"]}','{$page}?fetch_status=yes');\n\t \nvar x_ReloadFetchMail= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>3){alert(tempvalue)}\n\t}\n\nfunction ReloadFetchMail(){\n \t\tvar XHR = new XHRConnection();\n XHR.appendData('reload-fetchmail',1);\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_ReloadFetchMail);\n}\t \n\t \n</script>\n\t"; echo $tpl->_ENGINE_parse_body($html); }
function security2() { $failedtext = "{ERROR_NO_PRIVILEGES_OR_PLUGIN_DISABLED}"; $page = CurrentPageName(); $users = new usersMenus(); $users->LoadModulesEnabled(); $tls = Buildicon64("DEF_ICO_POSTFIX_TLS"); //$security_rules=Paragraphe('folder-rules-64.png','{security_rules}','{security_rules_text}',"javascript:Loadjs('postfix.security.rules.php?js=yes')",null,210,null,0,true); $messages_restriction = Paragraphe('folder-message-restriction.png', '{messages_restriction}', '{messages_restriction_text}', "javascript:Loadjs('postfix.messages.restriction.php?script=yes')", null, 210, null, 0, true); $internet_deny = Paragraphe('64-internet-deny.png', '{INTERNET_DENY}', '{INTERNET_DENY_TEXT}', "javascript:Loadjs('postfix.internet.deny.php')", null, 210, 100, 0, true); $ssl = Paragraphe('folder-64-routing-secure.png', '{SSL_ENABLE}', '{SSL_ENABLE_TEXT}', "javascript:Loadjs('postfix.master.cf.php?script=ssl');", null, 210, null, 0, true); $ou_encoded = base64_encode("_Global"); //$extensions_block=Paragraphe("bg_forbiden-attachmt-64.png","{attachment_blocking}","{attachment_blocking_text}","javascript:Loadjs('domains.edit.attachblocking.ou.php?ou=$ou_encoded')",null,210,null,0,true); $plugins_activate = Paragraphe('folder-lego.png', '{POSTFIX_BUNDLE}', '{POSTFIX_BUNDLE_TEXT}', "javascript:Loadjs('postfix.plugins.php?script=yes')", null, 210, 100, 0, true); $postfixInstantIptables = Buildicon64("DEF_ICO_MAIL_IPABLES"); $backup = icon_backup(); $header_clean = Paragraphe("gomme-64.png", "{HIDE_CLIENT_MUA}", '{HIDE_CLIENT_MUA_TEXT}', "javascript:Loadjs('postfix.hide.headers.php')", null, 210, 100, 0, true); $vipwatch = Paragraphe("vipwatch-64.png", "VIPTrack", '{VIPTrack_text}', "javascript:Loadjs('postfix.viptrack.php')", null, 210, 100, 0, true); $tr[] = $backup; $tr[] = $vipwatch; $tr[] = $tls; $tr[] = $messages_restriction; $tr[] = $sasl; $tr[] = $ssl; $tr[] = $internet_deny; $tr[] = $header_clean; $table = CompileTr3($tr); $html = "\n<center>\n<div style='width:700px'>{$table}</div></center>"; $tpl = new templates(); $datas = $tpl->_ENGINE_parse_body($html); return $datas; }
function main_pureftpd() { //$status=pureftpd_status(); cookies_main(); $users = new usersMenus(); $tpl = new templates(); $users->LoadModulesEnabled(); $pure = Paragraphe('64-pureftpd-grey.png', '{APP_PUREFTPD}', '{feature_not_installed}', ''); $events = Paragraphe('64-spam-grey.png', '{events}', '{feature_not_installed}', ''); $apply = Paragraphe('system-64-grey.png', '{apply}', '{feature_not_installed}', ''); $purewho = Paragraphe('folder-rules2-64-info-grey.png', '{current_connections}', '{feature_not_installed}', ''); if ($users->PUREFTP_INSTALLED) { $pure = Paragraphe('64-pureftpd.png', '{APP_PUREFTPD}', '{APP_PUREFTPD_TEXT}', "javascript:Loadjs('pureftp.index.php?js=yes')"); $events = Paragraphe('64-spam.png', '{events}', '{events_text}', "javascript:Loadjs('pureftp.events.php')"); $apply = Paragraphe('system-64.png', '{apply}', '{apply_config_pureftpd}', "javascript:ApplyConfig('pure-ftpd');"); $purewho = Paragraphe('folder-rules2-64-info.png', '{current_connections}', '{current_connections_text}', "javascript:Loadjs('pureftp.events.php?who=yes')"); } $html = "{$tab}\n<table style='width:100%'>\n<tr>\n<td valign='top'>\n\n\t\t<table>\n\t\t\t<tr>\n\t\t\t<td valign='top' >{$pure}</td>\n\t\t\t<td valign='top' >{$events}</td>\n\t\t\t<td valign='top'>{$purewho}</td>\n\t\t\t</tr>\t\n\t\t\t<tr>\n\t\t\t<td valign='top' >{$apply}</td>\n\t\t\t<td valign='top' >{$status}</td>\n\t\t\t<td valign='top' > </td>\n\t\t\t</tr>\t\t\t\t\t\n\t\t</table>\n</td>\n<td valign='top' style='width:1%'>{$pureftp_error}\n</td>\n</tr>\n</table>"; return $tpl->_ENGINE_parse_body($html); }
function build() { $users = new usersMenus(); $sock = new sockets(); $unix = new unix(); $SystemLoadNotif = $sock->GET_INFO("SystemLoadNotif"); if (!is_numeric($SystemLoadNotif)) { $SystemLoadNotif = 0; } $EnableSyslogDB = $sock->GET_INFO("EnableSyslogDB"); if (!is_numeric($EnableSyslogDB)) { $EnableSyslogDB = 0; } $MySQLSyslogType = $sock->GET_INFO("MySQLSyslogType"); if (!is_numeric($MySQLSyslogType)) { $MySQLSyslogType = 1; } $SquidPerformance = intval($sock->GET_INFO("SquidPerformance")); $EnableIntelCeleron = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableIntelCeleron")); $python = $unix->find_program("python"); $nice = $unix->EXEC_NICE(); $ps = $unix->find_program("ps"); $sort = $unix->find_program("sort"); $head = $unix->find_program("head"); $echo = $unix->find_program("echo"); $date = $unix->find_program("date"); $mkdir = $unix->find_program("mkdir"); $php5 = $unix->LOCATE_PHP5_BIN(); $ZarafaDedicateMySQLServer = $sock->GET_INFO("ZarafaDedicateMySQLServer"); if (!is_numeric($ZarafaDedicateMySQLServer)) { $ZarafaDedicateMySQLServer = 0; } build_progress_restart("{reconfiguring}", 22); $ini = new Bs_IniHandler(); $ini->loadFile('/etc/artica-postfix/smtpnotif.conf'); if (!is_numeric($ini->_params["SMTP"]["EnableNotifs"])) { $ini->_params["SMTP"]["EnableNotifs"] = 0; } if (!is_numeric($ini->_params["SMTP"]["tls_enabled"])) { $ini->_params["SMTP"]["tls_enabled"] = 0; } $smtp_server = trim($ini->_params["SMTP"]['smtp_server_name']); $smtp_server_port = $ini->_params["SMTP"]['smtp_server_port']; $smtp_dest = $ini->_params["SMTP"]['smtp_dest']; $smtp_sender = $ini->_params["SMTP"]['smtp_sender']; $smtp_auth_user = $ini->_params["SMTP"]['smtp_auth_user']; $smtp_auth_passwd = $ini->_params["SMTP"]['smtp_auth_passwd']; $tls_enabled = $ini->_params["SMTP"]["tls_enabled"]; $recipientsZ = explode("\n", "/etc/artica-postfix/settings/Daemons/SmtpNotificationConfigCC"); $recipients = array(); while (list($index, $to) = each($recipientsZ)) { if (trim($to) == null) { continue; } $recipients[] = $to; } if ($smtp_server == null) { $ini->_params["SMTP"]["EnableNotifs"] = 0; } if ($smtp_dest == null) { if (count($recipients) == 0) { $ini->_params["SMTP"]["EnableNotifs"] = 0; } } if (!is_numeric($smtp_server_port)) { $smtp_server_port = 25; } $EnableNotifs = $ini->_params["SMTP"]["EnableNotifs"]; $monit_not_on = 'instance,action'; $f[] = 'set daemon 60 with start delay 5'; $f[] = 'set idfile /var/run/monit/monit.id'; $cpunum = $unix->CPU_NUMBER(); $normal = $cpunum * 2 + 1; $normal2 = $cpunum * 2; $busy = $cpunum * 4; build_progress_restart("{reconfiguring}", 23); $EnableMONITSmtpNotif = $sock->GET_INFO("EnableMONITSmtpNotif"); if (!is_numeric($EnableMONITSmtpNotif)) { $EnableMONITSmtpNotif = 1; } $MonitCPUUsage = intval($sock->GET_INFO("MonitCPUUsage")); $MonitCPUUsageCycles = intval($sock->GET_INFO("MonitCPUUsageCycles")); $MonitMemUsage = intval($sock->GET_INFO("MonitMemUsage")); $MonitMemUsageCycles = intval($sock->GET_INFO("MonitMemUsageCycles")); $MonitReportLoadVG1mn = intval($sock->GET_INFO("MonitReportLoadVG1mn")); $MonitReportLoadVG1mnCycles = intval($sock->GET_INFO("MonitReportLoadVG1mnCycles")); if ($MonitReportLoadVG1mnCycles == 0) { $MonitReportLoadVG1mnCycles = 5; } $MonitReportLoadVG5mn = intval($sock->GET_INFO("MonitReportLoadVG5mn")); $MonitReportLoadVG5mnCycles = intval($sock->GET_INFO("MonitReportLoadVG5mnCycles")); if ($MonitReportLoadVG5mnCycles == 0) { $MonitReportLoadVG5mnCycles = 15; } $MonitReportLoadVG15mn = intval($sock->GET_INFO("MonitReportLoadVG15mn")); $MonitReportLoadVG15mnCycles = intval($sock->GET_INFO("MonitReportLoadVG15mnCycles")); if ($MonitReportLoadVG15mnCycles == 0) { $MonitReportLoadVG15mnCycles = 60; } $MonitMemPurgeCache = intval($sock->GET_INFO("MonitMemPurgeCache")); $MonitMemPurgeCacheCycles = intval($sock->GET_INFO("MonitMemPurgeCacheCycles")); if ($MonitMemPurgeCache == 0) { $MonitMemPurgeCache = 70; } if ($MonitMemPurgeCacheCycles == 0) { $MonitMemPurgeCacheCycles = 5; } if ($MonitMemUsageCycles == 0) { $MonitMemUsageCycles = 5; } if ($MonitCPUUsageCycles == 0) { $MonitCPUUsageCycles = 15; } if ($MonitCPUUsage > 0) { if ($MonitCPUUsage < 50) { $MonitCPUUsage = 90; } } if ($MonitMemUsage > 0) { if ($MonitMemUsage < 50) { $MonitMemUsage = 90; } } build_progress_restart("{reconfiguring}", 24); $rmbin = $unix->find_program("rm"); $echo = $unix->find_program("echo"); $SQUIDEnable = $sock->GET_INFO("SQUIDEnable"); if (!is_numeric($SQUIDEnable)) { $SQUIDEnable = 1; } $f[] = 'set logfile syslog facility log_daemon'; $f[] = 'set statefile /var/run/monit/monit.state'; $f[] = ''; if ($EnableNotifs == 1) { if ($EnableMONITSmtpNotif == 1) { $f[] = "set mailserver {$smtp_server} PORT {$smtp_server_port}"; if (strlen($smtp_auth_user) > 0) { $f[] = "\tUSERNAME \"{$smtp_auth_user}\" PASSWORD \"{$smtp_auth_passwd}\""; } if ($tls_enabled == 1) { $f[] = "\tusing TLSV1"; } $f[] = "\tset eventqueue"; $f[] = "\tbasedir /var/monit"; $f[] = "\tslots 100"; $f[] = "\tset mail-format {"; $f[] = "\t\tfrom: {$smtp_sender}"; $f[] = "\t\tsubject: Artica service monitor: \$SERVICE \$EVENT"; $f[] = "\t\tmessage: Artica service monitor \$ACTION \$SERVICE at \$DATE on \$HOST: \$DESCRIPTION"; $f[] = "\t}"; $f[] = "set alert {$smtp_dest} but not on {{$monit_not_on}}"; if ($recipients > 0) { while (list($index, $to) = each($recipientsZ)) { $f[] = "set alert {$to} but not on {{$monit_not_on}}"; } } } } build_progress_restart("{reconfiguring}", 25); $allips = $unix->NETWORK_ALL_INTERFACES(true); $f[] = "set httpd port 2874 and use address 127.0.0.1"; $f[] = "\tallow 127.0.0.1"; while (list($tcpi, $to) = each($allips)) { $f[] = "\tallow {$tcpi}"; } $top = $unix->find_program("top"); $hostname = $unix->hostname_g(); $TSCR = array(); if ($MonitReportLoadVG1mn > 0) { $TSCR[] = "\tif loadavg (1min) > {$MonitReportLoadVG1mn} for {$MonitReportLoadVG1mnCycles} cycles then exec \"/bin/artica-system-alert.sh LOAD_1 {$MonitReportLoadVG1mn}\""; } if ($MonitReportLoadVG5mn > 0) { $TSCR[] = "\tif loadavg (5min) > {$MonitReportLoadVG5mn} for {$MonitReportLoadVG5mnCycles} cycles then exec \"/bin/artica-system-alert.sh LOAD_5 {$MonitReportLoadVG5mn}\""; } if ($MonitReportLoadVG15mn > 0) { $TSCR[] = "\tif loadavg (15min) > {$MonitReportLoadVG15mn} for {$MonitReportLoadVG15mnCycles} cycles then exec \"/bin/artica-system-alert.sh LOAD_15 {$MonitReportLoadVG15mn}\""; } if ($MonitCPUUsage > 0) { if ($MonitCPUUsage < 75) { $MonitCPUUsage = 75; } $TSCR[] = "\tif cpu usage(system) > {$MonitCPUUsage}% for {$MonitCPUUsageCycles} cycles then exec \"/bin/artica-system-alert.sh CPU_SYSTEM {$MonitCPUUsage}\""; $TSCR[] = "\tif cpu usage(user) > {$MonitCPUUsage}% for {$MonitCPUUsageCycles} cycles then exec \"/bin/artica-system-alert.sh CPU_USER {$MonitCPUUsage}\""; $TSCR[] = "\tif cpu usage(wait) > {$MonitCPUUsage}% for {$MonitCPUUsageCycles} cycles then exec \"/bin/artica-system-alert.sh CPU_WAIT {$MonitCPUUsage}\""; } if ($MonitMemUsage > 0) { if ($MonitMemUsage < 75) { $MonitMemUsage = 75; } $TSCR[] = "\tif memory > {$MonitMemUsage}% for {$MonitMemUsageCycles} cycles then exec \"/bin/artica-system-alert.sh MEM {$MonitMemUsage}\""; } if ($MonitMemPurgeCache > 5) { @chmod("/usr/share/artica-postfix/exec.kernel.purge.cache.php", 0755); $TSCR[] = "\tif memory > {$MonitMemPurgeCache}% for {$MonitMemPurgeCacheCycles} cycles then exec \"/usr/share/artica-postfix/exec.kernel.purge.cache.php\""; } if (count($TSCR) > 1) { $f[] = "check system " . $unix->hostname_g(); $f[] = @implode("\n", $TSCR); } $TSCR = array(); $SCRIPT = array(); $SCRIPT[] = "#!/bin/sh"; $SCRIPT[] = "CURRENT=`{$date} +%s`"; $SCRIPT[] = "DIR=\"/home/artica/system/perf-queue/\$CURRENT\""; $SCRIPT[] = "{$mkdir} -p \"\$DIR\""; $SCRIPT[] = "{$echo} \$CURRENT >\$DIR/time.txt"; $SCRIPT[] = "{$echo} \$1 >\$DIR/why.txt"; $SCRIPT[] = "{$echo} \$2 >\$DIR/why2.txt"; $iotop = $unix->find_program("iotop"); if (is_file($iotop)) { $SCRIPT[] = "{$iotop} -o -a -b -q -t -n 20 >\$DIR/iotop.txt || true"; } $SCRIPT[] = "{$nice} {$python} /usr/share/artica-postfix/bin/ps_mem.py >\$DIR/psmem.txt 2>&1"; $SCRIPT[] = "{$ps} --no-heading -eo user,pid,pcpu,args|{$sort} -grbk 3|{$head} -50 >\$DIR/TOP50-CPU.txt 2>&1"; $SCRIPT[] = "{$ps} --no-heading -eo user,pid,pmem,args|{$sort} -grbk 3|{$head} -50 >\$DIR/TOP50-MEM.txt 2>&1"; $SCRIPT[] = "{$ps} auxww >\$DIR/ALLPS.txt 2>&1"; $SCRIPT[] = ""; @file_put_contents("/bin/artica-system-alert.sh", @implode("\n", $SCRIPT)); @chmod("/bin/artica-system-alert.sh", 0755); $SCRIPT = array(); $f[] = ""; $f[] = "check host loopback with address 127.0.0.1"; $f[] = "\tif failed icmp type echo with timeout 1 seconds then exec \"/bin/loopbackfailed.sh\""; $f[] = ""; $loopbackfailed[] = "#!/bin/sh"; $loopbackfailed[] = "{$php5} /usr/share/artica-postfix/exec.virtuals-ip.php --loopback"; $loopbackfailed[] = ""; @file_put_contents("/bin/loopbackfailed.sh", @implode("\n", $loopbackfailed)); @chmod("/bin/loopbackfailed.sh", 0755); $loopbackfailed = array(); build_progress_restart("{reconfiguring}", 25); //******************************************************************************************************************** $f[] = "check file php.log with path /var/log/php.log"; $f[] = "\tif size > 100 MB then"; $f[] = "\t\texec \"/bin/clean-phplog.sh\""; $f[] = ""; $f[] = "check file usrphp.log with path /usr/share/artica-postfix/ressources/logs/php.log"; $f[] = " if size > 100 MB then"; $f[] = "\t\texec \"/bin/clean-phplog.sh\""; $f[] = ""; $f[] = "check file squid-logger-start.log with path /var/log/artica-postfix/squid-logger-start.log"; $f[] = "\tif size > 100 MB then"; $f[] = "\t\texec \"/bin/squid-logger-start.sh\""; $f[] = ""; build_progress_restart("{reconfiguring}", 26); $f[] = "include /etc/monit/conf.d/*"; @file_put_contents("/etc/monit/monitrc", @implode("\n", $f)); if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} /etc/monit/monitrc done...\n"; } $AA[] = "#!/bin/sh"; $AA[] = "{$echo} \"#\" >/var/log/artica-postfix/squid-logger-start.log"; $AA[] = ""; @file_put_contents("/bin/squid-logger-start.sh", @implode("\n", $AA)); @chmod("/bin/squid-logger-start.sh", 0755); $AA = array(); $AA[] = "#!/bin/sh"; $AA[] = "{$echo} \"#\" >/var/log/php.log"; $AA[] = ""; @file_put_contents("/bin/clean-phplog.sh", @implode("\n", $AA)); @chmod("/bin/clean-phplog.sh", 0755); $AA = array(); $monit = new monit(); $monit->save(); $INITD_PATH = $unix->SLAPD_INITD_PATH(); $SLAPD_PID_FILE = $unix->SLAPD_PID_PATH(); $squidbin = $unix->LOCATE_SQUID_BIN(); @unlink("/etc/monit/conf.d/APP_OPENLDAP.monitrc"); //******************************************************************************************************************** $f = array(); //******************************************************************************************************************** build_progress_restart("{reconfiguring}", 27); $f = array(); $f[] = "check process APP_FRAMEWORK"; $f[] = "with pidfile /var/run/lighttpd/framework.pid"; $f[] = "start program = \"/etc/init.d/artica-framework start --monit\""; $f[] = "stop program = \"/etc/init.d/artica-framework stop --monit\""; $f[] = "if 5 restarts within 5 cycles then timeout"; @file_put_contents("/etc/monit/conf.d/articaframework.monitrc", @implode("\n", $f)); $f = array(); //******************************************************************************************************************** $f = array(); @unlink("/etc/monit/conf.d/APP_OPENSSH.monitrc"); @unlink("/etc/monit/conf.d/APP_MYSQLD.monitrc"); //******************************************************************************************************************** $f = array(); build_progress_restart("{reconfiguring}", 28); $f[] = "check process APP_ARTICA_STATUS with pidfile /etc/artica-postfix/exec.status.php.pid"; $f[] = "\tstart program = \"/etc/init.d/artica-status start --monit\""; $f[] = "\tstop program = \"/etc/init.d/artica-status stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Artica Status...\n"; } @file_put_contents("/etc/monit/conf.d/APP_ARTICASTATUS.monitrc", @implode("\n", $f)); //******************************************************************************************************************** $f = array(); $EnableInflux = 1; if ($SquidPerformance > 2) { $EnableInflux = 0; } $InfluxUseRemote = intval($sock->GET_INFO("InfluxUseRemote")); $EnableInfluxDB = intval($sock->GET_INFO("EnableInfluxDB")); if ($InfluxUseRemote == 1) { $EnableInfluxDB = 0; } if ($EnableIntelCeleron == 1) { $EnableInflux = 0; } if ($EnableInfluxDB == 0) { $EnableInflux = 0; } if (is_file("/etc/artica-postfix/STATS_APPLIANCE")) { $EnableInflux = 1; } build_progress_restart("{reconfiguring}", 29); @unlink("/etc/monit/conf.d/APP_INFLUXDB.monitrc"); @unlink("/etc/monit/conf.d/APP_POSTGRES.monitrc"); if (is_file("/usr/local/ArticaStats/bin/postgres")) { if ($EnableInflux == 1) { $InfluxRestartMem = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/InfluxRestartMem")); $f[] = "check process APP_POSTGRES with pidfile /home/ArticaStatsDB/postmaster.pid"; $f[] = "\tstart program = \"/etc/init.d/artica-postgres start --monit\""; $f[] = "\tstop program = \"/etc/init.d/artica-postgres --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; if ($InfluxRestartMem > 50) { $f[] = "\tif totalmem > {$InfluxRestartMem} MB for 5 cycles then restart"; } $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Artica Status...\n"; } @file_put_contents("/etc/monit/conf.d/APP_POSTGRES.monitrc", @implode("\n", $f)); //******************************************************************************************************************** } } $f = array(); @unlink("/etc/monit/conf.d/squid.monitrc"); @unlink("/etc/monit/conf.d/APP_SQUIDMAIN.monitrc"); // ******************************************************************************************************************** $f = array(); @unlink("/etc/monit/conf.d/APP_SQUIDDB.monitrc"); build_progress_restart("{reconfiguring} Proxy service", 30); if (is_dir("/opt/squidsql/data")) { if ($SQUIDEnable == 1) { $f = array(); $f[] = "check process APP_SQUID_DB with pidfile /var/run/squid-db.pid"; $f[] = "\tstart program = \"/etc/init.d/squid-db start --monit\""; $f[] = "\tstop program = \"/etc/init.d/squid-db stop --monit\""; $f[] = "\tif failed unixsocket /var/run/mysqld/squid-db.sock then restart"; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Squid MySQL DB...\n"; } @file_put_contents("/etc/monit/conf.d/APP_SQUIDDB.monitrc", @implode("\n", $f)); } } // ******************************************************************************************************************** $f = array(); build_progress_restart("{reconfiguring} Dnsmasq", 31); @unlink("/etc/monit/conf.d/APP_DNSMASQ.monitrc"); if ($users->dnsmasq_installed) { $enabled = $sock->dnsmasq_enabled(); if ($enabled == 1) { $f[] = "check process APP_DNSMASQ with pidfile /var/run/dnsmasq.pid"; $f[] = "\tstart program = \"/etc/init.d/dnsmasq start --monit\""; $f[] = "\tstop program = \"/etc/init.d/dnsmasq stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring DnsMASQ...\n"; } @file_put_contents("/etc/monit/conf.d/APP_DNSMASQ.monitrc", @implode("\n", $f)); } } // ******************************************************************************************************************** $f = array(); build_progress_restart("{reconfiguring} Proftpd", 31); @unlink("/etc/monit/conf.d/APP_PROFTPD.monitrc"); $proftpd = $unix->find_program("proftpd"); if (is_file($proftpd)) { $enabled = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableProFTPD")); if ($enabled == 1) { $f[] = "check process APP_PROFTPD with pidfile /var/run/proftpd.pid"; $f[] = "\tstart program = \"/etc/init.d/proftpd start --monit\""; $f[] = "\tstop program = \"/etc/init.d/proftpd stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring DnsMASQ...\n"; } @file_put_contents("/etc/monit/conf.d/APP_PROFTPD.monitrc", @implode("\n", $f)); } } // ******************************************************************************************************************** $f = array(); build_progress_restart("{reconfiguring} Bandwidthd", 31); @unlink("/etc/monit/conf.d/APP_BANDWIDTHD.monitrc"); if (is_file("/usr/bandwidthd/bandwidthd")) { $enabled = $sock->Bandwidthd_enabled(); if ($enabled == 1) { $f[] = "check process APP_BANDWIDTHD with pidfile /var/run/bandwidthd.pid"; $f[] = "\tstart program = \"/etc/init.d/bandwidthd start --monit\""; $f[] = "\tstop program = \"/etc/init.d/bandwidthd stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring DnsMASQ...\n"; } @file_put_contents("/etc/monit/conf.d/APP_BANDWIDTHD.monitrc", @implode("\n", $f)); } } // ******************************************************************************************************************** $f = array(); build_progress_restart("{reconfiguring} rsyslog", 32); $rsyslogd = $unix->find_program("rsyslogd"); @unlink("/etc/monit/conf.d/APP_RSYSLOG.monitrc"); if (is_file($rsyslogd)) { $SCRIPT = array(); $SCRIPT[] = "#!/bin/sh"; $SCRIPT[] = "{$php5} /usr/share/artica-postfix/exec.watchdog.rsyslogd.php --start"; $SCRIPT[] = ""; @file_put_contents("/bin/artica-rsyslog-start.sh", @implode("\n", $SCRIPT)); @chmod("/bin/artica-rsyslog-start.sh", 0755); $SCRIPT = array(); $SCRIPT[] = "#!/bin/sh"; $SCRIPT[] = "{$php5} /usr/share/artica-postfix/exec.watchdog.rsyslogd.php --stop"; $SCRIPT[] = ""; @file_put_contents("/bin/artica-rsyslog-stop.sh", @implode("\n", $SCRIPT)); @chmod("/bin/artica-rsyslog-stop.sh", 0755); $SCRIPT = array(); $f[] = "check process APP_RSYSLOG with pidfile /var/run/rsyslogd.pid"; $f[] = "\tstart program = \"/bin/artica-rsyslog-start.sh\""; $f[] = "\tstop program = \"/bin/artica-rsyslog-stop.sh\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring rsyslogd...\n"; } @file_put_contents("/etc/monit/conf.d/APP_RSYSLOG.monitrc", @implode("\n", $f)); } // ******************************************************************************************************************** build_progress_restart("{reconfiguring} Squid-tail", 32); $APP_ARTICA_SQUID_TAIL = $unix->SQUID_TAIL_ENABLED(); @unlink("/etc/monit/conf.d/APP_ARTICA_SQUID_TAIL.monitrc"); if ($APP_ARTICA_SQUID_TAIL == 1) { $f = array(); $f[] = "check process APP_ARTICA_SQUID_TAIL with pidfile /etc/artica-postfix/pids/exec.logfile_daemon.php.pid"; $f[] = "\tstart program = \"/etc/init.d/squid-tail start\""; $f[] = "\tstop program = \"/etc/init.d/squid-tail stop\""; $f[] = "\tif cpu usage > 95% for 5 cycles then restart"; $f[] = "\tif totalmem > 550.0 MB for 5 cycles then restart"; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring squid-tail...\n"; } @file_put_contents("/etc/monit/conf.d/APP_ARTICA_SQUID_TAIL.monitrc", @implode("\n", $f)); } // ******************************************************************************************************************** build_progress_restart("{reconfiguring} Squid-Proxy", 32); $APP_SQUID = $unix->SQUID_ENABLED(); @unlink("/etc/monit/conf.d/APP_SQUID.monitrc"); if ($APP_SQUID == 1) { $MonitConfig = unserialize(base64_decode(@file_get_contents("/etc/artica-postfix/settings/SquidWatchdogMonitConfig"))); if (!isset($MonitConfig["watchdog"])) { $MonitConfig["watchdog"] = 1; } if (!is_numeric($MonitConfig["watchdog"])) { $MonitConfig["watchdog"] = 1; } $f = array(); if ($MonitConfig["watchdog"] == 1) { $MonitSquidMaxRestartMem = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/MonitSquidMaxRestartMem")); $MonitSquidMaxCPU = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/MonitSquidMaxCPU")); $f[] = "check process APP_SQUID with pidfile /var/run/squid/squid.pid"; $f[] = "\tstart program = \"/etc/init.d/squid start --monit\""; $f[] = "\tstop program = \"/etc/init.d/squid stop --monit\""; if ($MonitSquidMaxCPU > 0) { $f[] = "\tif cpu usage > {$MonitSquidMaxCPU}% for 5 cycles then restart"; } if ($MonitSquidMaxRestartMem > 0) { $f[] = "\tif totalmem > {$MonitSquidMaxRestartMem}.0 MB for 5 cycles then restart"; } $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring squid...\n"; } @file_put_contents("/etc/monit/conf.d/APP_SQUID.monitrc", @implode("\n", $f)); } } // ******************************************************************************************************************** build_progress_restart("{reconfiguring} OpenLDAP", 32); $EnableOpenLDAP = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableOpenLDAP")); $SLAPD_PID_FILE = $unix->SLAPD_PID_PATH(); @unlink("/etc/monit/conf.d/APP_SLAPD.monitrc"); if ($EnableOpenLDAP == 1) { if ($EnableIntelCeleron == 0) { $f = array(); $f[] = "check process APP_SLAPD with pidfile {$SLAPD_PID_FILE}"; $f[] = "\tstart program = \"/etc/init.d/slapd start --force --monit\""; $f[] = "\tstop program = \"/etc/init.d/slapd stop --force\""; $f[] = "\tif cpu usage > 95% for 5 cycles then restart"; $f[] = "\tif totalmem > 550.0 MB for 5 cycles then restart"; $f[] = "\tif failed unixsocket /var/run/slapd/slapd.sock then restart"; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring slapd...\n"; } @file_put_contents("/etc/monit/conf.d/APP_SLAPD.monitrc", @implode("\n", $f)); } } // ******************************************************************************************************************** $f = array(); build_progress_restart("{reconfiguring} Suricata", 32); $EnableSuricata = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableSuricata")); @unlink("/etc/monit/conf.d/APP_SURICATA.monitrc"); @unlink("/etc/monit/conf.d/APP_SURICATA_TAIL.monitrc"); $suricata = $unix->find_program("suricata"); if (is_file($suricata)) { if ($EnableSuricata == 1) { $f[] = "check process APP_SURICATA with pidfile /var/run/suricata/suricata.pid"; $f[] = "\tstart program = \"/etc/init.d/suricata start --monit\""; $f[] = "\tstop program = \"/etc/init.d/suricata stop --monit\""; $f[] = "\tif cpu usage > 95% for 5 cycles then restart"; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Suricata...\n"; } @file_put_contents("/etc/monit/conf.d/APP_SURICATA.monitrc", @implode("\n", $f)); $f = array(); $f[] = "check process APP_SURICATA_TAIL with pidfile /etc/artica-postfix/exec.suricata-tail.php.pid"; $f[] = "\tstart program = \"/etc/init.d/suricata-tail start --monit\""; $f[] = "\tstop program = \"/etc/init.d/suricata-tail stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Suricata tail...\n"; } @file_put_contents("/etc/monit/conf.d/APP_SURICATA_TAIL.monitrc", @implode("\n", $f)); } } // ******************************************************************************************************************** $f = array(); build_progress_restart("{reconfiguring}", 32); $winbind = $unix->find_program("winbindd"); if (is_file("/etc/monit/conf.d/winbindd.monitrc")) { @unlink("/etc/monit/conf.d/winbindd.monitrc"); } @unlink("/etc/monit/conf.d/winbind.monitrc"); $EnableKerbAuth = intval(@file_get_contents("/etc/artica-postfix/settings/Daemons/EnableKerbAuth")); if (is_file($winbind)) { if ($EnableKerbAuth == 1) { $f[] = "check process winbindd with pidfile /var/run/samba/winbindd.pid"; $f[] = "\tstart program = \"/etc/init.d/winbind start\""; $f[] = "\tstop program = \"/etc/init.d/winbind stop\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring winbindd...\n"; } @file_put_contents("/etc/monit/conf.d/winbind.monitrc", @implode("\n", $f)); } } // ******************************************************************************************************************** $f = array(); build_progress_restart("{reconfiguring}", 33); @unlink("/etc/monit/conf.d/APP_CICAP.monitrc"); if ($users->C_ICAP_INSTALLED) { if ($SQUIDEnable == 1) { $CicapEnabled = $sock->GET_INFO("CicapEnabled"); if (!is_numeric($CicapEnabled)) { $CicapEnabled = 0; } if ($CicapEnabled == 1) { $f[] = "check process APP_C_ICAP with pidfile /var/run/c-icap/c-icap.pid"; $f[] = "\tstart program = \"/etc/init.d/artica-postfix start cicap\""; $f[] = "\tstop program = \"/etc/init.d/artica-postfix stop cicap\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring C-ICAP...\n"; } @file_put_contents("/etc/monit/conf.d/APP_CICAP.monitrc", @implode("\n", $f)); } } } // ******************************************************************************************************************** build_progress_restart("{reconfiguring}", 34); @unlink("/etc/monit/conf.d/APP_SYSLOGDB.monitrc"); if ($EnableSyslogDB == 1) { if ($MySQLSyslogType == 1) { $f = array(); $f[] = "check process APP_SYSLOG_DB with pidfile /var/run/syslogdb.pid"; $f[] = "\tstart program = \"/etc/init.d/syslog-db start --monit\""; $f[] = "\tstop program = \"/etc/init.d/syslog-db stop --monit\""; $f[] = "\tif failed unixsocket /var/run/syslogdb.sock then restart"; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring syslogd...\n"; } @file_put_contents("/etc/monit/conf.d/APP_SYSLOGDB.monitrc", @implode("\n", $f)); $f = array(); } } //******************************************************************************************************************** $f = array(); @unlink("/etc/monit/conf.d/cron.monitrc"); if (is_file("/etc/monit/templates/rootbin")) { $f[] = "check process crond with pidfile /var/run/crond.pid"; $f[] = " group system"; $f[] = " group crond"; $f[] = " start program = \"/etc/init.d/cron start\""; $f[] = " stop program = \"/etc/init.d/cron stop\""; $f[] = " if 5 restarts with 5 cycles then timeout"; $f[] = " depend cron_bin"; $f[] = " depend cron_rc"; $f[] = " depend cron_spool"; $f[] = ""; $f[] = " check file cron_bin with path /usr/sbin/cron"; $f[] = " group crond"; $f[] = " include /etc/monit/templates/rootbin"; $f[] = ""; $f[] = " check file cron_rc with path \"/etc/init.d/cron\""; $f[] = " group crond"; $f[] = " include /etc/monit/templates/rootbin"; $f[] = ""; $f[] = " check directory cron_spool with path /var/spool/cron/crontabs"; $f[] = " group crond"; $f[] = " if failed permission 1730 then unmonitor"; $f[] = " if failed uid root then unmonitor"; $f[] = " if failed gid crontab then unmonitor"; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring cron...\n"; } @file_put_contents("/etc/monit/conf.d/cron.monitrc", @implode("\n", $f)); $f = array(); } @unlink("/etc/monit/conf.d/APP_ZARAFASERVER.monitrc"); @unlink("/etc/monit/conf.d/APP_ZARAFAGATEWAY.monitrc"); @unlink("/etc/monit/conf.d/APP_ZARAFAAPACHE.monitrc"); @unlink("/etc/monit/conf.d/APP_ZARAFAWEB.monitrc"); @unlink("/etc/monit/conf.d/APP_ZARAFASPOOLER.monitrc"); @unlink("/etc/monit/conf.d/APP_ZARAFADB.monitrc"); build_progress_restart("{reconfiguring}", 35); if (is_file($unix->find_program("zarafa-server"))) { $ZarafaApacheEnable = $sock->GET_INFO("ZarafaApacheEnable"); if (!is_numeric($ZarafaApacheEnable)) { $ZarafaApacheEnable = 1; } $ZarafaApachePort = $sock->GET_INFO("ZarafaApachePort"); if (!is_numeric($ZarafaApachePort)) { $ZarafaApachePort = 9010; } if ($ZarafaDedicateMySQLServer == 1) { $f = array(); $f[] = "check process APP_ZARAFA_DB with pidfile /var/run/zarafa-db.pid"; $f[] = "\tstart program = \"/etc/init.d/zarafa-db start --monit\""; $f[] = "\tstop program = \"/etc/init.d/zarafa-db stop --monit\""; $f[] = "\tif failed unixsocket /var/run/mysqld/zarafa-db.sock then restart"; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Zarafa Database...\n"; } @file_put_contents("/etc/monit/conf.d/APP_ZARAFADB.monitrc", @implode("\n", $f)); } $f = array(); $f[] = "check process APP_ZARAFA_SERVER with pidfile /var/run/zarafa-server.pid"; $f[] = "\tstart program = \"/etc/init.d/zarafa-server start --monit\""; $f[] = "\tstop program = \"/etc/init.d/zarafa-server stop --monit\""; $f[] = "\tif failed unixsocket /var/run/zarafa then restart"; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Zarafa Server...\n"; } @file_put_contents("/etc/monit/conf.d/APP_ZARAFASERVER.monitrc", @implode("\n", $f)); $f = array(); $f[] = "check process APP_ZARAFA_SPOOLER with pidfile /var/run/zarafa-spooler.pid"; $f[] = "\tstart program = \"/etc/init.d/zarafa-spooler start --monit\""; $f[] = "\tstop program = \"/etc/init.d/zarafa-spooler stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Zarafa Spooler...\n"; } @file_put_contents("/etc/monit/conf.d/APP_ZARAFASPOOLER.monitrc", @implode("\n", $f)); $f = array(); $f[] = "check process APP_ZARAFA_GATEWAY with pidfile /var/run/zarafa-gateway.pid"; $f[] = "\tstart program = \"/etc/init.d/zarafa-gateway start --monit\""; $f[] = "\tstop program = \"/etc/init.d/zarafa-gateway stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Zarafa Gateway...\n"; } @file_put_contents("/etc/monit/conf.d/APP_ZARAFAGATEWAY.monitrc", @implode("\n", $f)); } //******************************************************************************************************************** build_progress_restart("{reconfiguring}", 36); $EnableClamavDaemon = $sock->GET_INFO("EnableClamavDaemon"); $EnableClamavDaemonForced = $sock->GET_INFO("EnableClamavDaemonForced"); $CicapEnabled = $sock->GET_INFO("CicapEnabled"); $SQUIDEnable = $sock->GET_INFO("SQUIDEnable"); if (!is_numeric($EnableClamavDaemon)) { $EnableClamavDaemon = 0; } if (!is_numeric($EnableClamavDaemonForced)) { $EnableClamavDaemonForced = 0; } if (!is_numeric($SQUIDEnable)) { $SQUIDEnable = 1; } if (!is_numeric($CicapEnabled)) { $CicapEnabled = 0; } if ($SQUIDEnable == 1) { if ($CicapEnabled == 1) { $EnableClamavDaemon = 1; } } if ($EnableClamavDaemonForced == 1) { $EnableClamavDaemon = 1; } //******************************************************************************************************************** build_progress_restart("{reconfiguring}", 37); @unlink("/etc/monit/conf.d/APP_CLAMAV.monitrc"); $MasterBin = $unix->find_program("clamd"); if (is_file($MasterBin)) { if ($EnableClamavDaemon == 1) { $f = array(); $f[] = "check process APP_CLAMAV"; $f[] = "with pidfile /var/run/clamav/clamd.pid"; $f[] = "start program = \"/etc/init.d/clamav-daemon start --monit\""; $f[] = "stop program = \"/etc/init.d/clamav-daemon stop --monit\""; $f[] = "if 5 restarts within 5 cycles then timeout"; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Clamd service...\n"; } @file_put_contents("/etc/monit/conf.d/APP_CLAMAV.monitrc", @implode("\n", $f)); $f = array(); } } //******************************************************************************************************************** @unlink("/etc/monit/conf.d/ufdb.monitrc"); @unlink("/etc/monit/conf.d/ufdbweb.monitrc"); $ufdbbin = $unix->find_program("ufdbguardd"); build_progress_restart("{reconfiguring}", 38); if (is_file($ufdbbin)) { $EnableUfdbGuard = intval($sock->EnableUfdbGuard()); $UseRemoteUfdbguardService = $sock->GET_INFO('UseRemoteUfdbguardService'); $EnableSquidGuardHTTPService = $sock->GET_INFO("EnableSquidGuardHTTPService"); $SquidPerformance = intval($sock->GET_INFO("SquidPerformance")); $EnableWebProxyStatsAppliance = $sock->GET_INFO("EnableWebProxyStatsAppliance"); $SquidGuardApachePort = $sock->GET_INFO("SquidGuardApachePort"); $SquidGuardApacheSSLPort = $sock->GET_INFO("SquidGuardApacheSSLPort"); if (!is_numeric($UseRemoteUfdbguardService)) { $UseRemoteUfdbguardService = 0; } if (!is_numeric($EnableUfdbGuard)) { $EnableUfdbGuard = 0; } if (!is_numeric($EnableSquidGuardHTTPService)) { $EnableSquidGuardHTTPService = 1; } if (!is_numeric($EnableWebProxyStatsAppliance)) { $EnableWebProxyStatsAppliance = 0; } if ($EnableUfdbGuard == 0) { $EnableSquidGuardHTTPService = 0; } if ($EnableWebProxyStatsAppliance == 1) { $EnableSquidGuardHTTPService = 1; } if (!is_numeric($SquidGuardApachePort)) { $SquidGuardApachePort = "9020"; } if (!is_numeric($SquidGuardApacheSSLPort)) { $SquidGuardApacheSSLPort = 9025; } if ($SquidPerformance > 2) { $EnableSquidGuardHTTPService = 0; } if ($SQUIDEnable == 1) { if ($EnableSquidGuardHTTPService == 1) { $f = array(); $f[] = "check process APP_SQUIDGUARD_HTTP"; $f[] = "with pidfile /var/run/lighttpd/squidguard-lighttpd.pid"; $f[] = "start program = \"/etc/init.d/squidguard-http start --monit\""; $f[] = "stop program = \"/etc/init.d/squidguard-http stop --monit\""; $f[] = "if failed host 127.0.0.1 port {$SquidGuardApachePort} then restart"; $f[] = "if 5 restarts within 5 cycles then timeout"; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Web filtering HTTP service...\n"; } @file_put_contents("/etc/monit/conf.d/ufdbweb.monitrc", @implode("\n", $f)); } } } //******************************************************************************************************************** $EnableArticaFrontEndToNGninx = $sock->GET_INFO("EnableArticaFrontEndToNGninx"); $EnableArticaFrontEndToApache = $sock->GET_INFO("EnableArticaFrontEndToApache"); if (!is_numeric($EnableArticaFrontEndToNGninx)) { $EnableArticaFrontEndToNGninx = 0; } if (!is_numeric($EnableArticaFrontEndToApache)) { $EnableArticaFrontEndToApache = 0; } $EnableNginx = $sock->GET_INFO("EnableNginx"); $EnableFreeWeb = $sock->GET_INFO("EnableFreeWeb"); if (!is_numeric($EnableFreeWeb)) { $EnableFreeWeb = 0; } if (!is_numeric($EnableNginx)) { $EnableNginx = 1; } if ($EnableNginx == 0) { $EnableArticaFrontEndToNGninx = 0; } $pid = null; build_progress_restart("{reconfiguring}", 39); @unlink("/etc/monit/conf.d/APP_LIGHTTPD.monitrc"); if ($EnableArticaFrontEndToNGninx == 0) { $pid = "/var/run/lighttpd/lighttpd.pid"; if ($EnableArticaFrontEndToApache == 1) { $pid = "/var/run/artica-apache/apache.pid"; } $f = array(); $f[] = "check process APP_ARTICAWEBCONSOLE with pidfile {$pid}"; $f[] = "\tstart program = \"/etc/init.d/artica-webconsole start --monit\""; $f[] = "\tstop program = \"/etc/init.d/artica-webconsole stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring Artica Web Console...\n"; } @file_put_contents("/etc/monit/conf.d/APP_LIGHTTPD.monitrc", @implode("\n", $f)); } //******************************************************************************************************************** @unlink("/etc/monit/conf.d/APP_NGINX.monitrc"); $nginx = $unix->find_program("nginx"); if (is_file($nginx)) { if ($EnableNginx == 1) { $f = array(); $f[] = "check process APP_NGINX with pidfile /var/run/nginx.pid"; $f[] = "\tstart program = \"/etc/init.d/nginx start --monit\""; $f[] = "\tstop program = \"/etc/init.d/nginx stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring NgINX...\n"; } @file_put_contents("/etc/monit/conf.d/APP_NGINX.monitrc", @implode("\n", $f)); } } //******************************************************************************************************************** build_progress_restart("{reconfiguring}", 40); $f = array(); if (is_file("/etc/init.d/sysklogd")) { $f[] = "check process APP_SYSLOGD with pidfile /var/run/syslogd.pid"; $f[] = "\tstart program = \"/etc/init.d/sysklogd start --monit\""; $f[] = "\tstop program = \"/etc/init.d/sysklogd stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = "\tcheck file syslogd_file with path /var/log/syslog"; $f[] = "\tif timestamp > 10 minutes then restart"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring sysklogd...\n"; } @file_put_contents("/etc/monit/conf.d/APP_SYSKLOGD.monitrc", @implode("\n", $f)); } //******************************************************************************************************************** build_progress_restart("{reconfiguring}", 41); $binpath = $unix->DHCPD_BIN_PATH(); @unlink("/etc/monit/conf.d/APP_DHCPD.monitrc"); $f = array(); if (is_file($binpath)) { $EnableDHCPServer = $sock->GET_INFO("EnableDHCPServer"); if (!is_numeric($EnableDHCPServer)) { $EnableDHCPServer = 0; } if ($EnableDHCPServer == 1) { $f[] = "check process APP_DHCP with pidfile /var/run/dhcpd.pid"; $f[] = "\tstart program = \"/etc/init.d/isc-dhcp-server start --monit\""; $f[] = "\tstop program = \"/etc/init.d/isc-dhcp-server stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring DHCP Service...\n"; } @file_put_contents("/etc/monit/conf.d/APP_DHCPD.monitrc", @implode("\n", $f)); } } //******************************************************************************************************************** $binpath = $unix->find_program("rdpproxy"); build_progress_restart("{reconfiguring}", 42); @unlink("/etc/monit/conf.d/APP_RDPPROXY.monitrc"); $f = array(); if (is_file($binpath)) { $EnableRDPProxy = $sock->GET_INFO("EnableRDPProxy"); if (!is_numeric($EnableRDPProxy)) { $EnableRDPProxy = 0; } if ($EnableRDPProxy == 1) { $f[] = "check process APP_RDPPROXY with pidfile /var/run/redemption/rdpproxy.pid"; $f[] = "\tstart program = \"/etc/init.d/rdpproxy start --monit\""; $f[] = "\tstop program = \"/etc/init.d/rdpproxy stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring RDP Proxy...\n"; } @file_put_contents("/etc/monit/conf.d/APP_RDPPROXY.monitrc", @implode("\n", $f)); } } //******************************************************************************************************************** build_progress_restart("{reconfiguring}", 43); @unlink("/etc/monit/conf.d/APP_DNSMASQ.monitrc"); $f = array(); $binpath = $unix->find_program("dnsmasq"); if (is_file($binpath)) { $EnableDNSMASQ = $users->EnableDNSMASQ(); if ($EnableDNSMASQ == 1) { $f[] = "check process APP_DNSMASQ with pidfile /var/run/dnsmasq.pid"; $f[] = "\tstart program = \"/etc/init.d/dnsmasq start --monit\""; $f[] = "\tstop program = \"/etc/init.d/dnsmasq stop --monit\""; $f[] = "\tif 5 restarts within 5 cycles then timeout"; $f[] = ""; if ($GLOBALS["OUTPUT"]) { echo "Stopping......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} monitoring DNSMasq Service...\n"; } @file_put_contents("/etc/monit/conf.d/APP_DNSMASQ.monitrc", @implode("\n", $f)); } } //******************************************************************************************************************** if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} checking syslog\n"; } if (is_file("/etc/init.d/syslog")) { checkDebSyslog(); } if ($GLOBALS["OUTPUT"]) { echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]} configuration done\n"; } shell_exec($GLOBALS["MONIT_CLASS"]->monitor_all_cmdline . " 2>&1"); build_progress_restart("{reconfiguring}", 45); }
function ApplyConfigKavMail() { $users = new usersMenus(); $users->LoadModulesEnabled(); if ($users->KAV_MILTER_INSTALLED) { if ($users->KAVMILTER_ENABLED == 1) { include_once "ressources/class.kavmilterd.inc"; $kavmilterd = new kavmilterd(); $kavmilterd->ReBuildAllRules(); $kavmilterd->SaveToLdap(); $result = Success("aveserver_main_settings"); $tpl = new templates(); echo $tpl->_ENGINE_parse_body($result); } } }
function main_settings($noecho = 0) { $amavis = new amavis(); $page = CurrentPageName(); $users = new usersMenus(); $users->LoadModulesEnabled(); $array = array("D_PASS" => "{D_PASS}", "D_DISCARD" => "{D_DISCARD}", "D_BOUNCE" => "{D_BOUNCE}"); $kas3 = Paragraphe('folder-caterpillar.png', '{APP_KAS3}', '{KAS3_TEXT}', 'javascript:Loadjs("kas.group.rules.php?ajax=yes")', null, 210, null, 0, true); $kas3_bad = Paragraphe('folder-caterpillar-grey.png', '{APP_KAS3}', '{feature_disabled}', null, null, 210, null, 0, true); if ($users->kas_installed) { if ($users->KasxFilterEnabled) { $kas = $kas3; } else { $kas = $kas3_bad; } } $trustlocal = Paragraphe("network-connection2.png", '{trust_local}', '{trust_local_text}', "javascript:Loadjs('{$page}?script=trustlocal')", null, 210, 100); $localNetwork = Paragraphe("64-ip-settings.png", '{local_network}', '{local_network_text}', "javascript:Loadjs('{$page}?script=localnetwork')", null, 210, 100); $filterbhavior = Paragraphe("64-milter-behavior.png", '{filter_behavior}', '{filter_behavior_text}', "javascript:Loadjs('{$page}?script=filterbehavior')", null, 210, 100); $notification = Paragraphe("mail4-64.png", '{smtp_notification}', '{notification_text}', "javascript:Loadjs('{$page}?script=notification')", null, 210, 100); $spamassassin = Paragraphe("folder-64-spamassassin-grey.png", '{spamassassin}', '{feature_not_installed}', null, null, 210, 100); $whitelist = Paragraphe("folder-64-spamassassin-grey.png", '{spamassassin}', '{feature_not_installed}', null, null, 210, 100); $pieces_jointes = Paragraphe("pieces-jointes.png", '{filter_extension}', '{filter_extension_text}', "javascript:Loadjs('{$page}?script=filterextension')", null, 210, 100); if ($users->spamassassin_installed) { $spamassassin = Paragraphe("folder-64-spamassassin.png", '{spamassassin}', '{spamassassin_text}', "javascript:Loadjs('{$page}?script=spamassassin')", null, 210, 100); } //$apply=Paragraphe('system-64.png','{apply config}','{APPLY_SETTINGS_AMAVIS}',"javascript:Loadjs('$page?script=apply')",'APPLY_SETTINGS_AMAVIS',210,100); $apply = Buildicon64("DEF_ICO_AMAVIS_RESTART", 210, 100); $prepost = Paragraphe("folder-equerre-64.png", '{postfix_hooking}', '{postfix_hooking_text}', "javascript:Loadjs('{$page}?hooking-js=yes')", 'postfix_hooking_text', 210, 100); $spf = Paragraphe("spf-logo-64.png", '{APP_SPF}', '{APP_SPF_TINY_TEXT}', "javascript:Loadjs('spamassassin.spf.php')", 'APP_SPF_TINY_TEXT', 210, 100); $users = new usersMenus(); if ($users->CLAMD_INSTALLED) { $sanesecurity = Paragraphe('folder-64-denywebistes.png', 'SaneSecurity signatures', '{sanesecurity_text}', "javascript:Loadjs('{$page}?sanesecurity-js=yes')", 'sanesecurity_text', 210, 100); } $html = "\n\t<H5>{global_settings}</H5>\n\t<table>\n\t\t\t<tr>\n\t\t\t<td valign='top' >{$trustlocal}</td>\n\t\t\t<td valign='top' >{$filterbhavior}</td>\n\t\t\t<td valign='top' >{$apply}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t<td valign='top' >{$pieces_jointes}</td>\n\t\t\t<td valign='top'>{$spf}</td>\n\t\t\t<td valign='top' >{$spamassassin}</td>\n\t\t\t</tr>\t\t\t\n\t\t\t<td valign='top'>{$prepost}</td>\n\t\t\t<td valign='top' >{$notification}</td>\n\t\t\t<td valign='top'>{$sanesecurity}</td>\t\t\t\n\t\t\t</tr>\n\t\t\t\n\t</table>\n\t\n\t\n\t"; $tpl = new templates(); if ($noecho == 0) { echo $tpl->_ENGINE_parse_body($html); } else { return $tpl->_ENGINE_parse_body($html, 'postfix.index.php'); } }
function main_config_mimedefang() { $users = new usersMenus(); if (!$users->MIMEDEFANG_INSTALLED) { return null; } $users->LoadModulesEnabled(); if ($users->MimeDefangEnabled != 1) { return null; } $sock = new sockets(); $ini = new Bs_IniHandler(); $ini->loadString($sock->GET_INFO("ArticaPerformancesSettings")); $MX_REQUESTS = $ini->_params["MIMEDEFANG"]["MX_REQUESTS"]; if ($MX_REQUESTS == null) { $MX_REQUESTS = 200; } $MX_MINIMUM = $ini->_params["MIMEDEFANG"]["MX_MINIMUM"]; if ($MX_MINIMUM == null) { $MX_MINIMUM = 2; } $MX_MAXIMUM = $ini->_params["MIMEDEFANG"]["MX_MAXIMUM"]; if ($MX_MAXIMUM == null) { $MX_MAXIMUM = 10; } $MX_MAX_RSS = $ini->_params["MIMEDEFANG"]["MX_MAX_RSS"]; if ($MX_MAX_RSS == null) { $MX_MAX_RSS = 30000; } $MX_MAX_AS = $ini->_params["MIMEDEFANG"]["MX_MAX_AS"]; if ($MX_MAX_AS == null) { $MX_MAX_AS = 90000; } if ($MX_REQUESTS > 900) { $mimedefang_macro = 1; } if ($MX_REQUESTS < 300) { $mimedefang_macro = 2; } if ($MX_REQUESTS < 101) { $mimedefang_macro = 3; } if ($MX_REQUESTS < 60) { $mimedefang_macro = 4; } $arrp = array(0 => '{select}', 1 => "{high}", 2 => "{medium}", 3 => "{low}", 4 => '{very_low}'); $arrp = Field_array_Hash($arrp, 'mimedefang_macro', $mimedefang_macro, "mimedefang_macro()"); $html = "<H5>{mimedefang_consumption}</h5>\n\t<p class=caption>{mimedefang_consumption_text}</p>\n\t\n\t<table style='width:100%'>\n\t\t<tr>\n\t\t<td nowrap width=1% align='right'><strong>{mimedefang_macro}:</strong></td>\n\t\t<td>{$arrp}</td>\t\n\t\t</tr>\n\t</table>\n\t\n<form name=ffmmimedefang>\n<table style='width:100%'>\n<tr>\n\t<td nowrap width=1% align='right'><strong>{MX_REQUESTS}:</strong></td>\n\t<td>" . Field_text('MX_REQUESTS', $MX_REQUESTS, 'width:90px') . "</td>\n\t<td nowrap width=1% align='left'>" . help_icon('{MX_REQUESTS_TEXT}') . "</td>\n</tr>\n<tr>\n\t<td nowrap width=1% align='right'><strong>{MX_MINIMUM}:</strong></td>\n\t<td>" . Field_text('MX_MINIMUM', $MX_MINIMUM, 'width:90px') . "</td>\n\t<td nowrap width=1% align='left'>" . help_icon('{MX_MINIMUM_TEXT}') . "</td>\n</tr>\n<tr>\n\t<td nowrap width=1% align='right'><strong>{MX_MAXIMUM}:</strong></td>\n\t<td>" . Field_text('MX_MAXIMUM', $MX_MAXIMUM, 'width:90px') . "</td>\n\t<td nowrap width=1% align='left'>" . help_icon('{MX_MAXIMUM_TEXT}') . "</td>\n</tr>\n<tr>\n\t<td nowrap width=1% align='right'><strong>{MX_MAX_RSS}:</strong></td>\n\t<td>" . Field_text('MX_MAX_RSS', $MX_MAX_RSS, 'width:90px') . "</td>\n\t<td nowrap width=1% align='left'>" . help_icon('{MX_MAX_RSS_TEXT}') . "</td>\n</tr>\n<tr>\n\t<td nowrap width=1% align='right'><strong>{MX_MAX_AS}:</strong></td>\n\t<td>" . Field_text('MX_MAX_AS', $MX_MAX_AS, 'width:90px') . "</td>\n\t<td nowrap width=1% align='left'>" . help_icon('{MX_MAX_AS_TEXT}') . "</td>\n</tr>\n<tr>\n\t<td colspan=2 align='right'><input type=button OnClick=\"javascript:ParseForm('ffmmimedefang','{$page}',true);\" value='{apply} »'>\n</tr>\n</table>\n</form>\t"; $tpl = new templates(); return "<div style='float:left;margin:4px;width:300px'>" . RoundedLightGrey($tpl->_ENGINE_parse_body($html)) . "</div>"; }
function admin_monitorix() { $md = md5(date('Ymdhis')); $user = new usersMenus(); $table = $user->array_monitorix(); while (list($num, $val) = each($table)) { $html = $html . "<div style='float:left;margin:5px;'><img src='images.listener.php?uri={$val}&md={$md}'></div>"; } $g_system = "\n<div id='g_sys2' style='width:700px;text-align:center'>\n\t\t<H3>{monitorix}</H3>\n\t\t<center>\n\t\t\t{$html}\n\t</center>\n\t</div>\n\n\t\n"; $p = "\n\t<input type='hidden' id='switch' value='{$_GET["main"]}'>\n\t{$g_system}.{$g_postfix}.{$g_squid}"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($p); }
function main_services(){ $sock=new sockets(); $users=new usersMenus(); $users->LoadModulesEnabled(); if($users->DOTCLEAR_INSTALLED){ $dotclear=Paragraphe('64-dotclear.png','{APP_DOTCLEAR}','{APP_DOTCLEAR_TEXT}','dotclear.index.php','APP_DOTCLEAR_TEXT'); } if($users->OBM2_INSTALLED){ $obm2=Paragraphe('64-obm2.png','{APP_OBM2}','{APP_OBM2_TEXT}',"javascript:Loadjs('obm2.index.php')",'APP_OBM2_TEXT'); } if($users->openldap_installed){ $addressbook=Paragraphe("64-addressbook.png","{remote_addressbook}","{remote_addressbook_text}","javascript:AdressBookPopup();"); } if($users->XAPIAN_PHP_INSTALLED){ $instantsearch=Paragraphe("64-xapian.png","{InstantSearch}","{InstantSearch_text}","javascript:Loadjs('instantsearch.php');"); } if($users->OPENGOO_INSTALLED){ $opengoo=Paragraphe("64-opengoo.png","{APP_OPENGOO}","{APP_OPENGOO_TEXT}","javascript:Loadjs('opengoo.php');"); } if($users->phpldapadmin_installed){ $phpldapadmin=Paragraphe('phpldap-admin-64.png','{APP_PHPLDAPADMIN}','{APP_PHPLDAPADMIN_TEXT}',"javascript:s_PopUpFull('ldap/index.php',1024,800);","{artica_events_text}"); } if($users->MLDONKEY_INSTALLED){ $mldonkey=Paragraphe('64-emule.png','{APP_MLDONKEY}','{APP_MLDONKEY_TEXT}',"javascript:Loadjs('mldonkey.php')",""); } if($users->KAV4FS_INSTALLED){ $kav4fs=Paragraphe('bigkav-64.png','{APP_KAV4FS}','{APP_KAV4FS_TEXT}',"javascript:Loadjs('kav4fs.php')",""); } $massmailing=Paragraphe('mass-mailing-64.png','{email_campaigns}','{APP_MASSMAILING_ENABLE_TEXT}',"javascript:Loadjs('system.enable.massmailing.php');","{APP_MASSMAILING_ENABLE_TEXT}"); $userautofill=Paragraphe('member-add-64.png','{auto_account}','{auto_account_text}',"javascript:Loadjs('auto-account.php?script=yes')",'auto_account_text'); $installed_applis=Paragraphe('folder-applications-64.jpg','{installed_applications}','{installed_applications_text}','system.applications.php','installed_applications_text'); $add_remove=Paragraphe('add-remove-64.png','{application_setup}','{application_setup_txt}',"javascript:Loadjs('setup.index.php?js=yes')"); $services=Paragraphe('folder-servicesm-64.jpg','{manage_services}','{manage_services_text}','javascript:Loadjs("admin.index.services.status.php?js=yes");','manage_services_text'); if($users->BACKUPPC_INSTALLED){ $backuppc=Paragraphe('backuppc-64.png','{APP_BACKUPPC}','{APP_BACKUPPC_TEXT}',"javascript:Loadjs('backup-pc.index.php');",'APP_BACKUPPC_TEXT'); } if($users->OCSI_INSTALLED){ $ocs=Paragraphe('64-ocs.png','{APP_OCSI}','{APP_OCSI_TEXT}',"javascript:Loadjs('ocs.ng.php');",'APP_OCSI_TEXT'); } if($users->OCS_LNX_AGENT_INSTALLED){ $ocsAgent=Paragraphe('64-ocs.png','{APP_OCSI_LINUX_CLIENT}','{APP_OCSI_LINUX_CLIENT_TEXT}',"javascript:Loadjs('ocs.agent.php');",'APP_OCSI_LINUX_CLIENT_TEXT'); } if($users->APP_AUDITD_INSTALLED){ $auditd=Paragraphe('folder-watch-64.png','{APP_AUDITD}','{APP_AUDITD_TEXT}',"javascript:Loadjs('auditd.php');",'APP_AUDITD_TEXT'); } if($users->DROPBOX_INSTALLED){ $dropbox=Paragraphe('dropbox-64.png','{APP_DROPBOX}','{APP_DROPBOX_TEXT}',"javascript:Loadjs('samba.dropbox.php')",null,210,null,0,false); } if($users->APACHE_INSTALLED){ $apache=Paragraphe('apache-groupeware-64.png','{APP_GROUPWARE_APACHE}','{APP_GROUPWARE_APACHE_TEXT}',"javascript:Loadjs('apache-groupware.php')",null,210,null,0,false); } if($users->CLAMD_INSTALLED){ $clamav=Paragraphe('clamav-64.png','{clamav_protect}','{clamav_protect_disable_text}',"javascript:Loadjs('clamav.enable.php')",null,210,null,0,false); } if($users->APACHE_INSTALLED){ if($users->PUREFTP_INSTALLED){ $free_web=Paragraphe('free-web-64.png','{free_web_servers}','{free_web_servers_text}',"javascript:Loadjs('freeweb.php')",null,210,null,0,false); } } $APP_SABNZBDPLUS=Paragraphe('sab2_64-grey.png','{APP_SABNZBDPLUS}','{APP_SABNZBDPLUS_TEXT}',"",null,210,null,0,false); if($users->APP_SABNZBDPLUS_INSTALLED){ $APP_SABNZBDPLUS=Paragraphe('sab2_64.png','{APP_SABNZBDPLUS}','{APP_SABNZBDPLUS_TEXT}',"javascript:Loadjs('sabnzbdplus.php')",null,210,null,0,false); } $metaconsole=Paragraphe("artica-meta-64.png","{meta-console}","{meta-console-text}","javascript:Loadjs('artica.meta.php')",null,210,null,0,false); if($users->LXC_INSTALLED){ $LXC=Paragraphe('64-computer-alias.png','{APP_LXC}','{APP_LXC_TEXT}',"javascript:Loadjs('lxc.index.php')",null,210,null,0,false); } if($users->KASPERSKY_WEB_APPLIANCE){ $addressbook=null; $userautofill=null; $massmailing=null; $APP_SABNZBDPLUS=null; } //ApacheGroupware $tr[]=$add_remove; $tr[]=$services; $tr[]=$metaconsole; $tr[]=$backuppc; $tr[]=$auditd; $tr[]=$phpldapadmin; $tr[]=$apache; $tr[]=$free_web; $tr[]=$clamav; $tr[]=$mldonkey; $tr[]=$massmailing; $tr[]=$addressbook; $tr[]=$userautofill; $tr[]=$obm2; $tr[]=$dotclear; $tr[]=$kav4fs; $tr[]=$ocs; $tr[]=$ocsAgent; $tr[]=$dropbox; $tr[]=$LXC; $tr[]=$APP_SABNZBDPLUS; $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 kaspersky(){ $users=new usersMenus(); if(!$users->POSTFIX_INSTALLED){return false;} $users->LoadModulesEnabled(); $page=CurrentPageName(); if($users->kas_installed OR $users->KAV_MILTER_INSTALLED){ return LocalParagraphe("enable_kaspersky","enable_kaspersky_text","Loadjs('configure.server.php?script=enable_kasper')","bigkav24.png"); } }
function ajax_pop() { $sock = new sockets(); $users = new usersMenus(); $users->LoadModulesEnabled(); $EnableAmavisDaemon = $users->EnableAmavisDaemon; if (!$users->AMAVIS_INSTALLED) { $EnableAmavisDaemon = 0; } if (!is_numeric($EnableAmavisDaemon)) { $EnableAmavisDaemon = 0; } $EnableArticaPolicyFilter = $sock->GET_INFO("EnableArticaPolicyFilter"); $EnableArticaPolicyFilter = 0; if (!is_numeric($EnableArticaPolicyFilter)) { $EnableArticaPolicyFilter = 0; } $ArticaPolicyFilterMaxRCPTInternalDomainsOnly = $sock->GET_INFO("ArticaPolicyFilterMaxRCPTInternalDomainsOnly"); $SpamassassinMaxRCPTScore = $sock->GET_INFO("SpamassassinMaxRCPTScore"); $page = CurrentPageName(); $main = new main_cf(); $main->FillDefaults(); $message_size_limit = $sock->GET_INFO("message_size_limit"); $main->main_array["default_destination_recipient_limit"] = $sock->GET_INFO("default_destination_recipient_limit"); $main->main_array["smtpd_recipient_limit"] = $sock->GET_INFO("smtpd_recipient_limit"); $main->main_array["mime_nesting_limit"] = $sock->GET_INFO("mime_nesting_limit"); $PostfixNotifyMessagesRestrictions = $sock->GET_INFO("PostfixNotifyMessagesRestrictions"); $main = new maincf_multi("master", "master"); $header_address_token_limit = $sock->GET_INFO("header_address_token_limit"); $header_size_limit = $sock->GET_INFO("header_size_limit"); $max_rcpt_to = $main->GET("max_rcpt_to"); if (!is_numeric($message_size_limit)) { $message_size_limit = 10240000; } $main->main_array["virtual_mailbox_limit"] = $sock->GET_INFO("virtual_mailbox_limit"); $message_size_limit = $message_size_limit / 1024 / 1000; $main->main_array["virtual_mailbox_limit"] = $main->main_array["virtual_mailbox_limit"] / 1024 / 1000; if (!is_numeric($header_address_token_limit)) { $header_address_token_limit = 10240; } if (!is_numeric($header_size_limit)) { $header_size_limit = 102400; } if (!is_numeric($max_rcpt_to)) { $max_rcpt_to = 0; } if (!is_numeric($PostfixNotifyMessagesRestrictions)) { $PostfixNotifyMessagesRestrictions = 0; } $header_size_limit = $header_size_limit / 1024; if (!is_numeric($SpamassassinMaxRCPTScore)) { $SpamassassinMaxRCPTScore = 10; } $html = "\n\t\t\n\t\t<div id='messages_restriction_id'>\n\t\t\n\t\t\n\n\t\n\n\n\t\t<div style='font-size:16px'><strong>{max_rcpt_to}</strong></div>\n\t\t<table class=form style='width:99%'>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{max_rcpt_to}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('max_rcpt_to', $max_rcpt_to, 'width:60px;font-size:13px;padding:3px;text-align:right') . " {recipients} </td>\n\t\t\t<td>" . help_icon('{max_rcpt_to_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{max_rcpt_to_onlyForLocalDomains}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_checkbox("ArticaPolicyFilterMaxRCPTInternalDomainsOnly", 1, $ArticaPolicyFilterMaxRCPTInternalDomainsOnly, "ArticaPolicyFilterMaxRCPTInternalDomainsOnlySave()") . "</td>\n\t\t\t<td>" . help_icon('{max_rcpt_to_onlyForLocalDomains_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{score}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('SpamassassinMaxRCPTScore', $SpamassassinMaxRCPTScore, 'width:40px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t\t<td>" . help_icon('{SpamassassinMaxRCPTScore_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t<td colspan=3 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t\t" . button("{apply}", "SaveMessagesRestrictions()") . "</td>\n\t\t</tr>\n\t\t</table>\t\t\t\t\t\t\t\t\t\n\t\t\n\t\t<div style='font-size:16px'><strong>{restrictions}</strong></div>\n\t\t<table class=form style='width:99%'>\n\n\t\t\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{message_size_limit}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('message_size_limit', $message_size_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . " MB</td>\n\t\t\t<td>" . help_icon('{message_size_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{virtual_mailbox_limit}</strong>:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('virtual_mailbox_limit', $main->main_array["virtual_mailbox_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . " MB </td>\n\t\t\t<td>" . help_icon('{virtual_mailbox_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{mime_nesting_limit}</strong>:</td>\n\t\t\t<td>" . Field_text('mime_nesting_limit', $main->main_array["mime_nesting_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . " </td>\n\t\t\t<td>" . help_icon('{mime_nesting_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{header_address_token_limit_field}</strong>:</td>\n\t\t\t<td>" . Field_text('header_address_token_limit', $header_address_token_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . " </td>\n\t\t\t<td>" . help_icon('{header_address_token_limit_explain}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{header_size_limit}:</td>\n\t\t\t<td style='font-size:13px'>" . Field_text('header_size_limit', $header_size_limit, 'width:60px;font-size:13px;padding:3px;text-align:right') . " KB </td>\n\t\t\t<td>" . help_icon('{header_size_limit_text}') . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td nowrap class=legend style='font-size:13px'>{notify}:</td>\n\t\t\t<td style='font-size:13px'>" . Field_checkbox("PostfixNotifyMessagesRestrictions", 1, $PostfixNotifyMessagesRestrictions, "PostfixNotifyMessagesRestrictionsSave()") . "</td>\n\t\t\t<td>" . help_icon('{PostfixNotifyMessagesRestrictions_text}') . "</td>\n\t\t</tr>\n\t<tr>\n\t<td colspan=3 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t" . button("{apply}", "SaveMessagesRestrictions()") . "</td>\n\t</tr>\t\t\n\t\t</table>\n\t\t\n\t\t\n\t<div style='font-size:16px'><strong>{performances}</strong></div>\n\t<table class=form style='width:99%'>\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:13px'>{default_destination_recipient_limit}</strong>:</td>\n\t\t<td>" . Field_text('default_destination_recipient_limit', $main->main_array["default_destination_recipient_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t<td>" . help_icon('{default_destination_recipient_limit_text}') . "</td>\n\t</tr>\n\t\n\t<tr>\n\t\t<td nowrap class=legend style='font-size:13px'>{smtpd_recipient_limit}</strong>:</td>\n\t\t<td>" . Field_text('smtpd_recipient_limit', $main->main_array["smtpd_recipient_limit"], 'width:60px;font-size:13px;padding:3px;text-align:right') . "</td>\n\t\t<td>" . help_icon('{smtpd_recipient_limit_text}') . "</td>\n\t</tr>\n\n\n\n\t<tr>\n\t<td colspan=3 align='rigth' style='padding-right:10px;text-align:right'>\n\t\t" . button("{apply}", "SaveMessagesRestrictions()") . "</td>\n\t</tr>\n\t</table>\n\t</div>\n\t<script>\nvar x_SaveMessagesRestrictions=function (obj) {\n\ttempvalue=obj.responseText;\n\tYahooWinSHide();\n }\t\n\t\nfunction SaveMessagesRestrictions(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('header_size_limit',document.getElementById('header_size_limit').value);\n\tXHR.appendData('message_size_limit',document.getElementById('message_size_limit').value);\n\tXHR.appendData('default_destination_recipient_limit',document.getElementById('default_destination_recipient_limit').value);\n\tXHR.appendData('smtpd_recipient_limit',document.getElementById('smtpd_recipient_limit').value);\n\tXHR.appendData('mime_nesting_limit',document.getElementById('mime_nesting_limit').value);\n\tXHR.appendData('header_address_token_limit',document.getElementById('header_address_token_limit').value);\n\tXHR.appendData('virtual_mailbox_limit',document.getElementById('virtual_mailbox_limit').value);\n\tXHR.appendData('max_rcpt_to',document.getElementById('max_rcpt_to').value);\n\tXHR.appendData('SpamassassinMaxRCPTScore',document.getElementById('SpamassassinMaxRCPTScore').value);\n\t\n\t\n\t\n\tdocument.getElementById('messages_restriction_id').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';\n\tXHR.sendAndLoad('{$page}', 'GET',x_SaveMessagesRestrictions);\n}\t\n\nfunction PostfixNotifyMessagesRestrictionsSave(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('PostfixNotifyMessagesRestrictions').checked){\n\t\tXHR.appendData('PostfixNotifyMessagesRestrictions',1);\n\t}else{\n\t\tXHR.appendData('PostfixNotifyMessagesRestrictions',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'GET');\n}\n\nfunction ArticaPolicyFilterMaxRCPTInternalDomainsOnlySave(){\n\tvar XHR = new XHRConnection();\n\tif(document.getElementById('ArticaPolicyFilterMaxRCPTInternalDomainsOnly').checked){\n\t\tXHR.appendData('ArticaPolicyFilterMaxRCPTInternalDomainsOnly',1);\n\t}else{\n\t\tXHR.appendData('ArticaPolicyFilterMaxRCPTInternalDomainsOnly',0);\n\t}\n\tXHR.sendAndLoad('{$page}', 'GET');\n}\n\n\nfunction CheckRequiredRestrictionsFields(){\n\tvar EnableArticaPolicyFilter={$EnableAmavisDaemon};\n\tif(EnableArticaPolicyFilter==0){\n\t\tdocument.getElementById('ArticaPolicyFilterMaxRCPTInternalDomainsOnly').disabled=true;\n\t\tdocument.getElementById('SpamassassinMaxRCPTScore').disabled=true;\n\t}\n}\n\n\nCheckRequiredRestrictionsFields();\n</script>\n\t\n\t\n\t"; $tpl = new templates(); echo $tpl->_parse_body($html); }
function SERVICES_STATUS() { if ($_GET["section"] == "index") { INDEX(); exit; } $ini = new Bs_IniHandler(); $sock = new sockets(); $GLOBALS["ArticaWatchDogList"] = unserialize(base64_decode($sock->GET_INFO("ArticaWatchDogList"))); $users = new usersMenus(); $users->LoadModulesEnabled(); if ($_GET["section"] == null) { $_GET["section"] = "artica_services"; } //echo($sock->getfile('daemons_status')); $table_header = "<tr>\n\t\t<th width=1% style='{$style1}{$style2}'> </td>\n\t\t<th nowrap>{daemon}</td>\n\t\t<th nowrap> </td>\n\t\t<th width=1% nowrap>{memory}</td>\n\t\t<th width=1% nowrap>{virtual_memory}</td>\n\t\t<th width=1%>{version}</td>\n\t\t<th nowrap >{uptime}</td>\n\t\t</tr>"; $inifile = dirname(__FILE__) . "/ressources/logs/global.status.ini"; $ini->loadFile($inifile); if ($_GET["section"] == "artica_services") { $html = "\n\t\t\t<div style='heigth:550px;overflow:auto'>\n\t\t\t<table style='width:98%;margin:0px;padding:5px;'>{$table_header}"; if ($users->VMWARE_HOST) { if ($users->VMWARE_TOOLS_INSTALLED) { $html = $html . BuildRow($users, $ini->_params["APP_VMTOOLS"], "{APP_VMTOOLS}"); } } if ($users->VIRTUALBOX_HOST) { if ($users->APP_VBOXADDINTION_INSTALLED) { $html = $html . BuildRow($users, $ini->_params["APP_VBOXADDITIONS"], "{APP_VBOXADDITIONS}"); } } $html = $html . BuildRow($users, $ini->_params["ARTICA"], "{APP_ARTICA}"); $html = $html . BuildRow($users, $ini->_params["APP_ARTICA_NOTIFIER"], "{APP_ARTICA_NOTIFIER}"); $html = $html . BuildRow($users, $ini->_params["LIGHTTPD"], "{APP_LIGHTTPD}"); $html = $html . BuildRow($users, $ini->_params["ARTICA_WATCHDOG"], "{APP_ARTICA_WATCHDOG}"); $html = $html . BuildRow($users, $ini->_params["APP_ARTICA_STATUS"], "{APP_ARTICA_STATUS}"); $html = $html . BuildRow($users, $ini->_params["APP_ARTICA_EXECUTOR"], "{APP_ARTICA_EXECUTOR}"); $html = $html . BuildRow($users, $ini->_params["APP_ARTICA_BACKGROUND"], "{APP_ARTICA_BACKGROUND}"); $html = $html . BuildRow($users, $ini->_params["APP_SYSLOGER"], "{APP_SYSLOGER}"); $html = $html . BuildRow($users, $ini->_params["SASLAUTHD"], "{APP_SASLAUTHD}"); $html = $html . BuildRow($users, $ini->_params["BOA"], "{APP_BOA}"); $html = $html . BuildRow($users, $ini->_params["FRAMEWORK"], "{APP_FRAMEWORK}"); $html = $html . BuildRow($users, $ini->_params["APP_APACHE_SRC"], "{APP_APACHE_SRC}"); $html = $html . BuildRow($users, $ini->_params["APP_TOMCAT"], "{APP_TOMCAT}"); $html = $html . BuildRow($users, $ini->_params["APP_GROUPWARE_APACHE"], "{APP_GROUPWARE_APACHE}"); $html = $html . BuildRow($users, $ini->_params["LDAP"], "{APP_LDAP}"); $html = $html . BuildRow($users, $ini->_params["ARTICA_MYSQL"], "{APP_MYSQL_ARTICA}"); $html = $html . BuildRow($users, $ini->_params["APP_GREENSQL"], "{APP_GREENSQL}"); $html = $html . BuildRow($users, $ini->_params["APP_PDNS"], "{APP_PDNS}"); $html = $html . BuildRow($users, $ini->_params["APP_PDNS_INSTANCE"], "{APP_PDNS_INSTANCE}"); $html = $html . BuildRow($users, $ini->_params["PDNS_RECURSOR"], "{APP_PDNS_RECURSOR}"); $html = $html . BuildRow($users, $ini->_params["DNSMASQ"], "{APP_DNSMASQ}"); $html = $html . BuildRow($users, $ini->_params["APP_DDCLIENT"], "{APP_DDCLIENT}"); $html = $html . BuildRow($users, $ini->_params["BIND9"], "{APP_BIND9}"); $html = $html . BuildRow($users, $ini->_params["DHCPD"], "{APP_DHCP}"); $html = $html . BuildRow($users, $ini->_params["APP_NSCD"], "{APP_NSCD}"); $html = $html . BuildRow($users, $ini->_params["APP_ARPD"], "{APP_ARPD}"); if (!$users->KASPERSKY_WEB_APPLIANCE) { $html = $html . BuildRow($users, $ini->_params["CLAMAV"], "{APP_CLAMAV}"); $html = $html . BuildRow($users, $ini->_params["FRESHCLAM"], "{APP_FRESHCLAM}"); } $html = $html . BuildRow($users, $ini->_params["APP_SNORT"], "{APP_SNORT}"); while (list($key, $array) = each($ini->_params)) { if (preg_match("#APP_SNORT:(.+)#", $key, $re)) { $html = $html . BuildRow($users, $ini->_params[$key], "{APP_SNORT}", $re[1]); } } reset($ini->_params); $html = $html . BuildRow($users, $ini->_params["APP_KAV4FS"], "{APP_KAV4FS}"); $html = $html . BuildRow($users, $ini->_params["APP_KAV4FS_AVS"], "{APP_KAV4FS_AVS}"); $html = $html . BuildRow($users, $ini->_params["APP_OCSI"], "{APP_OCSI}"); $html = $html . BuildRow($users, $ini->_params["APP_OCSI_DOWNLOAD"], "{APP_OCSI_DOWNLOAD}"); $html = $html . BuildRow($users, $ini->_params["APP_OCSI_LINUX_CLIENT"], "{APP_OCSI_LINUX_CLIENT}"); $html = $html . BuildRow($users, $ini->_params["KRETRANSLATOR_HTTPD"], "{APP_KRETRANSLATOR_HTTPD}"); $html = $html . BuildRow($users, $ini->_params["SYSLOGNG"], "{APP_SYSLOGNG}"); $html = $html . BuildRow($users, $ini->_params["APP_OPENSSH"], "{APP_OPENSSH}"); $html = $html . BuildRow($users, $ini->_params["APP_ARTICA_AUTH_TAIL"], "{APP_ARTICA_AUTH_TAIL}"); $html = $html . BuildRow($users, $ini->_params["COLLECTD"], "{APP_COLLECTD}"); $html = $html . BuildRow($users, $ini->_params["SMARTD"], "{APP_SMARTMONTOOLS}"); $html = $html . BuildRow($users, $ini->_params["APP_AUDITD"], "{APP_AUDITD}"); $html = $html . BuildRow($users, $ini->_params["APP_VNSTAT"], "{APP_VNSTAT}"); $html = $html . BuildRow($users, $ini->_params["APP_ZABBIX_SERVER"], "{APP_ZABBIX_SERVER}"); $html = $html . BuildRow($users, $ini->_params["APP_ZABBIX_AGENT"], "{APP_ZABBIX_AGENT}"); $html = $html . BuildRow($users, $ini->_params["IPTABLES"], "{APP_IPTABLES}"); $html = $html . BuildRow($users, $ini->_params["APP_AMACHI"], "{APP_AMACHI}"); $html = $html . BuildRow($users, $ini->_params["NTPD"], "{APP_NTPD}"); $html = $html . BuildRow($users, $ini->_params["APP_AUTOFS"], "{APP_AUTOFS}"); $html = $html . BuildRow($users, $ini->_params["APP_NFS"], "{APP_NFS}"); $html = $html . BuildRow($users, $ini->_params["PRELOAD"], "{APP_PRELOAD}"); $html = $html . BuildRow($users, $ini->_params["CONSOLEKIT"], "{APP_CONSOLEKIT}"); $html = $html . BuildRow($users, $ini->_params["GDM"], "{APP_GDM}"); $html = $html . BuildRow($users, $ini->_params["XFCE"], "{APP_XFCE}"); $html = $html . BuildRow($users, $ini->_params["INETD"], "{APP_INETD}"); $html = $html . BuildRow($users, $ini->_params["APP_RSYNC"], "{APP_RSYNC}"); $html = $html . BuildRow($users, $ini->_params["OBM2"], "{APP_OBM2}"); $html = $html . BuildRow($users, $ini->_params["DOTCLEAR"], "{APP_DOTCLEAR}"); $html = $html . BuildRow($users, $ini->_params["PUREFTPD"], "{APP_PUREFTPD}"); $html = $html . BuildRow($users, $ini->_params["APP_MLDONKEY"], "{APP_MLDONKEY}"); $html = $html . BuildRow($users, $ini->_params["APP_DROPBOX"], "{APP_DROPBOX}"); $html = $html . BuildRow($users, $ini->_params["APP_SABNZBDPLUS"], "{APP_SABNZBDPLUS}"); $html = $html . "</table></div>"; $html_A = $html; } if ($_GET["section"] == "postfix_services") { if ($users->POSTFIX_INSTALLED) { $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance"); $html = "\n\t\t\t\t<div style='heigth:550px;overflow:auto'>\n\t\t\t\t<table style='width:98%;margin:0px;padding:5px;'>{$table_header}"; $html = $html . BuildRow($users, $ini->_params["POSTFIX"], "{APP_POSTFIX}"); if ($EnablePostfixMultiInstance == 1) { reset($ini->_params); while (list($key, $array) = each($ini->_params)) { if (preg_match("#POSTFIX-MULTI-(.+)#", $key, $re)) { $html = $html . BuildRow($users, $ini->_params["{$key}"], "{APP_POSTFIX}", $re[1]); } if (preg_match("#APP_CROSSROADS:(.+)#", $key, $re)) { $html = $html . BuildRow($users, $ini->_params["{$key}"], "{APP_CROSSROADS}", $re[1]); } } } reset($ini->_params); while (list($key, $array) = each($ini->_params)) { if (preg_match("#APP_POSTFWD2:(.+)#", $key, $re)) { $html = $html . BuildRow($users, $ini->_params[$key], "{APP_POSTFWD2}", $re[1]); } } reset($ini->_params); $html = $html . BuildRow($users, $ini->_params["APP_CROSSROADS"], "{APP_CROSSROADS}"); $html = $html . BuildRow($users, $ini->_params["ARTICA_MYSQMAIL"], "{APP_ARTICA_MYSQMAIL}"); $html = $html . BuildRow($users, $ini->_params["APP_POSTFILTER"], "{APP_POSTFILTER}"); $html = $html . BuildRow($users, $ini->_params["JCHECKMAIL"], "{APP_JCHECKMAIL}"); $html = $html . BuildRow($users, $ini->_params["MILTER_GREYLIST"], "{APP_MILTERGREYLIST}"); $html = $html . BuildRow($users, $ini->_params["ASSP"], "{APP_ASSP}"); $html = $html . BuildRow($users, $ini->_params["AMAVISD"], "{APP_AMAVISD_NEW}"); $html = $html . BuildRow($users, $ini->_params["AMAVISD_MILTER"], "{APP_AMAVISD_MILTER}"); $html = $html . BuildRow($users, $ini->_params["APP_CLUEBRINGER"], "{APP_CLUEBRINGER}"); $html = $html . BuildRow($users, $ini->_params["APP_OPENDKIM"], "{APP_OPENDKIM}"); $html = $html . BuildRow($users, $ini->_params["APP_MILTER_DKIM"], "{APP_MILTER_DKIM}"); $html = $html . BuildRow($users, $ini->_params["MAILARCHIVER"], "{APP_MAILARCHIVER}"); $html = $html . BuildRow($users, $ini->_params["DKIM_FILTER"], "{APP_DKIM_FILTER}"); $html = $html . BuildRow($users, $ini->_params["MIMEDEFANG"], "{APP_MIMEDEFANG}"); $html = $html . BuildRow($users, $ini->_params["MIMEDEFANGX"], "{APP_MIMEDEFANGX}"); $html = $html . BuildRow($users, $ini->_params["CLAMAV_MILTER"], "{APP_CLAMAV_MILTER}"); $html = $html . BuildRow($users, $ini->_params["MAILFROMD"], "{APP_MAILFROMD}"); $html = $html . BuildRow($users, $ini->_params["SQLGREY"], "{APP_SQLGREY}"); $html = $html . BuildRow($users, $ini->_params["SPAMASS_MILTER"], "{APP_SPAMASS_MILTER}"); $html = $html . BuildRow($users, $ini->_params["SPAMASSASSIN"], "{APP_SPAMASSASSIN}"); $html = $html . BuildRow($users, $ini->_params["KAVMILTER"], "{APP_KAVMILTER}"); $html = $html . BuildRow($users, $ini->_params["KAS3"], "{APP_KAS3}"); $html = $html . BuildRow($users, $ini->_params["KAS_MILTER"], "{APP_KAS3_MILTER}"); $html = $html . BuildRow($users, $ini->_params["MAILMAN"], "{APP_MAILMAN}"); $html = $html . BuildRow($users, $ini->_params["APP_ARTICA_POLICY"], "{APP_ARTICA_POLICY}"); $html = $html . BuildRow($users, $ini->_params["STUNNEL"], "{APP_STUNNEL}"); $html = $html . "</table></div>"; $html_B = $html; } } if ($_GET["section"] == "squid_services") { if ($users->SQUID_INSTALLED) { $html = "<table style='width:98%;margin:0px;padding:5px;'>{$table_header}"; $html = $html . BuildRow($users, $ini->_params["SQUID"], "{APP_SQUID}"); $html = $html . BuildRow($users, $ini->_params["APP_ARTICA_SQUID_TAIL"], "{APP_ARTICA_SQUID_TAIL}"); $html = $html . BuildRow($users, $ini->_params["APP_SQUID_CLAMAV_TAIL"], "{APP_SQUID_CLAMAV_TAIL}"); $html = $html . BuildRow($users, $ini->_params["KAV4PROXY"], "{APP_KAV4PROXY}"); $html = $html . BuildRow($users, $ini->_params["DANSGUARDIAN"], "{APP_DANSGUARDIAN}"); $html = $html . BuildRow($users, $ini->_params["ARTICA_DANS_TAIL"], "{APP_ARTICA_DANSGUARDIAN_TAIL}"); $html = $html . BuildRow($users, $ini->_params["APP_PROXY_PAC"], "{APP_PROXY_PAC}"); $html = $html . BuildRow($users, $ini->_params["APP_SQUIDGUARD_HTTP"], "{APP_SQUIDGUARD_HTTP}"); $html = $html . BuildRow($users, $ini->_params["APP_ARTICA_SQUIDGUARDTAIL"], "{APP_ARTICA_SQUIDGUARDTAIL}"); $html = $html . BuildRow($users, $ini->_params["APP_UFDBGUARD"], "{APP_UFDBGUARD}"); $html = $html . BuildRow($users, $ini->_params["APP_UFDBGUARD_TAIL"], "{APP_UFDBGUARD_TAIL}"); $html = $html . "</table></div>"; $html_C = $html; } } if ($_GET["section"] == "mail_services") { $html = "\n\t\t<div style='heigth:550px;overflow:auto'>\n\t\t<table style='width:98%;margin:0px;padding:5px;'>{$table_header}"; $html = $html . BuildRow($users, $ini->_params["CYRUSIMAP"], "{APP_CYRUS}"); $html = $html . BuildRow($users, $ini->_params["ROUNDCUBE"], "{APP_ROUNDCUBE}"); $arrayZarafa[] = "APP_ZARAFA"; $arrayZarafa[] = "APP_ZARAFA_GATEWAY"; $arrayZarafa[] = "APP_ZARAFA_SPOOLER"; $arrayZarafa[] = "APP_ZARAFA_WEB"; $arrayZarafa[] = "APP_ZARAFA_MONITOR"; $arrayZarafa[] = "APP_ZARAFA_DAGENT"; $arrayZarafa[] = "APP_ZARAFA_ICAL"; $arrayZarafa[] = "APP_ZARAFA_INDEXER"; $arrayZarafa[] = "APP_ZARAFA_LICENSED"; while (list($num, $ligne) = each($arrayZarafa)) { $html = $html . BuildRow($users, $ini->_params[$ligne], "{{$ligne}}"); } $html = $html . BuildRow($users, $ini->_params["FETCHMAIL"], "{APP_FETCHMAIL}"); $html = $html . BuildRow($users, $ini->_params["FETCHMAIL_LOGGER"], "{APP_FETCHMAIL_LOGGER}"); $html = $html . BuildRow($users, $ini->_params["P3SCAN"], "{APP_P3SCAN}"); $html = $html . BuildRow($users, $ini->_params["OBM_APACHE"], "{APP_OBM_APACHE}"); $html = $html . "</table></div>"; $html_D = $html; } if ($_GET["section"] == "samba_services") { if ($users->SAMBA_INSTALLED) { $html = "\n\t\t\t<div style='heigth:550px;overflow:auto'>\n\t\t\t<table style='width:98%;margin:0px;padding:5px;'>{$table_header}"; $html = $html . BuildRow($users, $ini->_params["SAMBA_SMBD"], "{APP_SAMBA_SMBD}"); $html = $html . BuildRow($users, $ini->_params["SAMBA_NMBD"], "{APP_SAMBA_NMBD}"); $html = $html . BuildRow($users, $ini->_params["SAMBA_WINBIND"], "{APP_SAMBA_WINBIND}"); $html = $html . BuildRow($users, $ini->_params["APP_GREYHOLE"], "{APP_GREYHOLE}"); $html = $html . BuildRow($users, $ini->_params["APP_AUDITD"], "{APP_AUDITD}"); $html = $html . BuildRow($users, $ini->_params["SAMBA_SCANNEDONLY"], "{APP_SCANNED_ONLY}"); $html = $html . BuildRow($users, $ini->_params["KAV4SAMBA"], "{APP_KAV4SAMBA}"); $html = $html . BuildRow($users, $ini->_params["APP_KAV4FS"], "{APP_KAV4FS}"); $html = $html . BuildRow($users, $ini->_params["APP_KAV4FS_AVS"], "{APP_KAV4FS_AVS}"); $html = $html . BuildRow($users, $ini->_params["CUPS"], "{APP_CUPS}"); $html = $html . BuildRow($users, $ini->_params["APP_MLDONKEY"], "{APP_MLDONKEY}"); $html = $html . BuildRow($users, $ini->_params["APP_BACKUPPC"], "{APP_BACKUPPC}"); $html = $html . BuildRow($users, $ini->_params["APP_OCSI"], "{APP_OCSI}"); $html = $html . BuildRow($users, $ini->_params["APP_OCSI_DOWNLOAD"], "{APP_OCSI_DOWNLOAD}"); $html = $html . BuildRow($users, $ini->_params["APP_DROPBOX"], "{APP_DROPBOX}"); $html = $html . BuildRow($users, $ini->_params["APP_OPENSSH"], "{APP_OPENSSH}"); $html = $html . BuildRow($users, $ini->_params["APP_SABNZBDPLUS"], "{APP_SABNZBDPLUS}"); $html = $html . "</table></div>"; $html_F = $html; } } $artica_services = "{$html_A}<br>"; $postfix_services = "{$html_B}<br>"; $mail_services = "{$html_D}<br>"; $samba_services = "{$html_F}<br>"; $squid_services = "{$html_C}<br>"; switch ($_GET["section"]) { case "artica_services": $services = $artica_services; break; case "postfix_services": $services = $postfix_services; break; case "mail_services": $services = $mail_services; break; case "samba_services": $services = $samba_services; break; case "squid_services": $services = $squid_services; break; default: $services = $artica_services; break; } $html_E = "\n\t<input type='hidden' name='service_switch' id='service_switch' value='{$_GET["section"]}'>\n\t</center>\n\t\t{$services}\n\t</center>"; $tpl = new templates(); echo $tpl->_ENGINE_parse_body($html_E); }
function folder_create() { $root = base64_decode($_POST["root"]); $newFolder = $_POST["create-folder"]; $newpath = "{$root}/{$newFolder}"; $newpath = str_replace("//", "/", $newpath); $newpath = strip_path_accents($newpath); $newpath = utf8_encode($newpath); $users = new usersMenus(); if ($users->IfIsAnuser()) { $perms = "&perms=" . base64_encode($_SESSION["uid"]); } $tpl = new templates(); $sock = new sockets(); echo $tpl->javascript_parse_text(base64_decode($sock->getFrameWork("cmd.php?create-folder=" . base64_encode($newpath) . $perms))); }
function DOMAINSLIST_SEARCH() { $ldap = new clladp(); $page = CurrentPageName(); $tpl = new templates(); $ou = $_GET["ou"]; include_once "ressources/class.amavis.inc"; $amavis = new amavis(); $amavis_oui = false; $disclaimer = true; $users = new usersMenus(); $users->LoadModulesEnabled(); if ($users->AMAVIS_INSTALLED) { if ($users->EnableAmavisDaemon == 1) { $amavis_oui = true; } } $POSTFIX_INSTALLED = $users->POSTFIX_INSTALLED; $sock = new sockets(); $disclaimer = IS_DISCLAIMER(); $HashDomains = $ldap->Hash_associated_domains($ou); if ($GLOBALS["VERBOSE"]) { echo count($HashDomains) . " domains for this ou = {$ou}\n"; } $aliases = new AutoAliases($ou); $search = string_to_regex($_POST["query"]); $domainstyle = "font-size:16px"; if (isset($_GET["expand"])) { $domainstyle = "font-size:18px"; } $data = array(); $c = 0; while (list($num, $ligne) = each($HashDomains)) { if ($search != null) { if (!preg_match("#{$search}#", $num)) { continue; } } $c++; $autoalias = " "; $disclaimer_domain = " "; $amavis_infos = " "; $amavis_duplicate = " "; $js = "Loadjs('domains.relay.domains.php?domain={$num}&ou={$ou}&local=yes')"; $delete = imgtootltip("delete-24.png", '{label_delete_transport}', "DeleteInternetDomainInside('{$num}')"); if (strlen($aliases->DomainsArray[$num]) > 0) { $autoalias = "<img src='img/20-check.png'>"; } if ($amavis_oui) { $amavis_infos = imgtootltip("24-parameters.png", "AS -> {$num}", "Loadjs('domains.amavis.php?domain={$num}')"); } if ($amavis->copy_to_domain_array[strtolower($num)]["enable"] == 1) { $amavis_duplicate = "<strong style='font-size:12px'>{$amavis->copy_to_domain_array[strtolower($num)]["duplicate_host"]}:{$amavis->copy_to_domain_array[strtolower($num)]["duplicate_port"]}"; } if ($disclaimer) { $disclaimer_domain = imgtootltip("24-parameters.png", "disclaimer -> {$num}", "Loadjs('domains.disclaimer.php?domain={$num}&ou={$ou}')"); } $autoalias = $tpl->_ENGINE_parse_body($autoalias); $data['rows'][] = array('id' => "dom-{$num}", 'cell' => array("\n\t\t<a href=\"javascript:blur();\" OnClick=\"javascript:{$js}\" style='{$domainstyle};font-weight:bold;text-decoration:underline'>{$num}</span>", "<span style='font-size:14px'>{$autoalias}</span>", "<span style='font-size:14px'>{$amavis_infos}</span>", "<span style='font-size:14px'>{$disclaimer_domain}</span>", "<span style='font-size:14px'>{$amavis_duplicate}</span>", $delete)); } if ($c == 0) { json_error_show("No Internet domain..."); } $data['page'] = 1; $data['total'] = $c; echo json_encode($data); }
function security_postfix(){ $hostname=$_GET["hostname"]; $user=new usersMenus(); $user->LoadModulesEnabled(); $md=md5($hostname); $tpl=new templates(); $sock=new sockets(); $page=CurrentPageName(); $q=new mysql(); $main=new maincf_multi($hostname); $ou=$main->ou; $ou_encoded=base64_encode($ou); $spamass=new spamassassin(); $EnablePostfixMultiInstance=$sock->GET_INFO("EnablePostfixMultiInstance"); $SpamassassinMaxRCPTScore=$sock->GET_INFO("SpamassassinMaxRCPTScore"); if($hostname=="master"){ $message_size_limit=$sock->GET_INFO("message_size_limit"); $max_rcpt_to=$main->GET("max_rcpt_to"); } $stylea="style='font-size:13px;text-decoration:underline;font-weight:bold'"; $GLOBALS["STYLEA"]=$stylea; if(!is_numeric($SpamassassinMaxRCPTScore)){$SpamassassinMaxRCPTScore=10;} if(!is_numeric($message_size_limit)){$message_size_limit=10240000;} if($message_size_limit==0){$message_size_limit="{unlimited}";}else{ $message_size_limit=FormatBytes($message_size_limit/1024); } $js_messagelimit="Loadjs('postfix.messages.restriction.php?script=yes');"; if(!is_numeric($max_rcpt_to)){$max_rcpt_to=0;} if($max_rcpt_to==0){$max_rcpt_to="{unlimited}";} //regex $data=unserialize(base64_decode($main->GET_BIGDATA("header_check"))); $header_content_filters_rules=0; if(is_array($data)){while (list ($num, $ligne) = each ($data)){if($ligne==null){continue;}$header_content_filters_rules++;}} if($header_content_filters_rules==0){$header_content_filters_rules="{no_rules}";}else{$header_content_filters_rules="$header_content_filters_rules {rules}";} $check_client_access=0; $data=unserialize(base64_decode($main->GET_BIGDATA("check_client_access"))); if(is_array($data)){while (list ($num, $ligne) = each ($data)){if($ligne==null){continue;}$check_client_access++;}} if($check_client_access==0){$check_client_access="{no_rules}";}else{$check_client_access="$check_client_access {rules}";} $EnableBodyChecks=$main->GET("EnableBodyChecks"); if(!is_numeric($EnableBodyChecks)){$EnableBodyChecks=0;} $EnableBodyChecks_text="{disabled}"; if($EnableBodyChecks==1){$EnableBodyChecks_text="{enabled}";} $sql="SELECT COUNT(*) as tcount FROM postfix_regex_words WHERE `hostname`='{$_GET["hostname"]}' AND enabled=1"; $ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup")); if($ligne["tcount"]==0){$EnableBodyChecks_rules="{no_rules}";}else{$EnableBodyChecks_rules="{$ligne["tcount"]} {rules}";} $js_iptables="Loadjs('postfix.iptables.php');"; $js_regex="Loadjs('domains.postfix.multi.regex.php?ou=$ou&hostname=$hostname');"; $EnablePostfixAutoBlock=$sock->GET_INFO("EnablePostfixAutoBlock"); if(!is_numeric($EnablePostfixAutoBlock)){$EnablePostfixAutoBlock=0;} $EnablePostfixAutoBlock_text="{disabled}"; if($EnablePostfixAutoBlock==1){$EnablePostfixAutoBlock_text="{enabled}";} $sql="SELECT COUNT(*) AS tcount FROM iptables WHERE local_port=25 AND flux='INPUT' AND disable=0"; $ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup")); if($ligne["tcount"]==0){$PostfixAutoBlock_rules="{no_rules}";}else{$PostfixAutoBlock_rules="{$ligne["tcount"]} {rules}";} $smtpd_client_restrictions_js="Loadjs('postfix.smtpd_client_restrictions.php');"; $EnablePostfixAntispamPack_value=$sock->GET_INFO('EnablePostfixAntispamPack'); $EnableGenericrDNSClients=$sock->GET_INFO("EnableGenericrDNSClients"); $reject_forged_mails=$sock->GET_INFO('reject_forged_mails'); $PostfixHideClientMua=$sock->GET_INFO("PostfixHideClientMua"); $PostfixHideClientMua_js="Loadjs('postfix.hide.headers.php')"; $EnablePostfixInternalDomainsCheck=$sock->GET_INFO('EnablePostfixInternalDomainsCheck'); $RestrictToInternalDomains=$sock->GET_INFO('RestrictToInternalDomains'); $reject_unknown_client_hostname=$sock->GET_INFO('reject_unknown_client_hostname'); $reject_unknown_reverse_client_hostname=$sock->GET_INFO('reject_unknown_reverse_client_hostname'); $reject_unknown_sender_domain=$sock->GET_INFO('reject_unknown_sender_domain'); $reject_invalid_hostname=$sock->GET_INFO('reject_invalid_hostname'); $reject_non_fqdn_sender=$sock->GET_INFO('reject_non_fqdn_sender'); if($reject_unknown_client_hostname==1){$reject_unknown_client_hostname="{enabled}";}else{$reject_unknown_client_hostname="{disabled}";} if($reject_unknown_reverse_client_hostname==1){$reject_unknown_reverse_client_hostname="{enabled}";}else{$reject_unknown_reverse_client_hostname="{disabled}";} if($reject_unknown_sender_domain==1){$reject_unknown_sender_domain="{enabled}";}else{$reject_unknown_sender_domain="{disabled}";} if($reject_invalid_hostname==1){$reject_invalid_hostname="{enabled}";}else{$reject_invalid_hostname="{disabled}";} if($reject_non_fqdn_sender==1){$reject_non_fqdn_sender="{enabled}";}else{$reject_non_fqdn_sender="{disabled}";} if($RestrictToInternalDomains==1){$RestrictToInternalDomains="{enabled}";}else{$RestrictToInternalDomains="{disabled}";} if($PostfixHideClientMua==1){$PostfixHideClientMua="{enabled}";}else{$PostfixHideClientMua="{disabled}";} //Postscreen ------------------------------------------------------------------------------------ $postscreen_js="Loadjs('postscreen.php?hostname=$hostname&ou=$ou');"; $EnablePostScreen=$main->GET("EnablePostScreen"); if(!$user->POSTSCREEN_INSTALLED){$EnablePostScreen=0;} $postscreen_dnsbl_action=$main->GET("postscreen_dnsbl_action"); if($EnablePostScreen==1){$EnablePostScreen="{enabled}";$postscreen_dnsbl_action="$postscreen_dnsbl_action";}else{$EnablePostScreen="{disabled}";$postscreen_dnsbl_action="{disabled}";} $data=unserialize(base64_decode($main->GET_BIGDATA("postscreen_dnsbl_sites"))); $postscreen_dnsbl_count=0; while (list ($num, $ligne) = each ($data)){if($ligne==null){continue;}$postscreen_dnsbl_count++;} if($postscreen_dnsbl_count==0){$postscreen_dnsbl_count="{no_rules}";}else{$postscreen_dnsbl_count="$postscreen_dnsbl_count {rules}";} //milter-greylist {gl_YES-QUICK} ------------------------------------------------------------------------------------ $mgreylist_js="Loadjs('milter.greylist.index.php?js=yes');"; $mgreylist=new milter_greylist(true,$hostname,$ou); $MilterGreyListEnabled=$mgreylist->MilterGreyListEnabled; if(!$user->MILTERGREYLIST_INSTALLED){$MilterGreyListEnabled=0;} $mgreylist_delay="{$mgreylist->main_array["greylist"]} {$mgreylist->main_array["greylist_TIME"]}"; if($MilterGreyListEnabled==1){$MilterGreyListEnabled="{enabled} $mgreylist_delay";}else{$MilterGreyListEnabled="{disabled}";} //Blacklist: ------------------------------------------------------------------------------------ $Blacklist_js="Loadjs('whitelists.admin.php?js=yes')"; $sql="SELECT COUNT(*) as tcount FROM postfix_global_blacklist WHERE enabled=1"; $ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup")); if($ligne["tcount"]==0){$Blacklist_rules="{no_rules}";}else{$Blacklist_rules="{$ligne["tcount"]} {rules}";} //Attachments ------------------------------------------------------------------------------------ $enable_attachment_blocking_postfix=$main->GET("enable_attachment_blocking_postfix"); $attachs_js="Loadjs('domains.edit.attachblocking.ou.php?ou=$ou_encoded&hostname=$hostname');"; if($EnablePostfixMultiInstance){$hostnameq=" AND hostname='$hostname'";} $ou_q=$ou; if($hostname=="master"){$ou_q="_Global";} $sql="SELECT count(*) as tcount FROM smtp_attachments_blocking WHERE ou='$ou_q'$hostnameq"; $ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup")); if($ligne["tcount"]==0){$attachs_rules="{no_rules}";}else{$attachs_rules="{$ligne["tcount"]} {rules}";} if($enable_attachment_blocking_postfix==1){$enable_attachment_blocking_postfix="{enabled}";}else{$enable_attachment_blocking_postfix="{disabled}";} //Kas3 ------------------------------------------------------------------------------------ $ou_kas=$ou; if($hostname=="master"){$ou_q=base64_encode("default");$ou_kas="default";} $kas_js="Loadjs('domains.edit.kas.php?ou=$ou_q');"; $kas=new kas_mysql($ou_kas); $KasxFilterEnabled=$sock->GET_INFO("KasxFilterEnabled"); $OPT_FILTRATION_ON=$kas->GET_KEY("OPT_FILTRATION_ON"); $OPT_PROBABLE_SPAM_ON=$kas->GET_KEY("OPT_PROBABLE_SPAM_ON"); $ACTION_SPAM_MODE=$kas->GET_KEY("ACTION_SPAM_MODE"); $ACTION_PROBABLE_MODE=$kas->GET_KEY("ACTION_PROBABLE_MODE"); if(!$user->kas_installed){$KasxFilterEnabled=0;} if($KasxFilterEnabled==0){$OPT_FILTRATION_ON=0;$OPT_PROBABLE_SPAM_ON=0;} $OPT_SPAM_RATE_LIMIT=$kas->GET_KEY("OPT_SPAM_RATE_LIMIT"); $OPT_SPAM_RATE_LIMIT_TABLE=array(4=>"{maximum}",3=>"{high}",2=>"{normal}",1=>"{minimum}"); if(!is_numeric($OPT_SPAM_RATE_LIMIT)){$OPT_SPAM_RATE_LIMIT=3;} if($OPT_FILTRATION_ON==1){$kas_text="{level}:{$OPT_SPAM_RATE_LIMIT_TABLE[$OPT_SPAM_RATE_LIMIT]}";}else{$kas_text="{disabled}";$ACTION_SPAM_MODE=-4;$ACTION_PROBABLE_MODE=-4;} if($OPT_PROBABLE_SPAM_ON==1){$kas_probable="{enabled}";}else{$kas_probable="{disabled}";} $kas_action_message=array(0=>"{acceptmessage}",1=>"{kassendcopy}",2=>"{quarantine}",-1=>"{kasreject}",-3=>"{kasdelete}",-4=>"{disabled}"); $ACTION_SPAM_MODE=$kas_action_message[$ACTION_SPAM_MODE]; $ACTION_PROBABLE_MODE=$kas_action_message[$ACTION_PROBABLE_MODE]; //Amavis - spamassassin $EnableAmavisDaemon=$user->EnableAmavisDaemon; if(!$user->AMAVIS_INSTALLED){$EnableAmavisDaemon=0;} $amavis_js="Loadjs('amavis.index.php?ajax=yes');"; if($EnablePostfixMultiInstance){$hostnameq=" AND hostname='$hostname'";} $ou_q=$ou; if($hostname=="master"){$ou_q="_Global";} $sql="SELECT count(*) as tcount FROM smtp_attachments_blocking WHERE ou='$ou_q'$hostnameq"; $ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup")); if($ligne["tcount"]==0){$amavis_attachs_rules="{no_rules}";}else{$amavis_attachs_rules="{$ligne["tcount"]} {rules}";} if($EnableAmavisDaemon==0){$EnableAmavisDaemon_text="{disabled}";}else{$EnableAmavisDaemon_text="{enabled}";} //Spamassassin - keywords $sql="SELECT count(*) as tcount FROM spamassassin_keywords WHERE enabled=1 and score>0"; $ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup")); if($ligne["tcount"]==0){$spamassassin_keywords="$EnableAmavisDaemon_text {no_rules}";}else{$spamassassin_keywords="$EnableAmavisDaemon_text {$ligne["tcount"]} {rules}";} $spamassassin_keywords_js="Loadjs('spamassassin.keywords.php');"; //spamassassin_backscatter $spamassassin_backscatter_js="Loadjs('spamassassin.backscatter.php');"; $spamassassin_backscatter=$sock->GET_INFO("SpamAssassinVirusBounceEnabled"); if($EnableAmavisDaemon==0){$spamassassin_backscatter=0;} if($spamassassin_backscatter==0){$spamassassin_backscatter="{disabled}";}else{$spamassassin_backscatter="{enabled}";} $DecodeShortURLs_js="Loadjs('spamassassin.DecodeShortURLs.php');"; $sql="SELECT COUNT(*) as tcount FROM spamassassin_table WHERE spam_type='DecodeShortURLs' AND enabled=1"; $ligne=mysql_fetch_array($q->QUERY_SQL($sql,"artica_backup")); if($ligne["tcount"]==0){$DecodeShortURLs="$EnableAmavisDaemon_text {no_rules}";}else{$DecodeShortURLs="$EnableAmavisDaemon_text {$ligne["tcount"]} {rules}";} //plugins, wrongx, pyzor,razor... $spamassassin_js="Loadjs('spamassassin.index.php')"; $EnableSpamassassinWrongMX=$sock->GET_INFO("EnableSpamassassinWrongMX"); if(!is_numeric($EnableSpamassassinWrongMX)){$EnableSpamassassinWrongMX=1;} if($EnableAmavisDaemon==0){$EnableSpamassassinWrongMX=0;} if($EnableSpamassassinWrongMX==0){$EnableSpamassassinWrongMX="{disabled}";}else{$EnableSpamassassinWrongMX="{enabled}";} $use_razor2=$spamass->main_array["use_razor2"]; if($EnableAmavisDaemon==0){$use_razor2=0;} if($use_razor2==0){$use_razor2="{disabled}";}else{$use_razor2="{enabled}";} $use_pyzor=$spamass->main_array["use_pyzor"]; if($EnableAmavisDaemon==0){$use_pyzor=0;} if($use_pyzor==0){$use_pyzor="{disabled}";}else{$use_pyzor="{enabled}";} $amavis=new amavis(); $amavis_action1="{pass}"; $amavis_action2="{pass}"; $amavis_spam="$EnableAmavisDaemon_text {score} >={$amavis->main_array["BEHAVIORS"]["sa_tag3_level_deflt"]}"; if($amavis->EnableQuarantineSpammy2==1){$amavis_action1="{quarantine}";} $amavis_probable="$EnableAmavisDaemon_text {score} >={$amavis->main_array["BEHAVIORS"]["sa_tag2_level_deflt"]}"; if($amavis->EnableQuarantineSpammy==1){$amavis_action2="{quarantine}";} $clamav_unofficial_js="Loadjs('clamav.unofficial.php')"; $html=" <div style='text-align:right'>". imgtootltip("refresh-24.png","{refresh}","RefreshTab('main_config_postfix_synthesis_$md')")."</div> <H3 style='font-size:16px'>{APP_POSTFIX} » {filters_connect}</h3> <table style='width:665px' class=form> <tr> <td class=legend width='350px'>{postfix_autoblock}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_iptables\" $stylea>$EnablePostfixAutoBlock_text $PostfixAutoBlock_rules</a></td> <td width=1% nowrap><strong style='font-size:13px'>{firewall}</td> </tr> <tr> <td class=legend width='350px'>{black list}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$Blacklist_js\" $stylea>$Blacklist_rules</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>PostScreen:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$postscreen_js\" $stylea>$EnablePostScreen</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>PostScreen RBL:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$postscreen_js\" $stylea>$postscreen_dnsbl_action $postscreen_dnsbl_count</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>{blockips}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_regex\" $stylea>$check_client_access</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>{reject_unknown_client_hostname}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_unknown_client_hostname</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>{reject_unknown_reverse_client_hostname}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_unknown_reverse_client_hostname</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>{reject_unknown_sender_domain}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_unknown_sender_domain</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>{reject_invalid_hostname}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_invalid_hostname</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>{reject_non_fqdn_sender}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$reject_non_fqdn_sender</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>{RestrictToInternalDomains}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$smtpd_client_restrictions_js\" $stylea>$RestrictToInternalDomains</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> </table> <H3 style='font-size:16px'>{filters_connect}</h3> <table style='width:665px' class=form> <tr> <td class=legend width='350px'>{gl_YES-QUICK}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$mgreylist_js\" $stylea>$MilterGreyListEnabled</a></td> <td width=1% nowrap><strong style='font-size:13px'>{delayed}</td> </tr> </table> <H3 style='font-size:16px'>{APP_POSTFIX} » {messages_restriction}</h3> <table style='width:665px' class=form> ". _MaxRcptTO($hostname)." <tr> <td class=legend width='350px'>{message_size_limit}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_messagelimit\" $stylea>$message_size_limit</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>{HIDE_CLIENT_MUA}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$PostfixHideClientMua_js\" $stylea>$PostfixHideClientMua</a></td> <td width=1% nowrap><strong style='font-size:13px'>{pass}</td> </tr> </table> <H3 style='font-size:16px'>{APP_POSTFIX} » {content_filters}</h3> <table style='width:665px' class=form> <tr> <td class=legend width='350px'>{header_content_filters_rules}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_regex\" $stylea>$header_content_filters_rules</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>{RegexSimpleWords}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$js_regex\" $stylea>$EnableBodyChecks_text $EnableBodyChecks_rules</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> <tr> <td class=legend width='350px'>{attachment_blocking}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$attachs_js\" $stylea>$enable_attachment_blocking_postfix $attachs_rules</a></td> <td width=1% nowrap><strong style='font-size:13px'>{reject}</td> </tr> </table> <H3 style='font-size:16px'>{content_filters} » {APP_KAS3}</h3> <table style='width:665px' class=form> <tr> <td class=legend width='350px'>{APP_KAS3}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$kas_text</a></td> <td width=1% nowrap><strong style='font-size:13px'> </td> </tr> <tr> <td class=legend width='350px'>{OPT_PROBABLE_SPAM_ON}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$kas_probable</a></td> <td width=1% nowrap><strong style='font-size:13px'> </td> </tr> <tr> <td class=legend width='350px'>{spam option 2}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$ACTION_PROBABLE_MODE</a></td> <td width=1% nowrap><strong style='font-size:13px'> </td> </tr> <tr> <td class=legend width='350px'>{spam option 1}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$ACTION_SPAM_MODE</a></td> <td width=1% nowrap><strong style='font-size:13px'> </td> </tr> </table> <H3 style='font-size:16px'>{content_filters} » {addons_bundle}</h3> <table style='width:665px' class=form> <tr> <td class=legend width='350px'>{attachment_blocking}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$kas_js\" $stylea>$EnableAmavisDaemon_text $amavis_attachs_rules</a></td> <td width=1% nowrap><strong style='font-size:13px'>{quarantine}</td> </tr> <tr> <td class=legend width='350px'>{block_keywords}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_keywords_js\" $stylea>$spamassassin_keywords</a></td> <td width=1% nowrap><strong style='font-size:13px'>{score}+</td> </tr> <tr> <td class=legend width='350px'>{Virus_Bounce_Ruleset}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_backscatter_js\" $stylea>$spamassassin_backscatter</a></td> <td width=1% nowrap><strong style='font-size:13px'>{score}+</td> </tr> <tr> <td class=legend width='350px'>{DecodeShortURLs}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$DecodeShortURLs_js\" $stylea>$DecodeShortURLs</a></td> <td width=1% nowrap><strong style='font-size:13px'>{score}+</td> </tr> <tr> <td class=legend width='350px'>WrongMX:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_js\" $stylea>$EnableSpamassassinWrongMX</a></td> <td width=1% nowrap><strong style='font-size:13px'>{score}+</td> </tr> <tr> <td class=legend width='350px'>Razor:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_js\" $stylea>$use_razor2</a></td> <td width=1% nowrap><strong style='font-size:13px'>{score}+</td> </tr> <tr> <td class=legend width='350px'>Pyzor:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$spamassassin_js\" $stylea>$use_pyzor</a></td> <td width=1% nowrap><strong style='font-size:13px'>{score}+</td> </tr> <tr> <td class=legend width='350px'>{spam option 2}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$amavis_js\" $stylea>$amavis_probable</a></td> <td width=1% nowrap><strong style='font-size:13px'>$amavis_action2</td> </tr> <tr> <td class=legend width='350px'>{spam option 1}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$amavis_js\" $stylea>$amavis_spam</a></td> <td width=1% nowrap><strong style='font-size:13px'>$amavis_action1</td> </tr> <tr> <td class=legend width='350px'>{APP_CLAMAV}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$amavis_js\" $stylea>$EnableAmavisDaemon_text</a></td> <td width=1% nowrap><strong style='font-size:13px'>{quarantine}</td> </tr> <tr> <td class=legend width='350px'>{clamav_unofficial}:</td> <td width='230px'><a href=\"javascript:blur()\" OnClick=\"javascript:$clamav_unofficial_js\" $stylea>$EnableAmavisDaemon_text</a></td> <td width=1% nowrap><strong style='font-size:13px'>{quarantine}</td> </tr> </table> "; echo $tpl->_ENGINE_parse_body($html); }
function bundle_opensource() { $bundle = true; $firstbg = "bg-coinds-gris-300.png"; $users = new usersMenus(); $users->LoadModulesEnabled(); if (!$users->SPAMASS_MILTER_INSTALLED) { $bundle = false; } if (!$users->CLAMAV_MILTER_INSTALLED) { $bundle = false; } if ($bundle == false) { $firstbg = "bg-coinds-red-300.png"; } else { if ($users->SpamAssMilterEnabled == 1 && $users->ClamavMilterEnabled == 1) { $firstbg = "bg-coinds-green-300.png"; $button = "<input type='button' OnClick=\"javascript:Disable('opensource');\" value='{disable} »'>"; } else { $button = "<input type='button' OnClick=\"javascript:Enable('opensource');\" value='{enable} »'>"; } } $clamav_img = "okdanger32.png"; $text_clamav = "{not_installed}"; $spamass_img = "okdanger32.png"; $spamass_text = "{not_installed}"; if ($users->CLAMAV_MILTER_INSTALLED) { if ($users->ClamavMilterEnabled == 1) { $clamav_img = "ok32.png"; $text_clamav = "{activated}"; } else { $clamav_img = "warning32.png"; $text_clamav = "{disabled}"; } } if ($users->SPAMASS_MILTER_INSTALLED) { if ($users->SpamAssMilterEnabled == 1) { $spamass_img = "ok32.png"; $spamass_text = "{activated}"; } else { $spamass_img = "warning32.png"; $spamass_text = "{disabled}"; } } $text = "\n\t<table style='width:100%;background-color:transparent;background-image:none'>\n\t<tr>\n\t\t<td colspan=2><H3 style='font-size:15px'>{clamspam_bundle}</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{performances}:</td>\n\t\t<td>" . bundle_barre(60) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{functionnalities}:</td>\n\t\t<td>" . bundle_barre(30) . "</td>\n\t</tr>\n\t<tr>\n\t\t<td class=legend>{security}:</td>\n\t\t<td>" . bundle_barre(70) . "</td>\n\t</tr>\t\t\n\t</table>\n\t<br>\n\t<table style='width:100%;background-color:transparent;background-image:none'>\n\t<tr>\n\t\t<td valign='top' width=1%><img src='img/{$clamav_img}'></td>\n\t\t<td valign='middle'><span style='font-size:13px;font-weight:bold'>{APP_CLAMAV_MILTER}</span></td>\n\t\t<td valign='middle'><span style='font-size:13px;font-weight:bold'>{$text_clamav}</span></td>\n\t</tr>\n\t<tr>\n\t\t<td valign='top' width=1%><img src='img/{$spamass_img}'></td>\n\t\t<td valign='middle'><span style='font-size:13px;font-weight:bold'>{APP_SPAMASS_MILTER}</span></td>\n\t\t<td valign='middle'><span style='font-size:13px;font-weight:bold'>{$spamass_text}</span></td>\n\t</tr>\t\n\n\t<tr>\n\t\t<td colspan=3 align='right'>{$button}</td>\n\t</table>\n\t\n\t\n\t<br>\n\t\n\t"; $html = "<div style='width:283px;height:230px;background-repeat:no-repeat;background-image:url(img/{$firstbg});padding:10px;' \n\t\tonmouseover='javascript:this.style.backgroundImage=\"url(img/bg-coinds-blanc-300.png)\"'\n\t\tonmouseout='javascript:this.style.backgroundImage=\"url(img/{$firstbg})\"'\n\t\t>{$text}\n\t\t\n\t\t \n\t\t</div>\n\t\n\t\n\t"; return $html; }
function main_tabs() { if (!isset($_GET["main"])) { $_GET["main"] = "network"; } $users = new usersMenus(); $users->LoadModulesEnabled(); $tpl = new templates(); $sock = new sockets(); $page = CurrentPageName(); $EnablePostfixMultiInstance = $sock->GET_INFO("EnablePostfixMultiInstance"); $ou = $_SESSION["ou"]; if ($users->AsMessagingOrg) { $array["messaging"] = '{emails_received}'; } $array["org"] = $ou; while (list($num, $ligne) = each($array)) { $html[] = $tpl->_ENGINE_parse_body("<li><a href=\"{$page}?{$num}=yes\"><span>{$ligne}</span></li>\n"); } echo "\n\t<div id=main_config_user_panel style='width:100%;height:750px;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_user_panel').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>"; }
function CheckRights() { $users = new usersMenus(); if ($users->IsSuperAdmin()) { return true; } if ($users->AsSambaAdministrator) { return true; } if ($users->AsPostfixAdministrator) { return true; } if ($users->AsMessagingOrg) { return true; } if ($users->AsMailBoxAdministrator) { return true; } if ($users->AsDansGuardianAdministrator) { return true; } return false; }