Skip to content

Commit 2c65001

Browse files
committed
added returncode view for api
1 parent 072d429 commit 2c65001

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

web/api/index.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@
4141

4242
// Run query
4343
exec (VESTA_CMD.$cmd." ".$arg1." ".$arg2." ".$arg3." ".$arg4." ".$arg5." ".$arg6." ".$arg7." ".$arg8." ".$arg9, $output, $return_var);
44-
if (($return_var == 0) && (empty($output))) {
45-
echo 'OK';
44+
if ((!empty($_POST['returncode'])) && ($_POST['returncode'] == 'yes')) {
45+
echo $return_var;
4646
} else {
47-
echo implode("\n",$output);
47+
if (($return_var == 0) && (empty($output))) {
48+
echo "OK";
49+
} else {
50+
echo implode("\n",$output)."\n";
51+
}
4852
}
4953
}
5054

0 commit comments

Comments
 (0)