Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function delUserImage()
- {
- $userId = $this->params['url']['id'];
- $imageId = $this->params['url']['image'];
- if($userId == $this->userId)
- {
- if(is_numeric($imageId))
- {
- $imageData = $this->HairstyleResult->findById($imageId);
- unlink($imageData['HairstyleResult']['result']);
- $this->HairstyleResult->delete($imageId);
- $response = 'SUCCESS';
- }
- else
- {
- $response = 'ERROR';
- }
- }
- else
- {
- $response = 'ERROR';
- }
- $this->set('response', $response);
- }
Add Comment
Please, Sign In to add comment