• Resolved graphdevigner

    (@graphdevigner)


    We have a medical site that requires the ability for doctors to register and view pages. However, only doctors will be allowed to register. To prevent non-medical professionals from registering, we thought about using their MP (medical practioner) number as a verification step. In other words, if the visitor wants to register – they need to enter a valid MP number. Failing to do so would prevent the visitor from being able to register. Here are the steps in more detail:

    1. Doctor clicks link to register on the site
    2. Usual details (Name, Surname, email, password) are required – but also an MP number, which they enter
    3. The query scans a database located on the site, containing 12,000+ MP numbers. We thought about either regularly dumping a database list into the WP backend and using some SQL code to verify the numbers, else linking it via a SQL connection to a site that has the database stored and updated on a regular basis
    4. Either that MP number just needs to match, or surname and MP number
    5. Once successful, it will create the user in WordPress, and enable them to view doctor-specific content (which won’t be viewable to the public)

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @graphdevigner

    You can try this code snippet to add extra validation to the MP number field on registration:

    add_action("um_submit_form_register","um_022421_submit_form_error");
    function um_022421_submit_form_error( $post_form ){
      
        if(  isset( $post_form['my_mp_field_key'] ) && ! empty( $post_form['my_mp_field_key'] ) ){
             // do more stuff here if( $post_form['my_mp_field_key'] == 'mp' )
    
            // register the error
           	UM()->form()->add_error('my_mp_field_key', __( 'MP is Invalid', 'ultimate-member' ) );
    			
        }  
    
    }

    `

    Regards,

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @graphdevigner

    This thread has been inactive for a while so we’re going to go ahead and mark it Resolved.

    Please feel free to re-open this thread by changing the Topic Status to ‘Not Resolved’ if any other questions come up and we’d be happy to help. 🙂

    Regards,

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘User Registration For Database Driven Membership Numbers Only’ is closed to new replies.