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

    Captive portal LDAP Auth

    Scheduled Pinned Locked Moved Captive Portal
    3 Posts 3 Posters 2.5k 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.
    • M
      Milkwyrm
      last edited by

      I have upgraded 2 Alix boxes to 2.1 from 2.0.3 and both now throw this error when I go to Diagnostics -> Authentication:

      Fatal error: Cannot redeclare getNasIP() (previously declared in /usr/local/captiveportal/radius_authentication.inc:53) in /etc/inc/captiveportal.inc on line 1576

      Only one of these has captive portal enabled (testing LDAP auth), but both have the error.

      any ideas?

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

        workaround:

        put

        if (!function_exists('getNasIP')) { 
        

        in /etc/inc/captiveportal.inc on line 1576

        and close the bracket '}' after the function.

        1 Reply Last reply Reply Quote 0
        • C
          carlosesteves
          last edited by

          Working if change an part the code existent for it:

          vi /etc/inc/captiveportal.inc

          Code:
          if (!function_exists('getNasIP')) {
          /function getNasIP()
          {
          /

                  global $config, $cpzone;

          if (empty($config['captiveportal'][$cpzone]['radiussrcip_attribute'])) {
                                  $nasIp = get_interface_ip();
                  } else {
                          if (is_ipaddr($config['captiveportal'][$cpzone]['radiussrcip_attribute']))
                                  $nasIp = $config['captiveportal'][$cpzone]['radiussrcip_attribute'];
                          else
                                  $nasIp = get_interface_ip($config['captiveportal'][$cpzone]['radiussrcip_attribute']);
                  }

          if(!is_ipaddr($nasIp))
                          $nasIp = "0.0.0.0";

          return $nasIp;
          }

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