|
@@ 368-370 (lines=3) @@
|
| 365 |
|
{ |
| 366 |
|
$oldRegisterFields = $this->module->registrationFields; |
| 367 |
|
$this->module->registrationFields = ['password', 'name']; |
| 368 |
|
if ($this->getIsNewRecord() == false) { |
| 369 |
|
throw new \RuntimeException('Calling "' . __CLASS__ . '::' . __METHOD__ . '" on existing user'); |
| 370 |
|
} |
| 371 |
|
$generatedPassword = false; |
| 372 |
|
if (empty($this->password)) { |
| 373 |
|
// password autogenerate |
|
@@ 401-403 (lines=3) @@
|
| 398 |
|
*/ |
| 399 |
|
public function register() |
| 400 |
|
{ |
| 401 |
|
if ($this->getIsNewRecord() == false) { |
| 402 |
|
throw new \RuntimeException('Calling "' . __CLASS__ . '::' . __METHOD__ . '" on existing user'); |
| 403 |
|
} |
| 404 |
|
if (!$this->module->enableRegistration) { |
| 405 |
|
$this->addError('registration', Yii::t('activeuser_general', 'Registration is not available')); |
| 406 |
|
return false; |