Project

General

Profile

« Previous | Next » 

Revision 8ad84ebb

Added by Renato Botelho almost 12 years ago

Remove redundant copies of getNasIP(), it should fix #3234

View differences:

usr/local/captiveportal/radius_authentication.inc
41 41
	pfSense_MODULE:	captiveportal
42 42
*/
43 43

  
44
/**
45
 * Get the NAS-IP-Address based on the current wan address
46
 *
47
 * Use functions in interfaces.inc to find this out
48
 *
49
 */
50
if (!function_exists('getNasIP')) {
51
        function getNasIP()
52
        {
53
                global $config, $cpzone;
54

  
55
                if (empty($config['captiveportal'][$cpzone]['radiussrcip_attribute'])) {
56
                                $nasIp = get_interface_ip();
57
                } else {
58
                        if (is_ipaddr($config['captiveportal'][$cpzone]['radiussrcip_attribute']))
59
                                $nasIp = $config['captiveportal'][$cpzone]['radiussrcip_attribute'];
60
                        else
61
                                $nasIp = get_interface_ip($config['captiveportal'][$cpzone]['radiussrcip_attribute']);
62
                }
63

  
64
                if(!is_ipaddr($nasIp))
65
                        $nasIp = "0.0.0.0";
66

  
67
                return $nasIp;
68
        }
69
}
70

  
71 44
/*
72 45
RADIUS AUTHENTICATION
73 46
---------------------
......
95 68
        	$callingstationid = $clientip;
96 69
        	break;
97 70
        default:
71
            if (!function_exists('getNasIP'))
72
                require_once("captiveportal.inc");
98 73
        	$calledstationid = getNasIP();
99 74
        	$callingstationid = $clientmac;
100 75
		break;

Also available in: Unified diff