Allowed the put data to be passed in the query string for table puts and patches
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@13667 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
cd5a26cc0a
commit
c30c73c726
@ -1297,12 +1297,31 @@ sub tablesHandler {
|
||||
}
|
||||
elsif (isPut() || isPatch()) {
|
||||
my $condition = $q->param('condition');
|
||||
if (!defined $condition) {
|
||||
foreach my $put (@{$queryhash{'putData'}}) {
|
||||
my ($key, $value) = split(/=/, $put, 2);
|
||||
if ($key eq 'condition' && $value) {
|
||||
$condition = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!defined $table || !defined $condition) {
|
||||
addPageContent("The table and condition must be specified when adding, changing or deleting an entry");
|
||||
sendResponseMsg($STATUS_BAD_REQUEST);
|
||||
}
|
||||
$request->{command} = 'tabch';
|
||||
if (defined $q->param('delete')) {
|
||||
my $del;
|
||||
if (!defined $q->param('delete')) {
|
||||
foreach my $put (@{$queryhash{'putData'}}) {
|
||||
my ($key, $value) = split(/=/, $put, 2);
|
||||
if ($key eq 'delete') {
|
||||
$del = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (defined $q->param('delete') || defined $del) {
|
||||
push @args, '-d';
|
||||
push @args, $condition;
|
||||
push @args, $table;
|
||||
|
Loading…
Reference in New Issue
Block a user