/** * Saves the photo from ownCloud FS to oC cache * @return JSONResponse with data.tmp set to the key in the cache. * * @NoAdminRequired * @NoCSRFRequired */ public function cacheFileSystemPhoto() { $params = $this->request->urlParams; $response = new JSONResponse(); if (!isset($this->request->get['path'])) { $response->bailOut(App::$l10n->t('No photo path was submitted.')); } $tempPhoto = TemporaryPhoto::create($this->cache, TemporaryPhoto::PHOTO_FILESYSTEM, $this->request->get['path']); return $response->setParams(array('tmp' => $tempPhoto->getKey(), 'metadata' => array('contactId' => $params['contactId'], 'addressBookId' => $params['addressBookId'], 'backend' => $params['backend']))); }