Beispiel #1
0
 /**
  * @NoAdminRequired
  *
  * @return DataResponse|DataDisplayResponse
  */
 public function getTmpAvatar()
 {
     $tmpAvatar = $this->cache->get('tmpAvatar');
     if (is_null($tmpAvatar)) {
         return new DataResponse(['data' => ['message' => $this->l->t("No temporary profile picture available, try again")]], Http::STATUS_NOT_FOUND);
     }
     $image = new \OC_Image($tmpAvatar);
     $resp = new DataDisplayResponse($image->data(), Http::STATUS_OK, ['Content-Type' => $image->mimeType()]);
     $resp->setETag(crc32($image->data()));
     $resp->cacheFor(0);
     $resp->setLastModified(new \DateTime('now', new \DateTimeZone('GMT')));
     return $resp;
 }