diff options
| author | EoleDev <EoleDev@outlook.fr> | 2016-03-15 23:08:55 +0100 |
|---|---|---|
| committer | EoleDev <EoleDev@outlook.fr> | 2016-03-15 23:08:55 +0100 |
| commit | 85b5ebaa182ae8897d825638a2c9b103d7e88eca (patch) | |
| tree | af162fdf2467c1ea2ee84f362628aa1b45d9c49c /server/core/Image.php | |
| parent | b50d3cc788038122b0afc22a3e94161e1848d022 (diff) | |
| parent | 2b8decb81faeb7928bcbfda84c6f33a003f707fd (diff) | |
Merge branch 'Eole' into develop
Diffstat (limited to 'server/core/Image.php')
| -rw-r--r-- | server/core/Image.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/server/core/Image.php b/server/core/Image.php index f509cd6..f2af5cc 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 * @@ -68,9 +70,15 @@ class image implements Core{ * options for the image creation * **/ +<<<<<<< HEAD + private function createImage(array $opt){ + +======= private function createImage(){ +>>>>>>> develop $opt = $this->app->getPostParam("opt"); + if(!isset($opt)){ $this->app->setOutput("Error", "Incorrect parameter"); } @@ -135,6 +143,7 @@ class image implements Core{ $this->app->getErrorInstance->NotImplementedHandler($e); } $this->app->setOutput("Images", $image); + } /** @@ -158,7 +167,9 @@ class image implements Core{ }catch(NotImplementedError $e){ $this->app->getErrorInstance->NotImplementedHandler($e); } + $this->app->setOutput("Images", $result); + } /** @@ -172,6 +183,7 @@ class image implements Core{ $id = $this->app->getPostParam("id"); if(!isset($id)){ $this->app->setOutput("Error", "Incorrect id parameter"); + } try{ $service = $this->libClass; @@ -179,7 +191,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){ @@ -200,9 +214,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"); } @@ -292,6 +308,7 @@ class image implements Core{ **/ private function reactivateImage(){ $id = $this->app->getPostParam("id"); + if(!isset($id)){ $this->app->setOutput("Error", "Incorrect parameter"); } @@ -322,6 +339,7 @@ class image implements Core{ **/ private function desactivateImage(){ $id = $this->app->getPostParam("id"); + if(!isset($id)){ $this->app->setOutput("Error", "Incorrect parameter"); } @@ -357,6 +375,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"); } @@ -389,8 +408,15 @@ class image implements Core{ * @param string $id * identifier of the image **/ +<<<<<<< HEAD + private function downloadImage($id){ +<<<<<<< HEAD +======= +======= private function downloadImage(){ +>>>>>>> develop $id = $this->app->getPostParam("id"); +>>>>>>> develop if(!isset($id)){ $this->app->setOutput("Error", "Incorrect parameter"); } @@ -462,6 +488,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"); } @@ -503,6 +530,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"); } |
