]> 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 2054350084a29108e54982d3de468354805b33da..38dc35dab9ef09834ac3120e8e8f74b229a9a868 100644 (file)
--- a/api.php
+++ b/api.php
@@ -216,6 +216,7 @@ function main ($con) {
             if ($_POST ["keep_img"] == "yes") {
                 $imgpath = $feature->imgpath;
             } else {
             if ($_POST ["keep_img"] == "yes") {
                 $imgpath = $feature->imgpath;
             } else {
+                request_error ();
                 $imgpath = save_uploaded_file ($_FILES ["image_file"], $con);
             }
 
                 $imgpath = save_uploaded_file ($_FILES ["image_file"], $con);
             }
 
@@ -256,6 +257,7 @@ function main ($con) {
             success_feature ($new_feature, "update");
         break;
         case "add":
             success_feature ($new_feature, "update");
         break;
         case "add":
+            request_error ();
             $imgpath = save_uploaded_file ($_FILES ["image_file"], $con);
 
             $lon = $_POST ["lon"];
             $imgpath = save_uploaded_file ($_FILES ["image_file"], $con);
 
             $lon = $_POST ["lon"];
@@ -275,6 +277,7 @@ function main ($con) {
             success_feature ($feature, "add");
         break;
         case "del":
             success_feature ($feature, "add");
         break;
         case "del":
+            request_error ();
             $id = $_POST ["fid"];
             $feature = $con->getfeature ($id);
             if (!isset ($feature)) {
             $id = $_POST ["fid"];
             $feature = $con->getfeature ($id);
             if (!isset ($feature)) {