diff options
Diffstat (limited to 'server/core/Image.php')
| -rwxr-xr-x | server/core/Image.php | 222 |
1 files changed, 111 insertions, 111 deletions
diff --git a/server/core/Image.php b/server/core/Image.php index 334fce4..d930962 100755 --- a/server/core/Image.php +++ b/server/core/Image.php @@ -51,10 +51,10 @@ class image implements Core{ * * @param String $action name of another function of this class * - * @return void + * @return NULL */ public function action($action){ - $this->{$action.""}(); + $this->{$action.""}(); } /** @@ -78,13 +78,13 @@ class image implements Core{ if(isset($opt['name'])){ $imagesList = $this->listImage(); if(isset($imagesList)){ - foreach($imagesList as $image){ - if(strcmp($image->name, $opt['name']) == 0){ // if the image name already exists -> error - $this->app->setOutput("Error", "Image name already exists"); - } - } - } - $options['name'] = $opt['name']; + foreach($imagesList as $image){ + if(strcmp($image->name, $opt['name']) == 0){ // if the image name already exists -> error + $this->app->setOutput("Error", "Image name already exists"); + } + } + } + $options['name'] = $opt['name']; } else{ $this->app->setOutput("Error", "Missing parameter 'name' for the new image"); @@ -125,15 +125,15 @@ class image implements Core{ $image = $this->libClass->createImage($options); }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } $this->app->setOutput("Images", $image); } @@ -152,15 +152,15 @@ class image implements Core{ } }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } $this->app->setOutput("Images", $result); @@ -191,16 +191,16 @@ class image implements Core{ } }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + } } /** @@ -254,15 +254,15 @@ class image implements Core{ $image->update($options); }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } $this->app->setOutput("Images", $image); } } @@ -272,7 +272,7 @@ class image implements Core{ * * @param String $id Identifier of the image * - * @return void + * @return NULL */ private function deleteImage(){ $id = $this->app->getPostParam("id"); @@ -289,16 +289,16 @@ class image implements Core{ $image->delete(); }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + } } /** @@ -306,7 +306,7 @@ class image implements Core{ * * @param String $id Identifier of the image * - * @return void + * @return NULL */ private function reactivateImage(){ $id = $this->app->getPostParam("id"); @@ -326,16 +326,16 @@ class image implements Core{ $image->reactivate(); }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + } } /** @@ -343,7 +343,7 @@ class image implements Core{ * * @param String $id Identifier of the image * - * @return void + * @return NULL */ private function desactivateImage(){ $id = $this->app->getPostParam("id"); @@ -362,16 +362,16 @@ class image implements Core{ $image->deactivate(); }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + } } /** @@ -380,14 +380,14 @@ class image implements Core{ * @param String $id Identifier of the image * @param String $file_name Path of the image * - * @return void + * @return NULL */ private function uploadImage(){ $id = $this->app->getPostParam("id"); $file_name = $this->app->getPostParam("file_name"); - $file = $this->app->getPostParam("file"); + $file = $this->app->getPostParam("file"); error_log(print_r($file, true), 0); - + if(!isset($id)){ $this->app->setOutput("Error", "Incorrect id parameter"); } @@ -405,16 +405,16 @@ class image implements Core{ $image->uploadData($stream); }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + } } /** @@ -440,17 +440,17 @@ class image implements Core{ $stream = $image->downloadData(); }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } - $this->app->setOutput("Images", $stream); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + $this->app->setOutput("Images", $stream); + } } /** @@ -483,16 +483,16 @@ class image implements Core{ $this->app->setOutput("Images", $member_id); }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + } } @@ -526,15 +526,15 @@ class image implements Core{ } }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } $this->app->setOutput("Images", $members); } } @@ -572,15 +572,15 @@ class image implements Core{ } }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } $this->app->setOutput("Images", $member); } } @@ -591,7 +591,7 @@ class image implements Core{ * @param String $image_id Identifier of the image * @param String $member_id Identifier of the member * - * @return void + * @return NULL */ private function removeMemberImage(){ $image_id = $this->app->getPostParam("image_id"); @@ -618,16 +618,16 @@ class image implements Core{ $member->delete(); }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + } } /** @@ -637,7 +637,7 @@ class image implements Core{ * @param String $member_id Identifier of the member * @param String $status New status for the member * - * @return void + * @return NULL **/ private function updateMemberImage(){ $image_id = $this->app->getPostParam("image_id"); @@ -665,16 +665,16 @@ class image implements Core{ $member->updateStatus($status); }catch(BadResponseError $e){ $this->app->getErrorInstance()->BadResponseHandler($e); - }catch(UserInputError $e){ + }catch(UserInputError $e){ $this->app->getErrorInstance()->UserInputHandler($e); - }catch(BaseError $e){ + }catch(BaseError $e){ $this->app->getErrorInstance()->BaseErrorHandler($e); - }catch(NotImplementedError $e){ + }catch(NotImplementedError $e){ $this->app->getErrorInstance()->NotImplementedHandler($e); - }catch(Exception $e){ - $this->app->getErrorInstance()->OtherException($e); - } - } + }catch(Exception $e){ + $this->app->getErrorInstance()->OtherException($e); + } + } } } |
