Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Depending of the user, redirect to this or that URL. possible ?

    Captive Portal
    2
    2
    1.9k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      rrbranco
      last edited by

      Is it possible to redirect the user (and/or freeradius group) "userX" to URL http://blahX.com and user (and/or freeradius group) "userY" to URL http://blahY.com ?

      Automagically ?  Using PHP ?  "Forget about it !" ?

      Regards from Rio de Janeiro, Brazil.

      1 Reply Last reply Reply Quote 0
      • M
        morbus
        last edited by

        This can be done depending on you php skills.

        if you look at /usr/local/captiveportal/index.php and add some extra code after line 167

        portal_allow($clientip, $clientmac,$_POST['auth_user']);
        

        along the lines of

        if ($_POST['auth_user'] == userX){
             header("Location: http://blahX.com");
        }else{
             header("Location: http://blahY.com");
        }
        

        I think this will work with radius or local users but not pass through MACs or IPs

        1 Reply Last reply Reply Quote 0
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.