summaryrefslogtreecommitdiffstats
path: root/lib/private/avatar.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2015-02-03 14:54:06 +0100
committerRobin Appelman <icewind@owncloud.com>2015-02-03 14:54:06 +0100
commitc644ed89a77387b7430e192b45fd5226703b8b3c (patch)
tree7a468faa1ba70806f59df2fc8daffdfc2972555e /lib/private/avatar.php
parent9e222ec841946d773514f790fcc567c634d27038 (diff)
downloadnextcloud-server-c644ed89a77387b7430e192b45fd5226703b8b3c.tar.gz
nextcloud-server-c644ed89a77387b7430e192b45fd5226703b8b3c.zip
Add a better way to check if an avatar exists for the user
Diffstat (limited to 'lib/private/avatar.php')
-rw-r--r--lib/private/avatar.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/private/avatar.php b/lib/private/avatar.php
index a9d9346d50a..5e234d77bb2 100644
--- a/lib/private/avatar.php
+++ b/lib/private/avatar.php
@@ -43,6 +43,15 @@ class OC_Avatar implements \OCP\IAvatar {
}
/**
+ * Check if an avatar exists for the user
+ *
+ * @return bool
+ */
+ public function exists() {
+ return $this->view->file_exists('avatar.jpg') || $this->view->file_exists('avatar.png');
+ }
+
+ /**
* sets the users avatar
* @param \OC_Image|resource|string $data OC_Image, imagedata or path to set a new avatar
* @throws Exception if the provided file is not a jpg or png image