diff --git a/core/src/Revolution/Processors/Security/User/Create.php b/core/src/Revolution/Processors/Security/User/Create.php index fa7b2019ac..07edf682e2 100644 --- a/core/src/Revolution/Processors/Security/User/Create.php +++ b/core/src/Revolution/Processors/Security/User/Create.php @@ -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, diff --git a/manager/assets/modext/widgets/security/modx.panel.user.js b/manager/assets/modext/widgets/security/modx.panel.user.js index afc6febb33..22f88abce7 100644 --- a/manager/assets/modext/widgets/security/modx.panel.user.js +++ b/manager/assets/modext/widgets/security/modx.panel.user.js @@ -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',