function daemons_status() { $users = new usersMenus(); $artica = new artica_general(); $tpl = new templates(); $ldap = new clladp(); $sql = new mysql(); $status = new status(1); $gd_info = gdinfos(); if ($ldap->ldapFailed == true) { $ldap_error = $ldap->ErrorConnection() . "<br>"; } $all = $status->StatusFailed(); if ($users->collectd_installed) { if ($artica->EnableCollectdDaemon == 1) { $collectd = Paragraphe("64-charts.png", "{collectd_statistics}", "{collectd_statistics_text}", "javascript:YahooWin(790,'collectd.index.php?PopUp=yes')", "services_status_text", 300, 76); } } $interface = new networking(); if (is_array($interface->array_TCP)) { while (list($num, $val) = each($interface->array_TCP)) { $iptext = $iptext . "<div style='font-size:11px'><strong>{nic}:{$num}:<a href='#' OnClick=\"javascript:Loadjs('system.nic.config.php?js=yes')\">{$val}</a></strong></div>"; } } //$manage_services=Paragraphe("folder-tasks2-64.png","{services_status}","{services_status_text}$iptext","admin.index.services.status.php","services_status_text",300,76,1); $services = "\n\t{$collectd}\n\t"; $ini = new Bs_IniHandler(); $sock = new sockets(); $ini->loadString($sock->GET_INFO("SmtpNotificationConfig")); if (trim($ini->_params["SMTP"]["enabled"] == null)) { $js = "javascript:Loadjs('artica.settings.php?ajax-notif=yes')"; $services = Paragraphe('danger64.png', "{smtp_notification_not_saved}", "{smtp_notification_not_saved_text}", "{$js}", "smtp_notification_not_saved", 300, 80); } $sock = new sockets(); $datas = trim($sock->getfile('aptcheck')); if (preg_match('#nb:([0-9]+)\\s+#is', $datas, $re)) { $services = Paragraphe('i64.png', "{upgrade_your_system}", "{$re[1]} {packages_to_upgrade}", "javascript:Loadjs('artica.repositories.php?show=update')", null, 300, 76); } if ($users->POSTFIX_INSTALLED) { if (!$users->POSTFIX_LDAP_COMPLIANCE) { $services = "\n\t\t\t\t\t<table style='width:100%'>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td valign='top' width=1%><img src='img/rouage_off.png'></td>\n\t\t\t\t\t<td valign='top'><a href='#' OnClick=\"javascript:YahooWin(600,'index.remoteinstall.php','Install');\">\n\t\t\t\t\t<H5>{error_postfix_ldap_compliance}</H5><p class=caption>{error_postfix_ldap_compliance_text}\n\t\t\t\t\t</A>\n\t\t\t\t\t</p></td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</table>"; $services = RoundedLightYellow($services); } else { $ok = true; $main = new main_cf(); if (!is_array($main->array_mynetworks)) { $ok = false; } else { while (list($num, $ligne) = each($main->array_mynetworks)) { if ($ligne != "127.0.0.1") { $rr[] = $ligne; } } if (count($rr) == 0) { $ok = false; } } if (!$ok) { $services = "<div id='servinfos'>" . Paragraphe('danger64.png', '{postfix_mynet_not_conf}', '{postfix_mynet_not_conf_text}', "postfix.network.php", null, 300, 73) . "</div>"; } } } if ($users->BadMysqlPassword == 1) { $services = "\n\t<table style='width:100%'>\n\t<tr>\n\t<td valign='top' width=1%><img src='img/superuser-64-bad.png'></td>\n\t<td valign='top'><H5>{error_mysql_user}</H5><p class=caption>{error_mysql_user_text}</p></td>\n\t</tr>\n\t</table>"; $services = RoundedLightGrey($services, "artica.settings.php", 1); } // if (!$users->POSTFIX_INSTALLED) { if ($users->SAMBA_INSTALLED) { $sock = new sockets(); $SambaEnabled = $sock->GET_INFO("SambaEnabled"); if ($SambaEnabled == null) { $SambaEnabled = 1; } if ($SambaEnabled == 1) { $samba = Paragraphe("64-share.png", '{SHARE_FOLDER}', '{SHARE_FOLDER_TEXT}', "javascript:Loadjs('SambaBrowse.php');", "SHARE_FOLDER_TEXT", 300, 76, 1); } } } $newversion = null; if (is_file(dirname(__FILE) . "/ressources/index.ini")) { $ini = new Bs_IniHandler(dirname(__FILE) . "/ressources/index.ini"); $remote_version = $ini->_params["NEXT"]["artica"]; $local_version = $users->ARTICA_VERSION; $remote_version_bin = str_replace('.', '', $remote_version); $local_version_bin = str_replace('.', '', $local_version); if ($local_version < $remote_version) { $newversion = Paragraphe('i64.png', "{upgrade_artica} {$remote_version}", "{upgrade_artica_text}", "javascript:Loadjs('artica.update.php?js=yes')", null, 300, 76); } } $final = "\n\t{$switch}\n\t{$ldap_error}\n\t{$all}\n\t{$pureftp_error}\n\t{$samba}\n\t{$newversion}\n\t{$check_apt}"; file_put_contents('/usr/share/artica-postfix/ressources/logs/status.global.html', $final); system('/bin/chmod 755 /usr/share/artica-postfix/ressources/logs/status.global.html'); }
die; } echo "\n"; events("init status()", "MAIN", __FUNCTION__, __FILE__, __LINE__); $status = new status(1, null, "/var/log/artica-postfix/status-jgrowl.log"); events("init templates()", "MAIN", __FUNCTION__, __FILE__, __LINE__); $tpl = new templates(); events("init usersMenus()", "MAIN", __FUNCTION__, __FILE__, __LINE__); $users = new usersMenus(); $GLOBALS["USERS"] = $users; $GLOBALS["NO_CLAMAV_UPDATE"] = $sock->GET_INFO("jgrowl_no_clamav_update"); $GLOBALS["NO_KAS_UPDATE"] = $sock->GET_INFO("jgrowl_no_kas_update"); events("NO_CLAMAV_UPDATE={$GLOBALS["NO_CLAMAV_UPDATE"]}", "MAIN", __FUNCTION__, __FILE__, __LINE__); events("NO_KAS_UPDATE={$GLOBALS["NO_KAS_UPDATE"]}", "MAIN", __FUNCTION__, __FILE__, __LINE__); events("Running status->StatusFailed(1)", "MAIN", __FUNCTION__, __FILE__, __LINE__); $array = $status->StatusFailed(1); if (!is_file("/etc/artica-postfix/settings/Daemons/HdparmInfos")) { sys_THREAD_COMMAND_SET(LOCATE_PHP5_BIN2() . " /usr/share/artica-postfix/exec.hdparm.php"); } if (count($array) > 2) { while (list($num, $val) = each($array)) { $disable_this_service = $tpl->_ENGINE_parse_body("{disable_this_service_click}"); $add_1[] = $tpl->_ENGINE_parse_body("<li style=color:#C3393E;font-size:10px><strong>{{$val["PRODUCT"]}}</strong></li>"); } $title = $tpl->_ENGINE_parse_body("{TOO_MANY_STOPPED_SERVICES}"); $start_service_in_debug = $tpl->_ENGINE_parse_body("{start_all_failed_services}"); $title = str_replace(" ", " ", $title); $html[] = "\$.jGrowl(\""; $html[] = "<table>"; $html[] = "<tr>"; $html[] = "<td width=1% valign=top>";