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

    Need some help: Patch to show usernames without authentication used to work but doesn't work anymore.

    Captive Portal
    2
    3
    353
    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.
    • L
      lexdb
      last edited by lexdb

      Hey everyone,
      I’m here to ask for some help. I’ve got this scenario where I want to be able to capture the usernames that people enter in the captive portal without authentication.
      Someone wrote a patch for it years ago that modifies the portal to do exactly that but sadly I can’t get that to work anymore.This thread sums up exactly what I want to do and has the patch listed too.
      Would really appreciate some help from people more experienced than I am on this subject matter.
      Cheers,
      Lex

      1 Reply Last reply Reply Quote 0
      • GertjanG
        Gertjan
        last edited by Gertjan

        Hi,

        That code still works, although the diff file is old so it can't patched in using the patch command against a recent /usr/local/captiveportal/index.php file.

        Change (nearly to the bottom of the index.php file) :

        } else if ($_POST['accept'] && $clientip && $cpcfg['auth_method'] == "none") {
        	captiveportal_logportalauth("unauthenticated", $clientmac, $clientip, "ACCEPT");
        	portal_allow($clientip, $clientmac, "unauthenticated");
        
        } else {
        

        for

        } else if ($_POST['accept'] && $clientip && $cpcfg['auth_method'] == "none") {
        	$user = "unauthenticated"; // or $user = "Unknown - no USER name entered";
        	if ($_POST['auth_user'])
        		$user = $_POST['auth_user'];
            captiveportal_logportalauth($user, $clientmac, $clientip, "ACCEPT");
            portal_allow($clientip, $clientmac, $user);
        
        } else {
        

        I didn't test-drive this code.

        edit : See this https://redmine.pfsense.org/issues/8361 (proposed in the much bigger https://github.com/pfsense/pfsense/pull/3640 )

        No "help me" PM's please. Use the forum, the community will thank you.
        Edit : and where are the logs ??

        1 Reply Last reply Reply Quote 0
        • L
          lexdb
          last edited by

          Gertjan,

          Thanks for your reply. Fun fact; I've managed to do the same thing yesterday and got it working.
          Good to see that I've done it right. I'll make sure to check the links your provided!

          Thanks again dude.

          Cheers,
          Lex

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