if ($argv[1] == "--single-install") { install_single($argv[2]); die; } if (preg_match("#--vhosts#", implode(" ", $argv))) { vhosts(); die; } if (preg_match("#--mailman#", implode(" ", $argv))) { $GLOBALS["OUTPUT"] = true; mailmanhosts(); die; } if (preg_match("#--Wvhosts#", implode(" ", $argv))) { @mkdir("/usr/local/apache-groupware/conf"); @file_put_contents("/usr/local/apache-groupware/conf/vhosts", vhosts(true)); die; } if (!Build_pid_func(__FILE__, "MAIN")) { writelogs(basename(__FILE__) . ":Already executed.. aborting the process", basename(__FILE__), __FILE__, __LINE__); die; } if ($argv[1] == "remove") { remove($argv[2]); die; } $ldap = new clladp(); $pattern = "(&(objectclass=apacheConfig)(apacheServerName=*))"; $attr = array(); $sr = @ldap_search($ldap->ldap_connection, $ldap->suffix, $pattern, $attr); $hash = ldap_get_entries($ldap->ldap_connection, $sr);
<?php include_once dirname(__FILE__) . '/ressources/class.mysql.inc'; include_once dirname(__FILE__) . '/ressources/class.user.inc'; include_once dirname(__FILE__) . "/framework/class.unix.inc"; include_once dirname(__FILE__) . "/framework/frame.class.inc"; define('_JEXEC', 1); if (preg_match("#--verbose#", implode(" ", $argv))) { $GLOBALS["VERBOSE"] = true; $GLOBALS["cmdlineadd"] = " --verbose"; } if ($argv[1] == '--vhosts') { vhosts(); exit; } CheckInstall(); CheckUninstall(); function CheckInstall() { $sql = "SELECT * FROM joomla_users WHERE install=0"; $q = new mysql(); $results = $q->QUERY_SQL($sql, "artica_backup"); while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) { unset($arrayconfig); $GLOBALS["joom_servername"] = $ligne["servername"]; set_status('{checking}'); write_events("starting installation of {$GLOBALS["joom_servername"]}"); $arrayconfig["LANG"] = $ligne["language"]; $arrayconfig["DB"] = $ligne["databasename"]; $arrayconfig["uid"] = $ligne["uid"]; $u = new user($arrayconfig["uid"]);