aboutsummaryrefslogtreecommitdiffstats
path: root/core/ajax/getavatar.php
diff options
context:
space:
mode:
Diffstat (limited to 'core/ajax/getavatar.php')
-rw-r--r--core/ajax/getavatar.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/core/ajax/getavatar.php b/core/ajax/getavatar.php
new file mode 100644
index 00000000000..66bab0230a6
--- /dev/null
+++ b/core/ajax/getavatar.php
@@ -0,0 +1,14 @@
+<?php
+
+OC_JSON::checkLoggedIn();
+OC_JSON::callCheck();
+
+if(isset($_POST['user'])) {
+ if(isset($_POST['size'])) {
+ OC_JSON::success(array('data' => \OC_Avatar::get($_POST['user'], $_POST['size'])));
+ } else {
+ OC_JSON::success(array('data' => \OC_Avatar::get($_POST['user'])));
+ }
+} else {
+ OC_JSON::error();
+}