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

    (@intoxstudio)

    Yes, you should be able to use the following filter like this:

    add_filter('rua/user/global-access', function($has_access,$user){
        if(isset($_SERVER['HTTP_USER_AGENT']) && preg_match('/agent1|agent2/i', $_SERVER['HTTP_USER_AGENT'])) {
            $has_access = true;
        }
        return $has_access;
    },10,2);

    However, remember that it is really easy to spoof a user agent, leaving your restricted content vulnerable.

    Let me know if this works for you.

    Thread Starter Russell Mann

    (@russell-mann)

    I will try that. In the mean time I found a plugin that simply disables selected plugins, in this case RUA, based on UserAgent strings, Plugin Organizer. And thank you for the warning, I’m familiar with the ease of spoofing the UA. For this application that is OK though.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Allow User Agents’ is closed to new replies.