function NotifySpecificClient($server) { $ini = new Bs_IniHandler(); $ini->_params["PARAMS"]["notify"] = 1; $ini->_params["PARAMS"]["error"] = 0; $ini->_params["PARAMS"]["error_text"] = "{scheduled}"; $ini->_params["PARAMS"]["name"] = "{$server}"; $ini->saveFile("/etc/artica-cluster/notify-{$server}"); NotifyClients(); }
die; } if (isset($_POST)) { while (list($num, $ligne) = each($_POST)) { writelogs("unable to understand {$num}= {$ligne}", __FUNCTION__, __FILE__, __LINE__); } die; } if (isset($_GET)) { while (list($num, $ligne) = each($_GET)) { writelogs("unable to understand {$num}= {$ligne}", __FUNCTION__, __FILE__, __LINE__); } die; } writelogs("no posts notify clients by default...", __FUNCTION__, __FILE__, __LINE__); NotifyClients(); die; function NotifyAllClients() { $sql = "SELECT * FROM glusters_clients WHERE client_notified=0 ORDER BY ID DESC"; $q = new mysql(); $results = $q->QUERY_SQL($sql, "artica_backup"); while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) { NotifyClient("{$ligne["client_ip"]}:{$ligne["client_port"]}", $ligne["ID"]); } } function DeleteAllClients() { $q = new mysql(); $sql = "DELETE FROM glusters_clients WHERE client_notified=0 AND NotifToDelete=1"; $q->QUERY_SQL($sql, "artica_backup");