Guest User

Untitled

a guest
Jun 22nd, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. function delUserImage()
  2. {
  3. $userId = $this->params['url']['id'];
  4. $imageId = $this->params['url']['image'];
  5.  
  6. if($userId == $this->userId)
  7. {
  8. if(is_numeric($imageId))
  9. {
  10. $imageData = $this->HairstyleResult->findById($imageId);
  11.  
  12. unlink($imageData['HairstyleResult']['result']);
  13. $this->HairstyleResult->delete($imageId);
  14.  
  15. $response = 'SUCCESS';
  16. }
  17. else
  18. {
  19. $response = 'ERROR';
  20. }
  21. }
  22. else
  23. {
  24. $response = 'ERROR';
  25. }
  26.  
  27. $this->set('response', $response);
  28. }
Add Comment
Please, Sign In to add comment