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

    CP Login page based on browser agent

    Scheduled Pinned Locked Moved Captive Portal
    4 Posts 4 Posters 2.6k Views
    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.
    • K Offline
      kucciolo24
      last edited by

      Hello all,
      i would like to create  in CP, 2 login page that can serve normal and mobile users.
      Is this possible in some ways?
      Thank you for your help

      Andrea

      1 Reply Last reply Reply Quote 0
      • T Offline
        topcat
        last edited by

        anyone come up with an answer to this as i'd like to do the same

        Thanks in advance

        1 Reply Last reply Reply Quote 0
        • jimpJ Offline
          jimp Rebel Alliance Developer Netgate
          last edited by

          You can have PHP code in the portal page (at least on 2.0, I thought you could on 1.2.3 but I might be wrong), just make some PHP code that tests for the browser string and if it's non-mobile, give the full page, if it's mobile, give a scaled-down page. Take a look at /usr/local/www/fbegin.inc for some pointers, it changes the theme if it detects a mobile browser.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • M Offline
            MojoTojo
            last edited by

            If i'm not mistaken, you can run PHP code in your CP login page..

            so your CP login page can have a php code to check user_agent / browser  and redirect user to another CP login page based on that..

            if you can only run 1 page for CP (as i see in pFSense) then you can try embedded iframe for that CP page and load pages from external (but still on the PFsense publicly accessible folder www/)

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