exit; } } else { if (!PostFixMultiVerifyRights()) { $tpl = new templates(); echo "alert('" . $tpl->javascript_parse_text("{$_GET["hostname"]}::{ERROR_NO_PRIVS}") . "');"; die; exit; } } if (isset($_GET["search"])) { popup_list(); exit; } if (isset($_POST["empty-db"])) { empty_db(); exit; } popup(); function popup() { $page = CurrentPageName(); $tpl = new templates(); $t = time(); $explain = $tpl->_ENGINE_parse_body("{MILTERGREYLIST_STATUSDUMP_TEXT}"); $time = $tpl->_ENGINE_parse_body("{time}"); $ipaddr = $tpl->_ENGINE_parse_body("{ipaddr}"); $from = $tpl->_ENGINE_parse_body("{from}"); $to = $tpl->_ENGINE_parse_body("{to}"); $whitelisted = $tpl->_ENGINE_parse_body("{whitelisted}"); if (!isset($_GET["hostname"])) {
} if (posix_getuid() != 0) { die("Cannot be used in web server mode\n\n"); } $GLOBALS["posix_getuid"] = 0; include_once dirname(__FILE__) . '/ressources/class.users.menus.inc'; include_once dirname(__FILE__) . '/ressources/class.mysql.inc'; include_once dirname(__FILE__) . '/ressources/class.user.inc'; include_once dirname(__FILE__) . '/ressources/class.ini.inc'; include_once dirname(__FILE__) . '/ressources/class.mysql.inc'; include_once dirname(__FILE__) . '/ressources/class.ldap.inc'; include_once dirname(__FILE__) . '/framework/class.unix.inc'; include_once dirname(__FILE__) . '/framework/frame.class.inc'; include_once dirname(__FILE__) . '/framework/class.settings.inc'; if ($argv[1] == "--db") { empty_db($argv[2]); } function empty_db($database) { $GLOBALS["LOGSDB"] = $database; $logFile = "/usr/share/artica-postfix/ressources/logs/web/empty-{$GLOBALS["LOGSDB"]}.txt"; @unlink($logFile); $unix = new unix(); $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . __FUNCTION__ . ".pid"; $pid = @file_get_contents($pidfile); if ($unix->process_exists($pid)) { ouputz("already running PID:{$pid}", __LINE__); return; } $t = time(); @file_put_contents($pidfile, getmypid());