]> dev.renevier.net Git - syp.git/blobdiff - api.php
forbird creation or deletion of item; forbids adding or deleting an image
[syp.git] / api.php
diff --git a/api.php b/api.php
index 39c6319ab5c749d857665830e0bb040f5dfe30e3..76eef437929e267d71adb56e78fccf1191a0e2c7 100644 (file)
--- a/api.php
+++ b/api.php
@@ -195,6 +195,7 @@ function main ($con) {
             if ($_POST ["keep_img"] == "yes") {
                 $imgpath = $feature->imgpath;
             } else {
+                request_error ();
                 $imgpath = save_uploaded_file ($_FILES ["image_file"], $con);
             }
 
@@ -235,6 +236,7 @@ function main ($con) {
             success_feature ($new_feature, "update");
         break;
         case "add":
+            request_error ();
             $imgpath = save_uploaded_file ($_FILES ["image_file"], $con);
 
             $lon = $_POST ["lon"];
@@ -254,6 +256,7 @@ function main ($con) {
             success_feature ($feature, "add");
         break;
         case "del":
+            request_error ();
             $id = $_POST ["fid"];
             $feature = $con->getfeature ($id);
             if (!isset ($feature)) {