// check arguments
if (empty($_POST['node_id'])) {
- header ('location:index.php');
- exit();
+ plc_redirect (l_nodes());
} else {
$node_id = intval($_POST['node_id']);
}
$error= $api->error();
if( empty( $error ) ) {
- header( "location: index.php?id=$node_id" );
- exit();
+ plc_redirect(l_node($node_id));
} else {
echo "<font color=red>". $error . "</font>\n" ;
echo "<p> Press back to retry</p>";
// from former node_actions.php
case "delete":
$api->DeleteNode( intval( $node_id ) );
- header( "location: index.php" );
- exit();
+ plc_redirect(l_nodes());
break;
// ACTION: boot-state
case 'rcnf':
case 'new':
$api->UpdateNode( intval( $node_id ), array( "boot_state" => $_POST['boot_state'] ) );
- header( "location: index.php?id=$node_id" );
- exit();
+ plc_redirect (l_node($node_id));
break;
default:
print "<div class='plc-error'> no such boot state " . $_POST['boot_state'] . "</div>";
default:
echo "Unkown action <$action>.";
- header("location:index.php?id=" . $node_id);
- exit();
+ plc_redirect (l_node($node_id));
break;
}