Skip to content

Commit

Permalink
CIVICRM-1737 CiviCRM 5.37.0 - Create User Record now hides the Passwo…
Browse files Browse the repository at this point in the history
…rd field and uses the check isUserRegistrationPermitted - which prevents Administrators from setting passwords for new Users
  • Loading branch information
agileware-justin committed May 18, 2021
1 parent 664c087 commit b37d2b8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions CRM/Contact/Form/Task/Useradd.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,13 @@ public function buildQuickForm() {
$this->add('text', 'cms_name', ts('Username'), ['class' => 'huge']);
$this->addRule('cms_name', 'Username is required', 'required');

if (!$config->userSystem->isUserRegistrationPermitted()) {
$this->add('password', 'cms_pass', ts('Password'), ['class' => 'huge']);
$this->add('password', 'cms_confirm_pass', ts('Confirm Password'), ['class' => 'huge']);
$this->addRule('cms_pass', 'Password is required', 'required');
$this->addRule(['cms_pass', 'cms_confirm_pass'], 'ERROR: Password mismatch', 'compare');
}
$this->add('password', 'cms_pass', ts('Password'), ['class' => 'huge']);
$this->add('password', 'cms_confirm_pass', ts('Confirm Password'), ['class' => 'huge']);
$this->addRule('cms_pass', 'Password is required', 'required');
$this->addRule([
'cms_pass',
'cms_confirm_pass',
], 'ERROR: Password mismatch', 'compare');

$this->add('text', 'email', ts('Email:'), ['class' => 'huge'])->freeze();
$this->addRule('email', 'Email is required', 'required');
Expand Down

0 comments on commit b37d2b8

Please sign in to comment.