function pommo_config() { $q = new mysql(); $sock = new sockets(); $users = new usersMenus(); $unix = new unix(); $PommoFieldlang = $sock->GET_INFO('PommoFieldlang'); if (trim($PommoFieldlang) == null) { $PommoFieldlang = 'en'; } $PommoFieldhostname = $sock->GET_INFO('PommoFieldhostname'); if (trim($PommoFieldhostname) == null) { $PommoFieldhostname = $users->hostname; $sock->SET_INFO("PommoFieldhostname", $PommoFieldhostname); } $lighttpd_port = $unix->LIGHTTPD_PORT(); $t[] = "[db_hostname] = {$q->mysql_server}:{$q->mysql_port}"; $t[] = "[db_username] = {$q->mysql_admin}"; $t[] = "[db_password] = {$q->mysql_password}"; $t[] = "[db_database] = pommo"; $t[] = "[db_prefix] = pommo_"; $t[] = "[lang] = en"; $t[] = "[debug] = off"; $t[] = "[verbosity] = 3"; $t[] = "[date_format] = 3"; $t[] = "[workDir] = \"/usr/share/pommo/cache\""; $t[] = "[baseURL] = \"/mailing/\""; $t[] = "[hostname] ={$PommoFieldhostname}"; $t[] = "[hostport] = {$lighttpd_port}"; @mkdir("/usr/share/pommo/cache", 0777, true); @mkdir("/usr/share/pommo/smarty", 0777, true); @file_put_contents("/usr/share/pommo/config.php", implode("\n", $t)); echo "Starting Pommo...............: Saving configuration done\n"; fix_set_magic_quotes_runtime(); tests_mysql(); }
$unix = new unix(); if (is_file("/usr/share/phpGSB-master/phpgsb.class.php")) { include_once "/usr/share/phpGSB-master/phpgsb.class.php"; if (!isset($GLOBALS["OVHMySQLPass"])) { if (is_file("/etc/artica-postfix/settings/Daemons/OVHMySQLPass")) { $GLOBALS["OVHMySQLPass"] = @file_get_contents("/etc/artica-postfix/settings/Daemons/OVHMySQLPass"); } } if (!isset($GLOBALS["GoogleApiKey"])) { if (is_file("/etc/artica-postfix/settings/Daemons/GoogleApiKey")) { $GLOBALS["GoogleApiKey"] = @file_get_contents("/etc/artica-postfix/settings/Daemons/GoogleApiKey"); } } } if ($argv[1] == "--mysql") { tests_mysql(); exit; } if ($argv[1] == "--db") { DATABASE_INFOS(); exit; } $timefile = "/etc/artica-postfix/pids/" . basename(__FILE__) . ".time"; $time = $unix->file_time_min($timefile); if ($time < 1440) { echo "Only each 1440mn\n"; if (!$GLOBALS["FORCE"]) { die; } } @unlink($timefile);