".lang_string ("Problem updating plugin").""; } else { echo "

".lang_string ("Plugin updated successfully")."

"; } } // Create plugin if (isset($_GET["create_plugin"])){ $plugin_name = get_parameter ("form_name", ""); $plugin_description = get_parameter ("form_description", ""); $plugin_max_timeout = get_parameter ("form_max_timeout", ""); $plugin_execute = get_parameter ("form_execute", ""); $plugin_net_dst_opt = get_parameter ("form_net_dst_opt", ""); $plugin_net_port_opt = get_parameter ("form_net_port_opt", ""); $plugin_user_opt = get_parameter ("form_user_opt", ""); $plugin_pass_opt = get_parameter ("form_pass_opt", ""); $sql_insert ="INSERT tplugin (name, description, max_timeout, execute, net_dst_opt, net_port_opt, user_opt, pass_opt) VALUES ('$plugin_name', '$plugin_description', '$plugin_max_timeout', '$plugin_execute', '$plugin_net_dst_opt', '$plugin_net_port_opt', '$plugin_user_opt', '$plugin_pass_opt')"; $result=mysql_query($sql_insert); if (! $result){ echo "

".lang_string ("Problem creating plugin")."

"; echo $sql_insert; } else { echo "

".lang_string ("Plugin created successfully")."

"; } } if (isset($_GET["kill_plugin"])){ // if delete alert $plugin_id = get_parameter ("kill_plugin", 0); $sql_delete= "DELETE FROM tplugin WHERE id= ".$plugin_id; $result=mysql_query($sql_delete); if (! $result){ echo "

".lang_string ("Problem deleting plugin")."

"; } else { echo "

".lang_string ("Plugin deleted successfully")."

"; } if ($plugin_id != 0){ $sql_delete2 ="DELETE FROM tagente_modulo WHERE id_plugin = ".$plugin_id; $result=mysql_query($sql_delete2); } } $view = get_parameter ("view", ""); $create = get_parameter ("create", ""); if ($view != ""){ $form_id = $view; $plugin = get_db_row ("tplugin", "id", $form_id); $form_name = $plugin["name"]; $form_description = $plugin["description"]; $form_max_timeout = $plugin ["max_timeout"]; $form_execute = $plugin ["execute"]; $form_net_dst_opt = $plugin ["net_dst_opt"]; $form_net_port_opt = $plugin ["net_port_opt"]; $form_user_opt = $plugin ["user_opt"]; $form_pass_opt = $plugin ["pass_opt"]; } if ($create != ""){ $form_name = ""; $form_description = ""; $form_max_timeout = ""; $form_execute = ""; $form_net_dst_opt = ""; $form_net_port_opt = ""; $form_user_opt = ""; $form_pass_opt = ""; } // SHOW THE FORM // ================================================================= if (($create != "") OR ($view != "")){ echo "

".lang_string ("Plugin"); if ($create != "") echo lang_string ("creation"); else { echo lang_string ("update"); $plugin_id = get_parameter ("view",""); } echo "

"; if ($create == "") echo "
"; else echo ""; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
'.lang_string ("Name"); echo ''; echo '
'.lang_string ("Plugin command"); echo ''; echo '
'.lang_string ("Max.Timeout"); echo ''; echo '
'.lang_string ("IP address option"); echo ''; echo '
'.lang_string ("Port option"); echo ''; echo '
'.lang_string ("User option"); echo ''; echo '
'.lang_string ("Password option"); echo ''; echo '
'.$lang_label["description"].'
'; echo ''; echo '
'; if ($create != ""){ echo ""; } else { echo ""; } echo '
'; } else { // If not edition or insert, then list available plugins echo "

".$lang_label["no_plugins"]."

"; $sql1='SELECT * FROM tplugin ORDER BY name'; $result=mysql_query($sql1); if (mysql_num_rows($result) > 0){ echo ''; echo ""; echo "
".lang_string("name"); echo "".lang_string("execute"); echo "".lang_string("delete"); $color = 0; while ($row=mysql_fetch_array($result)){ if ($color == 1){ $tdcolor = "datos"; $color = 0; } else { $tdcolor = "datos2"; $color = 1; } echo "
"; echo ""; echo $row["name"]; echo ""; echo ""; echo $row["execute"]; echo ""; echo ""; } echo "
"; } else { echo lang_string ("There is no plugins in the system"); echo "
"; } echo ""; echo "
"; echo "
"; echo ""; echo "
"; } ?>