diff options
Diffstat (limited to 'server/core/Image.php')
| -rw-r--r-- | server/core/Image.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/server/core/Image.php b/server/core/Image.php index ddd8390..b192716 100644 --- a/server/core/Image.php +++ b/server/core/Image.php @@ -14,8 +14,10 @@ use OpenStack\Common\Error\BaseError; use OpenStack\Common\Error\NotImplementedError; use OpenStack\Common\Error\UserInputError; + include("CoreInterface.php"); + /** * Image Class of the back-end application * @@ -79,8 +81,10 @@ class image implements Core{ * **/ private function createImage(array $opt){ + $opt = $this->app->getPostParam("opt"); + if(!isset($opt)){ $this->app->setOutput("Error", "Incorrect parameter"); } @@ -145,6 +149,7 @@ class image implements Core{ $this->app->getErrorInstance->NotImplementedHandler($e); } $this->app->setOutput("Images", $image); + } /** @@ -168,7 +173,9 @@ class image implements Core{ }catch(NotImplementedError $e){ $this->app->getErrorInstance->NotImplementedHandler($e); } + $this->app->setOutput("Images", $result); + } /** @@ -182,6 +189,7 @@ class image implements Core{ $id = $this->app->getPostParam("id"); if(!isset($id)){ $this->app->setOutput("Error", "Incorrect id parameter"); + } try{ $service = $this->libClass; @@ -189,7 +197,9 @@ class image implements Core{ if($image == null){ // if the image don't exists -> error $this->app->setOutput("Error", "Image doesn't exist"); } + $this->app->setOutput("Images", $image); + }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); }catch(UserInputError $e){ @@ -210,9 +220,11 @@ class image implements Core{ * @param array $opt * options for the image creation **/ + private function updateImage(){ $id = $this->app->getPostParam("id"); $opt = $this->app->getPostParam("opt"); + if(!isset($id)){ $this->app->setOutput("Error", "Incorrect id parameter"); } @@ -302,6 +314,7 @@ class image implements Core{ **/ private function reactivateImage(){ $id = $this->app->getPostParam("id"); + if(!isset($id)){ $this->app->setOutput("Error", "Incorrect parameter"); } @@ -332,6 +345,7 @@ class image implements Core{ **/ private function desactivateImage(){ $id = $this->app->getPostParam("id"); + if(!isset($id)){ $this->app->setOutput("Error", "Incorrect parameter"); } @@ -367,6 +381,7 @@ class image implements Core{ $id = $this->app->getPostParam("id"); $file_name = $this->app->getPostParam("file_name"); + if(!isset($id)){ $this->app->setOutput("Error", "Incorrect id parameter"); } @@ -400,7 +415,10 @@ class image implements Core{ * identifier of the image **/ private function downloadImage($id){ +<<<<<<< HEAD +======= $id = $this->app->getPostParam("id"); +>>>>>>> develop if(!isset($id)){ $this->app->setOutput("Error", "Incorrect parameter"); } @@ -472,6 +490,7 @@ class image implements Core{ private function listMemberImage(){ $image_id = $this->app->getPostParam("image_id"); $member_id = $this->app->getPostParam("member_id"); + if(!isset($image_id)){ $this->app->setOutput("Error", "Incorrect parameter image_id"); } @@ -513,6 +532,7 @@ class image implements Core{ private function detailMemberImage(){ $image_id = $this->app->getPostParam("image_id"); $member_id = $this->app->getPostParam("member_id"); + if(!isset($image_id)){ $this->app->setOutput("Error", "Incorrect parameter image_id"); } |
