mirror of
https://github.com/RocketChat/Rocket.Chat.git
synced 2025-12-28 06:47:25 +00:00
Implementing the administration setting for the frequency of notifications about changing user's password. #2995
This commit is contained in:
parent
5ab0702305
commit
e309670706
1
.gitignore
vendored
1
.gitignore
vendored
@ -36,6 +36,7 @@
|
||||
.env
|
||||
.externalToolBuilders
|
||||
.idea
|
||||
.vscode
|
||||
.loadpath
|
||||
.map
|
||||
.metadata
|
||||
|
||||
@ -106,6 +106,11 @@
|
||||
"Accounts_PasswordReset": "Password Reset",
|
||||
"Accounts_OAuth_Proxy_host": "Proxy Host",
|
||||
"Accounts_OAuth_Proxy_services": "Proxy Services",
|
||||
"Accounts_ReceivePasswordChangeLog": "Receive password change log by email",
|
||||
"Accounts_ReceivePasswordChangeLog_Dismiss": "Disabled",
|
||||
"Accounts_ReceivePasswordChangeLog_Immediately": "Immediately with each change",
|
||||
"Accounts_ReceivePasswordChangeLog_Daily": "Daily summary",
|
||||
"Accounts_ReceivePasswordChangeLog_Weekly": "Weekly summary",
|
||||
"Accounts_Registration_AuthenticationServices_Default_Roles": "Default Roles for Authentication Services",
|
||||
"Accounts_Registration_AuthenticationServices_Default_Roles_Description": "Default roles (comma-separated) users will be given when registering through authentication services",
|
||||
"Accounts_Registration_AuthenticationServices_Enabled": "Registration with Authentication Services",
|
||||
|
||||
@ -94,6 +94,11 @@
|
||||
"Accounts_OAuth_Wordpress_id": "WordPress ID",
|
||||
"Accounts_OAuth_Wordpress_secret": "WordPress Secret",
|
||||
"Accounts_PasswordReset": "Resetar senha",
|
||||
"Accounts_ReceivePasswordChangeLog": "Receber log das alterações de senha por e-mail",
|
||||
"Accounts_ReceivePasswordChangeLog_Dismiss": "Desativado",
|
||||
"Accounts_ReceivePasswordChangeLog_Immediately": "Imediatamente a cada alteração",
|
||||
"Accounts_ReceivePasswordChangeLog_Daily": "Resumo diário",
|
||||
"Accounts_ReceivePasswordChangeLog_Weekly": "Resumo semanal",
|
||||
"Accounts_Registration_AuthenticationServices_Enabled": "Registro com os Serviços de Autenticação",
|
||||
"Accounts_RegistrationForm": "Formulário de Registro",
|
||||
"Accounts_RegistrationForm_Disabled": "Desativado",
|
||||
|
||||
@ -102,6 +102,11 @@
|
||||
"Accounts_PasswordReset": "Resetar senha",
|
||||
"Accounts_OAuth_Proxy_host": "Host de Proxy",
|
||||
"Accounts_OAuth_Proxy_services": "Serviços de Proxy",
|
||||
"Accounts_ReceivePasswordChangeLog": "Receber log das alterações de senha por e-mail",
|
||||
"Accounts_ReceivePasswordChangeLog_Dismiss": "Desativado",
|
||||
"Accounts_ReceivePasswordChangeLog_Immediately": "Imediatamente a cada alteração",
|
||||
"Accounts_ReceivePasswordChangeLog_Daily": "Resumo diário",
|
||||
"Accounts_ReceivePasswordChangeLog_Weekly": "Resumo semanal",
|
||||
"Accounts_Registration_AuthenticationServices_Enabled": "Registro com os Serviços de Autenticação",
|
||||
"Accounts_RegistrationForm": "Formulário de Registro",
|
||||
"Accounts_RegistrationForm_Disabled": "Desativado",
|
||||
|
||||
@ -149,6 +149,7 @@ RocketChat.saveUser = function(userId, userData) {
|
||||
}
|
||||
|
||||
if (userData.password && userData.password.trim() && RocketChat.authz.hasPermission(userId, 'edit-other-user-password')) {
|
||||
// TODO #2995
|
||||
Accounts.setPassword(userData._id, userData.password.trim());
|
||||
}
|
||||
|
||||
|
||||
@ -397,7 +397,7 @@ class ModelUsers extends RocketChat.models._Base {
|
||||
requirePasswordChangeReason
|
||||
}
|
||||
};
|
||||
|
||||
// TODO #2995
|
||||
return this.update(_id, update);
|
||||
}
|
||||
|
||||
|
||||
@ -70,6 +70,26 @@ RocketChat.settings.addGroup('Accounts', function() {
|
||||
type: 'boolean',
|
||||
'public': true
|
||||
});
|
||||
// TODO: Implementing #2995
|
||||
this.add('Accounts_ReceivePasswordChangeLog', '', {
|
||||
type: 'select',
|
||||
'public': true,
|
||||
values: [
|
||||
{
|
||||
key: '',
|
||||
i18nLabel: 'Accounts_ReceivePasswordChangeLog_Dismiss'
|
||||
}, {
|
||||
key: 'immediately',
|
||||
i18nLabel: 'Accounts_ReceivePasswordChangeLog_Immediately'
|
||||
}, {
|
||||
key: 'daily',
|
||||
i18nLabel: 'Accounts_ReceivePasswordChangeLog_Daily'
|
||||
}, {
|
||||
key: 'weekly',
|
||||
i18nLabel: 'Accounts_ReceivePasswordChangeLog_Weekly'
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
this.section('Registration', function() {
|
||||
this.add('Accounts_DefaultUsernamePrefixSuggestion', 'user', {
|
||||
|
||||
@ -63,6 +63,7 @@ Template.accountProfile.onCreated(function() {
|
||||
typedPassword
|
||||
};
|
||||
if (_.trim($('#password').val()) && RocketChat.settings.get('Accounts_AllowPasswordChange')) {
|
||||
// TODO #2995
|
||||
data.newPassword = $('#password').val();
|
||||
}
|
||||
if (_.trim($('#realname').val())) {
|
||||
|
||||
@ -50,7 +50,7 @@ Meteor.methods({
|
||||
Meteor.call('setEmail', settings.email);
|
||||
}
|
||||
|
||||
// Should be the last chack to prevent error when trying to check password for users without password
|
||||
// Should be the last check to prevent error when trying to check password for users without password
|
||||
if ((settings.newPassword) && RocketChat.settings.get('Accounts_AllowPasswordChange') === true) {
|
||||
if (!checkPassword(user, settings.typedPassword)) {
|
||||
throw new Meteor.Error('error-invalid-password', 'Invalid password', {
|
||||
@ -58,6 +58,8 @@ Meteor.methods({
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: #2995
|
||||
|
||||
Accounts.setPassword(Meteor.userId(), settings.newPassword, {
|
||||
logout: false
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user