Skip Navigation

[Resolved] New users must be approved by admin

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

This topic contains 14 replies, has 2 voices.

Last updated by maiS 2 months, 3 weeks ago.

Assigned support staff: Nigel.

Author
Posts
#2091237

hi there,
We just had some feedback from the authorities that we need to meet in order to start our company.

One of them is that every user that is being created has to be approved by the admin before they can create a camp. The signup form is here: hidden link

Is it possible to make the user inactive until the admin has approved of the new user profile?

Thanks

#2091673

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

The form to register a user specifies the role the new user has.

You can change the form so that it creates a user with a very basic role—e.g. subscriber—that has no rights to anything other than seeing content on the front of the site.

The approval process can then switch the role of such users to the required role.

You could create a pending role rather than the built-in subscriber role.

WordPress doesn't have any concept of draft users.

#2091921

Hi Nigel,

Thanks for your answer.

So the user role being created right now is an author which is fine. What I need is the "pending" function you mention. Where do I set this up?

Thanks

#2092285

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Simply edit the registration form and change the role of users that the forms create (the setting at the top of the form), which is currently set to author.

Change it to Subscriber, or if you want to use a custom role you can first make one using Access (see https://toolset.com/course-lesson/setting-up-custom-roles-for-members/).

There isn't a pending "function" as such.

#2092713

Okay but how will they then change to authors that are the role that creates camps? It is only the hosts of a camp that creates users. And they need to be able to create camps so we build up the whole site upon this user role. Does it make sense?

#2094091

Hello? did you receive my answer?

#2094125

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

You said somebody needs to approve the users, right?

So that person when approving them changes their status to the relevant author status, while editing their profile in the back end.

If the person approving the users doesn't have access to the back end, you could make a front-end form to edit the user, but that doesn't include the ability to change their role, that would need some custom code to run when the form was submitted.

You would include a generic field in the form, e.g. a checkbox field, to mark the user as approved, and then the cred_save_data API hook to update the role if the field was checked.

https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data
https://developer.wordpress.org/reference/functions/wp_update_user/

#2094191

Ah okay I see - Thanks I will present this to my boss.

#2094195

Oh and also,
When we then change the profile from subscriber to author - is there a way to let the user know that their profile is now changed?

#2095479

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

If you used a front-end form to change the role of the user (via code triggered by the form submission) the form could include a notification sent to the user, yes.

#2099981

Hi Nigel,

I am sorry but i am not sure i am following you here.
So:
1) the user fills out the form and signs up
2) the user is now a subscriber
3) Admin logs into backend
4) Admin changes subscriber to author
5) Then what???

#2101033

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

If the admin changes the user role in the back end then they would need some means to email the user to advise them. Toolset doesn't have any tool to help send such an email.

In my previous message I was talking about using a front-end user edit form to change the role (although the form itself doesn't permit changing the role, but can trigger custom code which does), because the front-end form can be used to send an email notification.

You can either update the role in the back end, which doesn't require code, but which does require some other solution for notifying the user.

Or you can update the role via the front end, which does require code, but will take care of the notification requirement.

#2101071

Ah i see!
Sorry i was just confused 🙂 i will take a look at it - maybe there is a plugin that can activate some email notifications when a user role changes?

#2101141

I found this plugin that can do it: Customize WordPress Emails and Alerts – Better Notifications for WP

#2101143

My issue is resolved now. Thank you!