mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-30 01:05:39 +02:00
2009-08-27 Ramon Novoa <rnovoa@artica.es>
* include/functions_db.php, godmode/agentes/modificar_agente.php, godmode/agentes/manage_config_remote.php, godmode/agentes/agent_manager.php: Remote config .conf and .md5 files are now stored in different subdirectories. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1886 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
889e0ba46d
commit
e192c5eb18
@ -1,3 +1,11 @@
|
|||||||
|
2009-08-27 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* include/functions_db.php,
|
||||||
|
godmode/agentes/modificar_agente.php,
|
||||||
|
godmode/agentes/manage_config_remote.php,
|
||||||
|
godmode/agentes/agent_manager.php: Remote config .conf and .md5 files
|
||||||
|
are now stored in different subdirectories.
|
||||||
|
|
||||||
2009-08-27 Miguel de Dios <miguel.dedios@artica.es>
|
2009-08-27 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* index.php: add comments for more readable.
|
* index.php: add comments for more readable.
|
||||||
|
@ -69,8 +69,8 @@ echo '<div style="height: 5px"> </div>';
|
|||||||
|
|
||||||
// Agent remote configuration editor
|
// Agent remote configuration editor
|
||||||
$agent_md5 = md5 ($nombre_agente, false);
|
$agent_md5 = md5 ($nombre_agente, false);
|
||||||
$filename['md5'] = $config["remote_config"]."/".$agent_md5.".md5";
|
$filename['md5'] = $config["remote_config"]."/md5/".$agent_md5.".md5";
|
||||||
$filename['conf'] = $config["remote_config"]."/".$agent_md5.".conf";
|
$filename['conf'] = $config["remote_config"]."/conf/".$agent_md5.".conf";
|
||||||
|
|
||||||
$disk_conf = (bool) get_parameter ('disk_conf');
|
$disk_conf = (bool) get_parameter ('disk_conf');
|
||||||
|
|
||||||
|
@ -76,11 +76,11 @@ if ((isset($_GET["operacion"])) AND ($update_group == -1) ) {
|
|||||||
$agent_name_dst = get_agent_name($id_agente, "");
|
$agent_name_dst = get_agent_name($id_agente, "");
|
||||||
echo "<br><br>".__('Making copy of configuration file for')." [<b>".$agent_name_src."</b>] ".__('to')." [<b>".$agent_name_dst."</b>]";
|
echo "<br><br>".__('Making copy of configuration file for')." [<b>".$agent_name_src."</b>] ".__('to')." [<b>".$agent_name_dst."</b>]";
|
||||||
|
|
||||||
$source = $config["remote_config"]."/".md5($agent_name_src);
|
$agent_md5_src = md5($agent_name_src);
|
||||||
$destination = $config["remote_config"]."/".md5($agent_name_dst);
|
$agent_md5_dst = md5($agent_name_dst);
|
||||||
|
|
||||||
copy ( $source.".md5", $destination.".md5" );
|
copy ( $config["remote_config"]."/md5/".$agent_md5_src.".md5", $config["remote_config"]."/md5/".$agent_md5_dst.".md5" );
|
||||||
copy ( $source.".conf", $destination.".conf" );
|
copy ( $config["remote_config"]."/conf/".$agent_md5_src.".conf", $config["remote_config"]."/conf/".$agent_md5_dst.".conf" );
|
||||||
} // for each destination agent
|
} // for each destination agent
|
||||||
} //end if copy modules or alerts
|
} //end if copy modules or alerts
|
||||||
|
|
||||||
@ -121,7 +121,7 @@ if ((isset($_GET["operacion"])) AND ($update_group == -1) ) {
|
|||||||
$result=mysql_query($sql1);
|
$result=mysql_query($sql1);
|
||||||
while ($row=mysql_fetch_array($result)){
|
while ($row=mysql_fetch_array($result)){
|
||||||
if (give_acl ($config["id_user"], $row["id_grupo"], "AR")){
|
if (give_acl ($config["id_user"], $row["id_grupo"], "AR")){
|
||||||
$source = $config["remote_config"]."/". md5($row["nombre"]).".conf";
|
$source = $config["remote_config"]."/conf/". md5($row["nombre"]).".conf";
|
||||||
if (file_exists($source)){
|
if (file_exists($source)){
|
||||||
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
|
echo "<option value=".$row["id_agente"].">".$row["nombre"]."</option>";
|
||||||
}
|
}
|
||||||
|
@ -220,7 +220,7 @@ if ($agents !== false) {
|
|||||||
echo "<td align='center' class='$tdcolor'>";
|
echo "<td align='center' class='$tdcolor'>";
|
||||||
// Has remote configuration ?
|
// Has remote configuration ?
|
||||||
$agent_md5 = md5 ($agent["nombre"], false);
|
$agent_md5 = md5 ($agent["nombre"], false);
|
||||||
if (file_exists ($config["remote_config"]."/".$agent_md5.".md5")) {
|
if (file_exists ($config["remote_config"]."/md5/".$agent_md5.".md5")) {
|
||||||
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente=".$agent["id_agente"]."&disk_conf=1'>";
|
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente=".$agent["id_agente"]."&disk_conf=1'>";
|
||||||
echo "<img src='images/application_edit.png' align='middle' title='".__('Edit remote config')."'>";
|
echo "<img src='images/application_edit.png' align='middle' title='".__('Edit remote config')."'>";
|
||||||
echo "</a>";
|
echo "</a>";
|
||||||
|
@ -2736,11 +2736,11 @@ function delete_agent ($id_agents) {
|
|||||||
// Delete remote configuration
|
// Delete remote configuration
|
||||||
if (isset ($config["remote_config"])) {
|
if (isset ($config["remote_config"])) {
|
||||||
$agent_md5 = md5 (get_agent_name ($id_agent), FALSE);
|
$agent_md5 = md5 (get_agent_name ($id_agent), FALSE);
|
||||||
if (file_exists ($config["remote_config"]."/".$agent_md5.".md5")) {
|
if (file_exists ($config["remote_config"]."/md5/".$agent_md5.".md5")) {
|
||||||
// Agent remote configuration editor
|
// Agent remote configuration editor
|
||||||
$file_name = $config["remote_config"]."/".$agent_md5.".conf";
|
$file_name = $config["remote_config"]."/conf/".$agent_md5.".conf";
|
||||||
@unlink ($file_name);
|
@unlink ($file_name);
|
||||||
$file_name = $config["remote_config"]."/".$agent_md5.".md5";
|
$file_name = $config["remote_config"]."/md5/".$agent_md5.".md5";
|
||||||
@unlink ($file_name);
|
@unlink ($file_name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user