Skip to content

Commit

Permalink
Fix User password notification
Browse files Browse the repository at this point in the history
Only show dialog window for MODX-generated passwords
  • Loading branch information
smg6511 committed Dec 23, 2024
1 parent b32b9df commit 9c68bee
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
4 changes: 2 additions & 2 deletions core/src/Revolution/Processors/Security/User/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ public function sendNotificationEmail() {
* @return array|string
*/
public function cleanup() {
$passwordNotifyMethod = $this->getProperty('passwordnotifymethod', 's');
if (!empty($passwordNotifyMethod) && $passwordNotifyMethod == 's') {
$passwordNotifyMethod = $this->getProperty('passwordnotifymethod');
if (!empty($passwordNotifyMethod) && $passwordNotifyMethod === 's') {
return $this->success($this->modx->lexicon('user_created_password_message', [
'username' => $this->object->get('username'),
'password' => $this->newPassword,
Expand Down
15 changes: 14 additions & 1 deletion manager/assets/modext/widgets/security/modx.panel.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,20 @@ Ext.extend(MODx.panel.User, MODx.FormPanel, {
xtype: 'radio',
inputValue: 'user_email_specify',
value: 'user_email_specify'
}]
}],
listeners: {
change: {
fn: function(cmp, checked) {
const passwordShowCmp = Ext.getCmp('modx-user-passwordnotifymethod-s');
if (['modx-user-password-genmethod-s', 'modx-user-password-genmethod-user-email-specify'].includes(checked.id)) {
passwordShowCmp.setValue(false);
}
if (checked.id === 'modx-user-password-genmethod-g') {
passwordShowCmp.setValue(true);
}
}
}
}
}, {
id: 'modx-user-panel-newpassword',
xtype: 'panel',
Expand Down

0 comments on commit 9c68bee

Please sign in to comment.