mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-22 08:26:16 -04:00
settings: do not create a user if he has no password field, or if his password is null.
This will be used by the settings.json in the default Dockerfile to eschew creating an admin user when no password is set. Closes #3648.
This commit is contained in:
parent
4e758a9f4a
commit
7c099fef5e
2 changed files with 28 additions and 2 deletions
|
@ -629,6 +629,27 @@ exports.reloadSettings = function reloadSettings() {
|
|||
console.info(`Using skin "${exports.skinName}" in dir: ${skinPath}`);
|
||||
}
|
||||
|
||||
if (exports.users) {
|
||||
/*
|
||||
* Prune from export.users any user that has no password attribute, or whose
|
||||
* password attribute is "null".
|
||||
*
|
||||
* This is used by the settings.json in the default Dockerfile to eschew
|
||||
* creating an admin user if no password is set.
|
||||
*/
|
||||
var filteredUsers = _.filter(exports.users, function(user, username) {
|
||||
if ((user.hasOwnProperty("password")) || user.password !== null) {
|
||||
return true;
|
||||
}
|
||||
|
||||
console.warn(`The password for ${username} is null. This means the user must not be created. Removing it.`);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
exports.users = filteredUsers;
|
||||
}
|
||||
|
||||
if (exports.abiword) {
|
||||
// Check abiword actually exists
|
||||
if (exports.abiword != null) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue