Require Admin Approval conditional

12 years 7 months ago - 12 years 7 months ago #176763 by amir00251
Require Admin Approval conditional was created by amir00251
Hello,

I need to make the Required Admin Approval conditional depending on a field value user chooses when is registering. It is a single select field, so I want to probably hack the code to have Admin Approval required if value A was chosen and Admin Approval is not required if value B was chosen from that single select dropdown field.

I appreciate your suggestion as it is very important for my site. Thank you.

I have also a quick question, I want to avoid display of a field in edit Profile. I was thinking that if I set to Read Only, it should not be displayed but it is still displayed. Is this possible?

Please Log in to join the conversation.

12 years 7 months ago #176816 by krileon
Replied by krileon on topic Re: Require Admin Approval conditional

I need to make the Required Admin Approval conditional depending on a field value user chooses when is registering. It is a single select field, so I want to probably hack the code to have Admin Approval required if value A was chosen and Admin Approval is not required if value B was chosen from that single select dropdown field.

Can't guarantee this will work, but you can try incubator project CB Fields using the on before registration trigger. It allows you to alter users fields at various CB triggers conditionally based off field value.

I have also a quick question, I want to avoid display of a field in edit Profile. I was thinking that if I set to Read Only, it should not be displayed but it is still displayed. Is this possible?

You can use CB Privacy to accomplish this. Once installed simply edit your field and disable profile edit view for the field.


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 to join the conversation.

12 years 7 months ago - 12 years 7 months ago #176905 by amir00251
Replied by amir00251 on topic Re: Require Admin Approval conditional
Hello,

Thanks for your guidance. I have tried to use CB Fields.

Trigger: onBeforeUserRegisteration
User: Automatic
Access: Everyone
Conditional: specific field equal to AAAAAAAAA

{now I need to choose a field, operator, and value which will make the registration Require Admin Approval, clearly there is no such field???}

I dont know what field to choose so that Require Admin Approval could be triggered. I still think the code should be changed where condition for Admin Approval is checked. I appreciate if you could make a suggestion to do this. Thank you.

Please Log in to join the conversation.

12 years 7 months ago #177055 by krileon
Replied by krileon on topic Re: Require Admin Approval conditional
I said earlier I can't guarantee it'd work, but was worth a shot. I can't advise you on source edits, sorry. It unfortunately appears the approval field isn't available for changing. Best approach is to probably just develop a plugin to do exactly what you're wanting. You'd need to utilize CBs various triggers to accomplish this. I recommend the below tutorial which also provides an installable example.

www.allmysocials.com/directory/tutorials/item/228-event-triggers


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 to join the conversation.

12 years 7 months ago - 12 years 7 months ago #177118 by amir00251
Replied by amir00251 on topic Re: Require Admin Approval conditional
Hello, if it was single trigger I could work to find a work around but as it has to be combination of several triggers I dont know how to code the php file.

In you example you have

// Initiate the trigger:
global $_PLUGINS;
$_PLUGINS->registerFunction( 'onAfterUserRegistration', 'registered', 'tutorialtriggersPlugin' );

// Define the plugin class:
class tutorialtriggersPlugin extends cbPluginHandler {

// Establish the trigger function:
function registered( $user ) {
var_dump( $user ); // Output the trigger user object variable
}
}

if you had time to guide me on the coding, I can prepare the plugin and upload it here so that others also could use if they did wanted to have admin approval conditional. sorry for taking your time.

Please Log in to join the conversation.

12 years 7 months ago #177147 by krileon
Replied by krileon on topic Re: Require Admin Approval conditional
No, sorry; I can't code this for you. If you need further coding assistance you should hire out to a contract developer from sites like Joomlancers. Please review the tutorial on available triggers, their variables, and how to use them. The $user object is already provided in most cases so changing the approved field or checking against a custom field is already available.


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 to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.327 seconds

Facebook Twitter LinkedIn