summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorkondou <kondou@ts.unde.re>2013-08-08 17:03:19 +0200
committerkondou <kondou@ts.unde.re>2013-08-25 21:04:49 +0200
commit4521b54c672d4111ee578cb7049aca53c79a5eef (patch)
tree61079b79bc5d793c8f37675cba0a584d345cdf3d /settings
parent252548c62cf099e5186ffc323e3cf9494fae3768 (diff)
downloadnextcloud-server-4521b54c672d4111ee578cb7049aca53c79a5eef.tar.gz
nextcloud-server-4521b54c672d4111ee578cb7049aca53c79a5eef.zip
Have /avatar.php as a central avatar-point
Diffstat (limited to 'settings')
-rw-r--r--settings/js/personal.js4
-rw-r--r--settings/templates/personal.php4
2 files changed, 3 insertions, 5 deletions
diff --git a/settings/js/personal.js b/settings/js/personal.js
index 71b4785bbf2..5d4422e48d7 100644
--- a/settings/js/personal.js
+++ b/settings/js/personal.js
@@ -50,9 +50,7 @@ function selectAvatar (path) {
}
function updateAvatar () {
- $.post(OC.filePath('core', 'ajax', 'getavatar.php'), {user: OC.currentUser, size: 128}, function(data){
- $('#avatar img').attr('src', data.data);
- });
+ $('#avatar img').attr('src', OC.filePath('', '', 'avatar.php?user='+OC.currentUser+'&size=128'));
}
$(document).ready(function(){
diff --git a/settings/templates/personal.php b/settings/templates/personal.php
index e0e91cb7de4..f487c847baa 100644
--- a/settings/templates/personal.php
+++ b/settings/templates/personal.php
@@ -84,12 +84,12 @@ if($_['passwordChangeSupported']) {
?>
<?php if ($_['avatar'] === "local"): ?>
-<form id="avatar">
+<form id="avatar" method="post" action="<?php p(\OC_Helper::linkToRoute('settings_ajax_newavatar')); ?>">
<fieldset class="personalblock">
<legend><strong><?php p($l->t('Avatar')); ?></strong></legend>
<img src="<?php print_unescaped(link_to('', 'avatar.php').'?user='.OC_User::getUser().'&size=128'); ?>"><br>
<em><?php p($l->t('Your avatar has to be a square and either a PNG or JPG image')); ?></em><br>
- <div class="inlineblock button" id="uploadavatar"><?php p($l->t('Upload a new avatar')); ?></div>
+ <input type="file" class="inlineblock button" name="files[]" id="uploadavatar" value="<?php p($l->t('Upload a new avatar')); ?>">
<div class="inlineblock button" id="selectavatar"><?php p($l->t('Select a new avatar from your files')); ?></div>
<div class="inlineblock button" id="removeavatar"><?php p($l->t('Remove my avatar')); ?></div>
</fieldset>