Please or Register to create posts and topics.

Forum role – user groups

hi @asgaros

Thanks for the info .

I have another question regarding the Forum role . I have to change the forum role to moderator in the registration form.

if we change the role in registration form it should change there also.

And also same thing for the User Groups .so that user can change the user group and forum role in time of registration .

i have added Forum role and User Group drop down in the registration page but how to link those two entities.

the change in the registration form should reflect in the backend as well pls provide the code or solution for this

Hello @aniruddha

It is not possible for normal users to change their role or usergroup because those are intended for administrators to set acccess-permissions for certain users/categories. If it would be possible for users to change their role/usergroup by themself, it would be possible for them to access areas of the forums which should be not accessible for them.

If you want to change this behavior you have to modify a lot of the core-files inside of the plugin as well as adding additional custom-implementations via hooks/filters.

Aniruddha has reacted to this post.
Aniruddha
If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

hi (@asgaros)

i understand the risk and i have to make all users as moderators by default and i want regulate the user group as wellis there a way?

in my form there are three user groups that must be selected by the end users only so

 

Hello @aniruddha

Basically you can use the user_register hook which gets executed when a new user registers. Via this hook you can add the moderator-flag:

update_user_meta($user_id, 'asgarosforum_role', 'moderator');

I dont exactly know which plugin you want to use for adding custom-data to your registration-form, but the usergroups are using the asgarosforum-usergroup taxonomy-name.

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!