add role user to generated user & update readme
This commit is contained in:
parent
f647a4905c
commit
6630452a1e
@ -58,3 +58,9 @@ frontend
|
||||
vendor/ contains dependent 3rd-party packages
|
||||
environments/ contains environment-based overrides
|
||||
```
|
||||
<p>
|
||||
Для ролей поднять миграцию <br>
|
||||
php yii migrate --migrationPath=@yii/rbac/migrations <br>
|
||||
и выполнить консольный скрипт <br>
|
||||
php yii rbac/init <br>
|
||||
</p>
|
@ -126,6 +126,10 @@ class UserCard extends \common\models\UserCard
|
||||
|
||||
$user->save();
|
||||
|
||||
$auth = Yii::$app->authManager;
|
||||
$authorRole = $auth->getRole('user');
|
||||
$auth->assign($authorRole, $user->id);
|
||||
|
||||
$log = "Логин: " . $email . " Пароль: " . $password . " | ";
|
||||
file_put_contents("log.txt", $log, FILE_APPEND | LOCK_EX);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user