* @PasswordConfirmationRequired
*
* @param string $userId
+ * @param string $avatarScope
* @param string $displayname
* @param string $displaynameScope
* @param string $phone
* @param string $addressScope
* @return DataResponse
*/
- public function saveUserSettings($userId,
+ public function saveUserSettings($userId, $avatarScope,
$displayname, $displaynameScope,
$phone, $phoneScope,
$email, $emailScope,
'status' => 'success',
'data' => array(
'userId' => $userId,
+ 'avatarScope' => $avatarScope,
'displayname' => $displayname,
'displaynameScope' => 'public', // force value for test purposes
'email' => $email,
});
}
self.listenTo(self._config, 'change:' + field + 'Scope', function () {
- self._onScopeChanged(field, self._config.get(field + 'Scope'));
+ self._setFieldScopeIcon(field, self._config.get(field + 'Scope'));
});
});
var pos = ($heading.width() - $heading.find('label').width()) - diff;
scopeMenu.$el.css('right', pos);
- self._onScopeChanged(field, self._config.get(field + 'Scope'));
+ // Restore initial state
+ self._setFieldScopeIcon(field, self._config.get(field + 'Scope'));
});
},
*/
var UserSettings = OC.Backbone.Model.extend({
url: OC.generateUrl('/settings/users/{id}/settings', {id: OC.currentUser}),
+ isNew: function() {
+ return false; // Force PUT on .save()
+ },
parse: function(data) {
if (_.isUndefined(data)) {
return null;
['name' => 'AppSettings#viewApps', 'url' => '/settings/apps', 'verb' => 'GET'],
['name' => 'AppSettings#listApps', 'url' => '/settings/apps/list', 'verb' => 'GET'],
['name' => 'SecuritySettings#trustedDomains', 'url' => '/settings/admin/security/trustedDomains', 'verb' => 'POST'],
- ['name' => 'Users#saveUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'POST'],
+ ['name' => 'Users#saveUserSettings', 'url' => '/settings/users/{username}/settings', 'verb' => 'PUT'],
['name' => 'Users#stats', 'url' => '/settings/users/stats', 'verb' => 'GET'],
['name' => 'LogSettings#setLogLevel', 'url' => '/settings/admin/log/level', 'verb' => 'POST'],
['name' => 'LogSettings#getEntries', 'url' => '/settings/admin/log/entries', 'verb' => 'GET'],