Skip to content

Commit 9c68bee

Browse files
committed
Fix User password notification
Only show dialog window for MODX-generated passwords
1 parent b32b9df commit 9c68bee

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

core/src/Revolution/Processors/Security/User/Create.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,8 @@ public function sendNotificationEmail() {
290290
* @return array|string
291291
*/
292292
public function cleanup() {
293-
$passwordNotifyMethod = $this->getProperty('passwordnotifymethod', 's');
294-
if (!empty($passwordNotifyMethod) && $passwordNotifyMethod == 's') {
293+
$passwordNotifyMethod = $this->getProperty('passwordnotifymethod');
294+
if (!empty($passwordNotifyMethod) && $passwordNotifyMethod === 's') {
295295
return $this->success($this->modx->lexicon('user_created_password_message', [
296296
'username' => $this->object->get('username'),
297297
'password' => $this->newPassword,

manager/assets/modext/widgets/security/modx.panel.user.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,20 @@ Ext.extend(MODx.panel.User, MODx.FormPanel, {
531531
xtype: 'radio',
532532
inputValue: 'user_email_specify',
533533
value: 'user_email_specify'
534-
}]
534+
}],
535+
listeners: {
536+
change: {
537+
fn: function(cmp, checked) {
538+
const passwordShowCmp = Ext.getCmp('modx-user-passwordnotifymethod-s');
539+
if (['modx-user-password-genmethod-s', 'modx-user-password-genmethod-user-email-specify'].includes(checked.id)) {
540+
passwordShowCmp.setValue(false);
541+
}
542+
if (checked.id === 'modx-user-password-genmethod-g') {
543+
passwordShowCmp.setValue(true);
544+
}
545+
}
546+
}
547+
}
535548
}, {
536549
id: 'modx-user-panel-newpassword',
537550
xtype: 'panel',

0 commit comments

Comments
 (0)