use PUT to update user settings
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
This commit is contained in:
parent
78f6e29954
commit
d1233b47b0
|
@ -500,6 +500,7 @@ class UsersController extends Controller {
|
|||
* @PasswordConfirmationRequired
|
||||
*
|
||||
* @param string $userId
|
||||
* @param string $avatarScope
|
||||
* @param string $displayname
|
||||
* @param string $displaynameScope
|
||||
* @param string $phone
|
||||
|
@ -512,7 +513,7 @@ class UsersController extends Controller {
|
|||
* @param string $addressScope
|
||||
* @return DataResponse
|
||||
*/
|
||||
public function saveUserSettings($userId,
|
||||
public function saveUserSettings($userId, $avatarScope,
|
||||
$displayname, $displaynameScope,
|
||||
$phone, $phoneScope,
|
||||
$email, $emailScope,
|
||||
|
@ -524,6 +525,7 @@ class UsersController extends Controller {
|
|||
'status' => 'success',
|
||||
'data' => array(
|
||||
'userId' => $userId,
|
||||
'avatarScope' => $avatarScope,
|
||||
'displayname' => $displayname,
|
||||
'displaynameScope' => 'public', // force value for test purposes
|
||||
'email' => $email,
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
});
|
||||
}
|
||||
self.listenTo(self._config, 'change:' + field + 'Scope', function () {
|
||||
self._onScopeChanged(field, self._config.get(field + 'Scope'));
|
||||
self._setFieldScopeIcon(field, self._config.get(field + 'Scope'));
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -77,7 +77,8 @@
|
|||
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'));
|
||||
});
|
||||
},
|
||||
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
*/
|
||||
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;
|
||||
|
|
|
@ -50,7 +50,7 @@ $application->registerRoutes($this, [
|
|||
['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'],
|
||||
|
|
Loading…
Reference in New Issue