mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-25 06:46:29 +02:00
2011-01-27 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_db.php, godmode/modules/manage_network_templates_form.php: cleaned source style. * extensions/resource_registration.php: added extensión to import by xml file the network component, wmi component, smnp component and local component. And if the xml content a template, this component add into template. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3785 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
2275ebaea9
commit
f125655c54
@ -1,3 +1,13 @@
|
|||||||
|
2011-01-27 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_db.php,
|
||||||
|
godmode/modules/manage_network_templates_form.php: cleaned source style.
|
||||||
|
|
||||||
|
* extensions/resource_registration.php: added extensión to import by xml
|
||||||
|
file the network component, wmi component, smnp component and local
|
||||||
|
component. And if the xml content a template, this component add into
|
||||||
|
template.
|
||||||
|
|
||||||
2011-01-27 Miguel de Dios <miguel.dedios@artica.es>
|
2011-01-27 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
* include/functions_db.php: fixed the check ACL in function
|
* include/functions_db.php: fixed the check ACL in function
|
||||||
|
@ -48,7 +48,8 @@ if (isset ($_GET["delete_module"])) {
|
|||||||
print_result_message (($errors < 1),
|
print_result_message (($errors < 1),
|
||||||
__('Successfully deleted module from profile'),
|
__('Successfully deleted module from profile'),
|
||||||
__('Error deleting module from profile'));
|
__('Error deleting module from profile'));
|
||||||
} elseif (isset ($_GET["add_module"])) {
|
}
|
||||||
|
elseif (isset ($_GET["add_module"])) {
|
||||||
// Add module to profile
|
// Add module to profile
|
||||||
$errors = 0;
|
$errors = 0;
|
||||||
foreach ($id_nc as $component) {
|
foreach ($id_nc as $component) {
|
||||||
@ -76,7 +77,8 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
|
|||||||
print_result_message ($result !== false,
|
print_result_message ($result !== false,
|
||||||
__('Successfully updated network profile'),
|
__('Successfully updated network profile'),
|
||||||
__('Error updating network profile'));
|
__('Error updating network profile'));
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//Profile doesn't exist
|
//Profile doesn't exist
|
||||||
$sql = sprintf ("INSERT INTO tnetwork_profile (name, description) VALUES ('%s', '%s')", $name, $description);
|
$sql = sprintf ("INSERT INTO tnetwork_profile (name, description) VALUES ('%s', '%s')", $name, $description);
|
||||||
$result = process_sql ($sql, "insert_id");
|
$result = process_sql ($sql, "insert_id");
|
||||||
@ -86,14 +88,16 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
|
|||||||
$id_np = (int) $result; //Will return either 0 (in case of error) or an int
|
$id_np = (int) $result; //Will return either 0 (in case of error) or an int
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif ($id_np > 0) {
|
}
|
||||||
|
elseif ($id_np > 0) {
|
||||||
//Profile exists
|
//Profile exists
|
||||||
$row = get_db_row ("tnetwork_profile", "id_np", $id_np);
|
$row = get_db_row ("tnetwork_profile", "id_np", $id_np);
|
||||||
|
|
||||||
$description = $row["description"];
|
$description = $row["description"];
|
||||||
$name = $row["name"];
|
$name = $row["name"];
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
//Profile has to be created
|
//Profile has to be created
|
||||||
$description = "";
|
$description = "";
|
||||||
$name = "";
|
$name = "";
|
||||||
@ -102,7 +106,8 @@ if (isset ($_GET["create"]) || isset ($_GET["update"])) {
|
|||||||
|
|
||||||
if ($id_np < 1) {
|
if ($id_np < 1) {
|
||||||
echo '<form name="new_temp" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$id_np.'&create=1">';
|
echo '<form name="new_temp" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$id_np.'&create=1">';
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
echo '<form name="mod_temp" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$id_np.'&update='.$id_np.'">';
|
echo '<form name="mod_temp" method="post" action="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$id_np.'&update='.$id_np.'">';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -119,7 +124,8 @@ echo "</td></tr>";
|
|||||||
echo '<tr><td></td><td style="text-align:right;">';
|
echo '<tr><td></td><td style="text-align:right;">';
|
||||||
if ($id_np > 0) {
|
if ($id_np > 0) {
|
||||||
print_submit_button (__("Update"), "updbutton", false, 'class="sub upd"');
|
print_submit_button (__("Update"), "updbutton", false, 'class="sub upd"');
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
print_submit_button (__("Create"), "crtbutton", false, 'class="sub wand"');
|
print_submit_button (__("Create"), "crtbutton", false, 'class="sub wand"');
|
||||||
}
|
}
|
||||||
echo "</td></tr></table></form>";
|
echo "</td></tr></table></form>";
|
||||||
|
@ -3488,11 +3488,14 @@ function process_sql_insert ($table, $values) {
|
|||||||
|
|
||||||
if (is_null ($value)) {
|
if (is_null ($value)) {
|
||||||
$values_str .= "NULL";
|
$values_str .= "NULL";
|
||||||
} elseif (is_int ($value) || is_bool ($value)) {
|
}
|
||||||
|
elseif (is_int ($value) || is_bool ($value)) {
|
||||||
$values_str .= sprintf ("%d", $value);
|
$values_str .= sprintf ("%d", $value);
|
||||||
} else if (is_float ($value) || is_double ($value)) {
|
}
|
||||||
|
else if (is_float ($value) || is_double ($value)) {
|
||||||
$values_str .= sprintf ("%f", $value);
|
$values_str .= sprintf ("%f", $value);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$values_str .= sprintf ("'%s'", $value);
|
$values_str .= sprintf ("'%s'", $value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user