Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter ggedare

    (@ggedare)

    @bcworkz, thanks for the reply. Now I fully understand the purpose of the init function. I read about it but did not fully delugve into really understanding it’s usage.

    Thanks for the Response

    Thread Starter ggedare

    (@ggedare)

    @steve, this what I have done after reading the link you provided.

    add_filter('wp_authenticate_user', 'custom_authentication',10 ,2);
    	
    	function custom_authentication($emailAdd, $password) {
    		global $wpdb, $formErr;
    		
    		if(1 > count($formErr->get_error_messages())){
    			$table = $wpdb->prefix.'finusers';
    			$sql = "SELECT * FROM $table WHERE email_address='$emailAdd' AND password='$password'";
    			$authenticate_user = $wpdb->query($sql);
    			
    			if($authenticate_user!=0){
    				echo "Successful Authenticated user";
    			}else{
    				echo "Failed to authenticate user";
    			}
    		}
    	}

    I still can get the user authenticated using this code, but is this the correct way to this? Any suggestions on adjusting this code would really be of great help.

    Thanks
    Gedare Dorke(@ggedare)

    Thread Starter ggedare

    (@ggedare)

    @steve Stern, Sorry about not getting back to you. Was looking for a action/filter that could help me.

    Thanks

    I will let you if I can get it to work.

    thanks

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