• Resolved msamavi

    (@msamavi)


    Hi,

    Can you please provide simple usage examples of the following hooks:

    is_logged_in_using_ipbl()
    ipbl_can_auto_login
    ipbl_auto_logged_in

    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author brijeshk89

    (@brijeshk89)

    Sure. Please find the examples below :

    if(is_logged_in_using_ipbl()) {
    echo 'user is logged in via Plugin';
    } else {
    echo 'you need to login';
    }
    
    add_filter('ipbl_can_auto_login', 'my_can_auto_login', 10000, 1);
    
    function my_can_auto_login($return){
    
    	// Do some validation 
    	// if you want to allow auto login return true 
    	// if you want to disallow auto login return false
    	
    	return true;
    }
    
    add_filter('ipbl_auto_logged_in', 'my_post_ipbl_auto_login, 10000, 2);
    
    function my_can_auto_login($user, $logged_in_range){
    
    	// This function is called after a user is just auto logged in by IP Based Login plugin
    	// It will be called only once per session after the session is created
    	
    	// $user will have all the details of the user into which the visitor was logged in
    	
    	// $logged_in_range will have the IP range from the allowed ranges in which the user's IP matched
    	
    	// No return required
    }
    Thread Starter msamavi

    (@msamavi)

    Thanks very much @brijeshk89

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘php snippet samples’ is closed to new replies.