/**
  * @return JsonModel
  * @throws \Exception
  */
 public function pictureAction()
 {
     $user = $this->zfcUserAuthentication()->getIdentity();
     $isPost = $this->getRequest()->isPost();
     $pictureUpload = new PictureHelper();
     if ($isPost) {
         $file = $this->getRequest()->getFiles();
         $pictureUpload->addPictureFromRequest($file, $user->getAccount());
         return new JsonModel(array('message' => 'Picture uploaded'));
     } else {
         return new JsonModel(array('pictureUrl' => $pictureUpload->getPictureUrlFromAccount($user->getAccount())));
     }
 }
Example #2
0
 /**
  * @return JsonModel
  */
 public function agencyLogoAction()
 {
     $accountId = $this->getRequest()->getPost()->get('agency');
     $pictureUpload = new PictureHelper();
     return new JsonModel(array('pictureUrl' => $pictureUpload->getPictureUrlFromAccount($accountId)));
 }