[SOLVED] How to show username without authentication?



  • 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?



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


Log in to reply