diff --git a/webui/group-attribute-add.php b/webui/group-attribute-add.php index 594de6f2b176fe08792695f526b8c6fe87ff00e3..d573fb8fab00171199394b5e685d05631d09e698 100644 --- a/webui/group-attribute-add.php +++ b/webui/group-attribute-add.php @@ -111,19 +111,12 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "add") { $_POST['attr_operator'], $_POST['attr_value'], )); - if ($res) { - + if ($res !== FALSE) { ?> - <div class="notice">Attribute added</div> - <?php - - session_destroy(); } else { - ?> - <div class="warning">Failed to add attribute</div> <div class="warning"><?php print_r($stmt->errorInfo()) ?></div> diff --git a/webui/group-attribute-change.php b/webui/group-attribute-change.php index 163de68648969ae7b4dd8b9ba044aa9965ea7779..86d2136d776cbeb198aa1dc0816fafb81bc8d450 100644 --- a/webui/group-attribute-change.php +++ b/webui/group-attribute-change.php @@ -157,45 +157,38 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "change") { if (sizeof($updates) > 0) { $updateStr = implode(', ',$updates); - $res = $db->exec("UPDATE ${DB_TABLE_PREFIX}group_attributes SET $updateStr WHERE ID = ".$db->quote($_POST['attr_id'])); + $res = $db->exec(" + UPDATE + ${DB_TABLE_PREFIX}group_attributes + SET + $updateStr + WHERE + ID = ".$db->quote($_POST['attr_id']." + ")); if ($res !== FALSE) { - ?> - <div class="notice">Attribute updated</div> - <?php - } else { - ?> - <div class="warning">Error updating attribute</div> <div class="warning"><?php print_r($db->errorInfo()) ?></div> - <?php - } # Warn } else { - ?> - <div class="warning">No attribute updates</div> - <?php - } + # Warn } else { - ?> - <div class="error">No attribute data available</div> - <?php - } + } else { ?> diff --git a/webui/group-attribute-delete.php b/webui/group-attribute-delete.php index d857f0fc1fc4a81afa1b5ec333ba2a0469db227e..e77ae3c47c1d1f874ee1cd9c9cd8d503168094bb 100644 --- a/webui/group-attribute-delete.php +++ b/webui/group-attribute-delete.php @@ -76,45 +76,35 @@ if (isset($_POST['frmaction']) && $_POST['frmaction'] == "delete") { <?php + # Make sure we have the attribute ID set if (isset($_POST['attr_id'])) { + + # And make sure user confirmed if (isset($_POST['confirm']) && $_POST['confirm'] == "yes") { + $res = $db->exec("DELETE FROM ${DB_TABLE_PREFIX}group_attributes WHERE ID = ".$db->quote($_POST['attr_id'])); if ($res !== FALSE) { - ?> - <div class="notice">Attribute with ID: <?php print_r($_POST['attr_id']);?> deleted</div> - <?php - } else { - ?> - <div class="warning">Error deleting attribute</div> <div class="warning"><?php print_r($db->errorInfo()) ?></div> - <?php - } + # Warn } else { - ?> - <div class="warning">Delete attribute aborted</div> - <?php - } - } else { + } else { ?> - <div class="warning">Invocation error, no attribute ID selected</div> - <?php - } } printFooter();