Im using users + auth modules in Yii. I've made 3 roles in auth using administration:
auth/role/
Also, in users module
user/profileField
I've made one profile field which will determinate in registration page, what account you want to make
[boolean: true="Company" false="Other"]
Admin acc can be only created in module
I want to assign roles based on this field in registration process. I assume i should write this in this method (?):
/user/controllers/RegistrationController.php:
public function actionRegistration(){...
...
if ($model->save()) {
$profile->user_id=$model->id;
....my role assign here ?...
$profile->save();
...
btw: is it classy to change /user/controllers/RegistrationController.php directly ?
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.