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

    22.05 - CP clients have connectivity issues after x amount of time

    Scheduled Pinned Locked Moved Captive Portal
    44 Posts 6 Posters 9.0k 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.
    • L
      level4 @Gertjan
      last edited by

      @gertjan said in 22.05 - CP clients have connectivity issues after x amount of time:

      I did this to restore unique pipeno usage :

      /usr/local/captiveportal/index.html

      	$pipeno = captiveportal_get_next_dn_ruleno('auth', 2000, 64500, true);
      .......
      	}
      	
      	$auth_result = captiveportal_authenticate_user($user, $passwd, $clientmac, $clientip, $pipeno, $context);
      
      

      I changed the true for false on the first line
      Added an 'else' condition.

      	$pipeno = captiveportal_get_next_dn_ruleno('auth', 2000, 64500, false);
      .......
      
      	} else
      		$auth_result = captiveportal_authenticate_user($user, $passwd, $clientmac, $clientip, $pipeno, $context);
      

      Now, if a pipe gets attributed, but the login fails, the pipe will get freed up again.

      My users have now unique pipes.

      @Gertjan
      Would you be so kind to share the modified 22.05- index.php ?
      (Or a real diff)

      I'm having the same issue, and would like to try this fix, but dont really understand what should be changed.

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

        @level4

        Sorry, never managed to make a "diff" - tried many times, but the obtained patch file isn't usefull (for me) otherwise I would use that myself, and it would be easier to communicate here, I agree.

        The original code (from github):

        173c3645-937e-407d-a02e-f8925865a76d-image.png

        Step 1: before the first line "$pipeno = captiveportal_get_next_dn_ruleno('auth',......", add

        $auth_result = array();
        

        Step 2 : change the (now second) line

        $pipeno = captiveportal_get_next_dn_ruleno('auth', 2000, 64500, true);
        

        for

        $pipeno = captiveportal_get_next_dn_ruleno('auth', 2000, 64500, false);
        

        Step 3 - goto the closing line 262 "}"
        and add an "else" behind and remove the following empty line.

        The result looks like :

        3718d708-3d4a-4f6c-8873-6db0d4f2896b-image.png

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

        L 1 Reply Last reply Reply Quote 1
        • L
          level4 @Gertjan
          last edited by

          @gertjan Thanks!

          I'm a total php noob, but;

          That "} else" ..

          shouldn't be a "} else {"

          with a "}" below the "$auth_result =" line ?

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

            @level4 said in 22.05 - CP clients have connectivity issues after x amount of time:

            That "} else" ..
            shouldn't be a "} else {"
            with a "}" below the "$auth_result =" line ?

            You can place

            $auth_result = captiveportal_authenticate_user($user, $passwd, $clientmac, $clientip, $pipeno, $context);
            

            between { .... }, true. Like :

            	.......
            	} else
            	{
            		$auth_result = captiveportal_authenticate_user($user, $passwd, $clientmac, $clientip, $pipeno, $context);
            	}
            

            Or

            	.......
            	} else { $auth_result = captiveportal_authenticate_user($user, $passwd, $clientmac, $clientip, $pipeno, $context); }
            

            But as this is just one line, so no need.

            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 2
            • GertjanG Gertjan referenced this topic on
            • GertjanG Gertjan referenced this topic on
            • GertjanG Gertjan referenced this topic on
            • GertjanG Gertjan referenced this topic on
            • GertjanG Gertjan referenced this topic on
            • GertjanG Gertjan referenced this topic on
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.