From 849edeb4226cd563f912c1ea42d8b987a7669e0e Mon Sep 17 00:00:00 2001 From: Alexander Wilke Date: Tue, 31 Jan 2012 20:28:45 +0100 Subject: Update config/freeradius2/freeradius.inc --- config/freeradius2/freeradius.inc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index 91a9d7f2..7d24ed2e 100644 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -453,8 +453,14 @@ if (is_array($arrusers) && !empty($arrusers)) { $varuserscheckitem = ''; $varusersreplyitem = ''; - // Add the user attributes to each user. - $varuserscheckitem = '"' . $varusersusername . '"' . " Cleartext-Password := " . '"' . $varuserspassword .'"'; + // If someone does not want to use username/password but entry "DEFAULT" instead then we can disable this + if (($users['varusersusername'] == '') && ($users['varuserspassword'] == '')) { + $varuserscheckitem = ''; + } + else { + // Add the user attributes to each user. + $varuserscheckitem = '"' . $varusersusername . '"' . " Cleartext-Password := " . '"' . $varuserspassword .'"'; + } // Add additional CHECK-ITEMS here. Different formatting in "users" file needed. if ($varuserssimultaneousconnect != '') { @@ -549,7 +555,7 @@ if (is_array($arrmacs) && !empty($arrmacs)) { $varmacsaddress = $macs['varmacsaddress']; // We don't need a password but we need this field to make syntac correct for CHECK-ITEMS $varmacspassword = $macs['varmacsaddress']; - + $varmacssimultaneousconnect = ($macs['varmacssimultaneousconnect']?$macs['varmacssimultaneousconnect']:''); $varmacsframedipaddress = $macs['varmacsframedipaddress']; $varmacsframedipnetmask = $macs['varmacsframedipnetmask']; @@ -606,8 +612,14 @@ if (is_array($arrmacs) && !empty($arrmacs)) { $varmacscheckitem = ''; $varmacsreplyitem = ''; - // Add the mac attributes to each mac address. - $varmacscheckitem = "$varmacsaddress" . " Cleartext-Password := " . '"' . $varmacspassword .'"'; + // If someone does not want to use MAC address but entry "DEFAULT" instead then we can disable this + if ($macs['varmacsaddress'] == '') { + $varmacscheckitem = ''; + } + else { + // Add the user attributes to each user. + $varmacscheckitem = "$varmacsaddress" . " Cleartext-Password := " . '"' . $varmacspassword . '"'; + } // Add additional CHECK-ITEMS here. Different formatting in "authorized_macs" file needed. if ($varmacssimultaneousconnect != '') { -- cgit v1.2.3