summaryrefslogtreecommitdiffstats
path: root/core/avatar
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-09-01 16:04:39 +0200
committerkondou <kondou@ts.unde.re>2013-09-01 16:04:39 +0200
commitf44cd944e07cdd908d54f0bc3251e7e9be2ad7f8 (patch)
treeb3dcdc2a4f10d1e5d9aac18e51a2e6b29e289975 /core/avatar
parent8de9e3d85ede3b9b6abf166a89c501624d634adc (diff)
downloadnextcloud-server-f44cd944e07cdd908d54f0bc3251e7e9be2ad7f8.tar.gz
nextcloud-server-f44cd944e07cdd908d54f0bc3251e7e9be2ad7f8.zip
Better naming than "ava" & "data", cache timeout, use OC.Router.registerLoadedCallback()
Diffstat (limited to 'core/avatar')
-rw-r--r--core/avatar/controller.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/core/avatar/controller.php b/core/avatar/controller.php
index 85ac251d094..8f1d6a57069 100644
--- a/core/avatar/controller.php
+++ b/core/avatar/controller.php
@@ -41,25 +41,25 @@ class OC_Core_Avatar_Controller {
if (isset($_POST['path'])) {
$path = stripslashes($_POST['path']);
$view = new \OC\Files\View('/'.$user.'/files');
- $avatar = $view->file_get_contents($path);
+ $newAvatar = $view->file_get_contents($path);
}
if (!empty($_FILES)) {
$files = $_FILES['files'];
if ($files['error'][0] === 0) {
- $avatar = file_get_contents($files['tmp_name'][0]);
+ $newAvatar = file_get_contents($files['tmp_name'][0]);
unlink($files['tmp_name'][0]);
}
}
try {
- $ava = new \OC_Avatar();
- $ava->set($user, $avatar);
+ $avatar = new \OC_Avatar();
+ $avatar->set($user, $newAvatar);
\OC_JSON::success();
} catch (\OC\NotSquareException $e) {
- $image = new \OC_Image($avatar);
+ $image = new \OC_Image($newAvatar);
- \OC_Cache::set('tmpavatar', $image->data());
+ \OC_Cache::set('tmpavatar', $image->data(), 7200);
\OC_JSON::error(array("data" => array("message" => "notsquare") ));
} catch (\Exception $e) {
\OC_JSON::error(array("data" => array("message" => $e->getMessage()) ));