Navigation

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

    [SOLVED] How to show username without authentication?

    Captive Portal
    2
    2
    582
    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.
    • D
      dylanh724 last edited by

      EDIT: Solved myself .. this actually DOES work properly (yay) :) I just forgot to include an auth_user since I previously didn't need.. derp. Anyway, this should be useful to know this still works.

      Looking here:

      https://forum.pfsense.org/index.php?topic=44780.0#msg232949

      There is code

      
      diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php
      index 201a234..a85a52b 100755
      --- a/usr/local/captiveportal/index.php
      +++ b/usr/local/captiveportal/index.php
      @@ -197,8 +197,11 @@ EOD;
           } else
               portal_reply_page($redirurl, "error", $errormsg);
       } else if ($_POST['accept'] && $clientip && $config['captiveportal']['auth_method'] == "none") {
      -    captiveportal_logportalauth("unauthenticated",$clientmac,$clientip,"ACCEPT");
      -    portal_allow($clientip, $clientmac, "unauthenticated");
      +       $user = "unauthenticated";
      +       if ($_POST['auth_user'])
      +               $user = $_POST['auth_user'];
      +    captiveportal_logportalauth($user,$clientmac,$clientip,"ACCEPT");
      +    portal_allow($clientip, $clientmac, $user);
       } else {
           /* display captive portal page */
           portal_reply_page($redirurl, "login",null,$clientmac,$clientip);
      
      

      How do I apply this? I opened /usr/local/captiveportal/index.php and edited line 224+

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

      Doesn't seem to be effecting anything .. am I doing something wrong?

      1 Reply Last reply Reply Quote 0
      • K
        kcallis last edited by

        Was this did on 2.0.1 or did you do this on 2.2?

        1 Reply Last reply Reply Quote 0
        • First post
          Last post