prevent accidental self-lockout in multiSelect
This commit is contained in:
parent
b38ff3fb96
commit
85491b6c8f
@ -370,7 +370,14 @@ export class UserListComponent extends ListViewBaseComponent<ViewUser, User> imp
|
||||
* Handler for bulk setting new passwords. Needs multiSelect mode.
|
||||
*/
|
||||
public async resetPasswordsSelected(): Promise<void> {
|
||||
for (const user of this.selectedRows) {
|
||||
if (this.selectedRows.find(row => row.user.id === this.operator.user.id)) {
|
||||
this.raiseError(
|
||||
this.translate.instant(
|
||||
'Note: Your own password will not be changed. Please use the password change dialog instead.'
|
||||
)
|
||||
);
|
||||
}
|
||||
for (const user of this.selectedRows.filter(u => u.user.id !== this.operator.user.id)) {
|
||||
const password = this.repo.getRandomPassword();
|
||||
this.repo.resetPassword(user, password, true);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user