Skip to Content Skip to Menu

Auto-approve selected registrations

  • autobahn
  • autobahn
  • OFFLINE
  • Posts: 202
  • Thanks: 38
  • Karma: 4
10 years 4 months ago #246634 by autobahn
Auto-approve selected registrations was created by autobahn
By default new registrations on our website need to be approved by a moderator before the user can log in - many new users prefer offline payment methods and are not approved until payment has been received.

However, this does mean that new users who pay online at the time of registration have to wait until they are approved before they can log in.

Can I use a CB Auto Action as follows to automatically approve new users who pay online at the time of registration?

Type of action: Query

User: Automatic

Trigger: onCPayAfterPaymentStatusUpdateEvent

Query: UPDATE `#__comprofiler` SET `approved`= '1' WHERE `user_id` = '[user_id]'; UPDATE `#__users` SET `block`= '0' WHERE `id`= '[user_id]'

Mode: Internal

Thank you

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 4 months ago #246655 by krileon
Replied by krileon on topic Auto-approve selected registrations
I suggest using CBSubs SQL Actions and performing whatever queries you need on the Activate state. Otherwise you'll need to handle all the conditionals in your CB Auto Action to check for correct plan, plan state, etc..


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

  • autobahn
  • autobahn
  • OFFLINE
  • Posts: 202
  • Thanks: 38
  • Karma: 4
10 years 4 months ago #246656 by autobahn
Replied by autobahn on topic Auto-approve selected registrations
Thank you for your prompt response.

We do not have the SQL Actions plugin installed at present but I did look it up in the CBSubs 3.0 Manual to see what I might be dealing with if I install it.

The section 7.5.6.5 Plans icon area, Integrations Tab, SQL actions sub-tab ends with the following:

Warning:
This plugin should not be used to alter #__user and/or #__comprofiler
tables, the CBFields integration plugin should be used to alter CB Field values
(stored in #__comprofiler table).


As these are the very tables I am looking to modify I think I will put this problem on the back-burner for now and settle for a note in the activation email to the effect that the registration requires approval before access can be granted.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago - 10 years 3 months ago #246678 by krileon
Replied by krileon on topic Auto-approve selected registrations
I don't recommend doing this through queries. You should be able to set "User Approval by Moderator" to "No (override CB)" on the "Workflows" tab of your plan. Then users purchasing that plan won't require moderator approval.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 10 years 3 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • autobahn
  • autobahn
  • OFFLINE
  • Posts: 202
  • Thanks: 38
  • Karma: 4
10 years 3 months ago #246819 by autobahn
Replied by autobahn on topic Auto-approve selected registrations
This is a single plan where those who register online and pay offline need moderator approval (i.e. they are not approved until payment has been received by cheque etc.) before they can log in.

However those who register and pay online at the time of registration should be approved automatically so that they can log in straight away.

So this means that some registrations require moderator approval and some do not, depending on payment method.

I have installed SQL Actions but my SQL expertise is limited and, as the update statement is dependent on the payment gateway ID, I do not feel competent to write the required SQL.

Thank you for your help.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8282
  • Karma: 1443
10 years 3 months ago #246842 by krileon
Replied by krileon on topic Auto-approve selected registrations
I see, then in that case you'll need to write a query to change the fields approval state. The below should do this ok. Please note this will not fire any emails or triggers. So if you've anything acting on the approval triggers or depend on the welcome email then you'll need an API based solution so all of that fires properly.

I've added a note to extend CB Auto Actions with a new type or something of the sort to approve users easily through CB Auto Actions.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum