-
-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Persist the config changes of usermanagement #23333
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -260,6 +260,10 @@ public function usersList() { | |
$serverData['newUserGenerateUserID'] = $this->config->getAppValue('core', 'newUser.generateUserID', 'no') === 'yes'; | ||
$serverData['newUserRequireEmail'] = $this->config->getAppValue('core', 'newUser.requireEmail', 'no') === 'yes'; | ||
$serverData['newUserSendEmail'] = $this->config->getAppValue('core', 'newUser.sendEmail', 'yes') === 'yes'; | ||
$serverData['showLastLogin'] = $this->config->getAppValue('core', 'users-showlastlogin', 'no') === 'yes'; | ||
$serverData['showLanguages'] = $this->config->getAppValue('core', 'users-showlanguages', 'no') === 'yes'; | ||
$serverData['showUserBackend'] = $this->config->getAppValue('core', 'users-showuserbackend', 'no') === 'yes'; | ||
$serverData['showStoragePath'] = $this->config->getAppValue('core', 'users-showstoragepath', 'no') === 'yes'; | ||
|
||
return new TemplateResponse('settings', 'settings-vue', ['serverData' => $serverData]); | ||
} | ||
|
@@ -271,12 +275,12 @@ public function usersList() { | |
* @return JSONResponse | ||
*/ | ||
public function setPreference(string $key, string $value): JSONResponse { | ||
$allowed = ['newUser.sendEmail']; | ||
$allowed = ['newUser.sendEmail', 'showlastlogin', 'showlanguages', 'showuserbackend', 'showstoragepath']; | ||
if (!in_array($key, $allowed, true)) { | ||
return new JSONResponse([], Http::STATUS_FORBIDDEN); | ||
} | ||
|
||
$this->config->setAppValue('core', $key, $value); | ||
$this->config->setAppValue('core', 'users-'.$key, $value); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ideally we could introduce them as user values so that each admin user has their own setting for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also wouldn't this basically break the existing newUser.sendMail setting since the key would now be prefixed with 'users-' ? |
||
|
||
return new JSONResponse([]); | ||
} | ||
|
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer to have those stored in the 'settings' app instead of 'core', the other one make sense for core since core sends out the email and generates the user id, but the show* settings are really only settings app relevant.