Skip to content

Commit c8f671d

Browse files
authored
Merge pull request #1022 from hyzhakus/patch-2
Update User.php
2 parents 8f2daea + 5127cc1 commit c8f671d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

models/User.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,8 @@ public function validateAuthKey($authKey)
258258
}
259259

260260
/**
261-
* Creates new user account. It generates password if it is not provided by user.
261+
* Creates new user account. If Module::enableGeneratingPassword is set true, this method
262+
* will generate password.
262263
*
263264
* @return bool
264265
*/
@@ -271,7 +272,7 @@ public function create()
271272
$transaction = $this->getDb()->beginTransaction();
272273

273274
try {
274-
$this->password = $this->password == null ? Password::generate(8) : $this->password;
275+
$this->password = ($this->password == null && $this->module->enableGeneratingPassword) ? Password::generate(8) : $this->password;
275276

276277
$this->trigger(self::BEFORE_CREATE);
277278

0 commit comments

Comments
 (0)