• Hi,
    I am using a form plugin which enables me to create forms on a fly which then I can map it with registration fields as well.
    Since I needed to customize the form to behave certain way, I hired a developer to do what I need. But it seems that the core of that form plugin has been changed to do just that and I can not use the plugin to create other forms since it is redirecting users to a URL that was set for that particular form.
    I have been able to locate the code in the core that is responsible for this
    which looks like this:

    if( empty($errors) && @count($arf_errors) == 0){
    
                $_POST['arfentrycookie'] = 1;
    
    			if($params['action'] == 'create'){
    
                    if (apply_filters('arfcontinuetocreate', true, $_POST['form_id']) and !isset($arfcreatedentry[$_POST['form_id']]['entry_id']))
    
    				{
    
    					unset($_SESSION['vpb_captcha_code_'.$_POST['form_id']]);
    
                        $arfcreatedentry[$_POST['form_id']]['entry_id'] = $db_record->create( $_POST );
    
    					$return["conf_method"] = "redirect";
    
    					$return["entry_id"] = $arfcreatedentry[$_POST['form_id']]['entry_id'];
    
    					$return["item_meta"] = $_POST['item_meta'];
    
    					$return["org_name"] = slugify($_POST['item_meta'][83]);
    
    					$return["return_url"] = get_permalink(110);
    
    					 $loginusername = $_POST['item_meta'][132];
    					 $loginpassword = $_POST['item_meta'][133];
    
    					 $creds['user_login'] = $loginusername;
    
                		 $creds['user_password'] = $loginpassword;
    
                		 $creds['remember'] = true;
    
               			 $autologin_user = wp_signon( $creds, false );
    
    					 $user = get_user_by('login', $loginusername);
            			 $user_id = $user->ID;
    
    					 wp_set_current_user($user_id, $loginusername);
            			 wp_set_auth_cookie($user_id);
    					mysql_query("insert into wp_usermeta(user_id,meta_key,meta_value) values('$user_id','org_slug','$loginusername')");
    
    					echo json_encode($return);
    
    					exit;
    
    				}
    
                }

    My questions are:
    1- where in this code is being declared what/which role does the user have?
    2- can I modify this code to declare which form number can it be applied to…? (like form #100)

    Greatly appreciate any assistance I get get.

    Regards,

    Dave

The topic ‘Registered User Roles’ is closed to new replies.