diff options
author | Chris Buechler <cmb@pfsense.org> | 2011-12-04 17:06:23 -0800 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2011-12-04 17:06:23 -0800 |
commit | 073fb3aa34eca6f2693e61ab4fb65a5418aa38e5 (patch) | |
tree | a78c4f214d39338302f7ae58770a3420ed7b4494 /config | |
parent | fbe6c629255acdd793867dde06d213113e00bc84 (diff) | |
parent | b4d5dd122499491531cb948586d6fa82063866b6 (diff) | |
download | pfsense-packages-073fb3aa34eca6f2693e61ab4fb65a5418aa38e5.tar.gz pfsense-packages-073fb3aa34eca6f2693e61ab4fb65a5418aa38e5.tar.bz2 pfsense-packages-073fb3aa34eca6f2693e61ab4fb65a5418aa38e5.zip |
Merge pull request #110 from Nachtfalkeaw/master
additional freeradius2 changes
Diffstat (limited to 'config')
-rwxr-xr-x | config/freeradius2/freeradius.inc | 105 | ||||
-rw-r--r-- | config/freeradius2/freeradius.xml | 6 |
2 files changed, 54 insertions, 57 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index 6c83f377..56f14086 100755 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -6,7 +6,10 @@ define('RADDB', '/usr/local/etc/raddb'); function freeradius_deinstall_command() { exec("cd /var/db/pkg && pkg_delete `ls | grep freeradius`"); + exec("cd /var/db/pkg && pkg_delete `ls | grep python`"); + exec("cd /var/db/pkg && pkg_delete `ls | grep perl`"); exec("cd /var/db/pkg && pkg_delete `ls | grep libltdl`"); + exec("cd /var/db/pkg && pkg_delete `ls | grep gdbm`"); } function freeradius_install_command() { @@ -27,7 +30,7 @@ function freeradius_install_command() { $rcfile = array(); $rcfile['file'] = 'radiusd.sh'; $rcfile['start'] = '/usr/local/etc/rc.d/radiusd onestart'; - $rcfile['stop'] = '/usr/local/etc/rc.d/radiusd stop'; + $rcfile['stop'] = '/usr/local/etc/rc.d/radiusd onestop'; conf_mount_rw(); write_rcfile($rcfile); conf_mount_ro(); @@ -109,12 +112,6 @@ listen { port = 1813 } - - - - - - security { max_attributes = 200 @@ -297,7 +294,7 @@ modules { cache-size = 5000 } - counter monthly { + counter monthly { filename = \${raddbdir}/db.monthly key = User-Name count-attribute = Acct-Session-Time @@ -364,9 +361,9 @@ instantiate { exec expr daily - weekly - monthly - forever + weekly + monthly + forever } authorize { @@ -488,50 +485,50 @@ function freeradius_users_resync() { $additionaloptions=$user['additionaloptions']; $atrib=''; $head="$username User-Password == ".'"'.$password.'"'; - if ($multiconnect <> '') { - $head .=", Simultaneous-Use := $multiconnect"; - } - if ($userexpiration <> '') { - $head .=", Expiration := ".'"'.$userexpiration.'"'; - } - if ($subnetmask<> '') { - $head .=", Framed-IP-Netmask = $subnetmask"; - } - if ($gateway<> '') { - $head .=", Framed-Route = $gateway"; - } - if ($onlinetime <> '') { - $head .=", Login-Time := ". '"' . $onlinetime .'"'; - } - if ($ip <> '') { - if ($atrib <> '') { $atrib .=","; } - $atrib .="\r\n\tFramed-IP-Address = $ip"; - } - if ($sessiontime <> '') { - if ($atrib <> '') { $atrib .=","; } - $atrib .="\r\n\tSession-Timeout := $sessiontime"; - } - if ($vlanid <> '') { - if ($atrib <> '') { $atrib .=","; } - $atrib .="\r\n\tTunnel-Type = VLAN,\r\n\tTunnel-Medium-Type = IEEE-802,\r\n\tTunnel-Private-Group-ID = \"$vlanid\""; - } - if ($additionaloptions <> '') { - if ($atrib <> '') { $atrib .=","; } - $atrib .="\r\n\t$additionaloptions"; - } - - $conf .= <<<EOD -$head + if ($multiconnect <> '') { + $head .=", Simultaneous-Use := $multiconnect"; + } + if ($userexpiration <> '') { + $head .=", Expiration := ".'"'.$userexpiration.'"'; + } + if ($subnetmask<> '') { + $head .=", Framed-IP-Netmask = $subnetmask"; + } + if ($gateway<> '') { + $head .=", Framed-Route = $gateway"; + } + if ($onlinetime <> '') { + $head .=", Login-Time := ". '"' . $onlinetime .'"'; + } + if ($ip <> '') { + if ($atrib <> '') { $atrib .=","; } + $atrib .="\r\n\tFramed-IP-Address = $ip"; + } + if ($sessiontime <> '') { + if ($atrib <> '') { $atrib .=","; } + $atrib .="\r\n\tSession-Timeout := $sessiontime"; + } + if ($vlanid <> '') { + if ($atrib <> '') { $atrib .=","; } + $atrib .="\r\n\tTunnel-Type = VLAN,\r\n\tTunnel-Medium-Type = IEEE-802,\r\n\tTunnel-Private-Group-ID = \"$vlanid\""; + } + if ($additionaloptions <> '') { + if ($atrib <> '') { $atrib .=","; } + $atrib .="\r\n\t$additionaloptions"; + } + + $conf .= <<<EOD + $head $atrib EOD; - } + } } $filename = RADDB . '/users'; - conf_mount_rw(); + conf_mount_rw(); file_put_contents($filename, $conf); chmod($filename, 0600); - conf_mount_ro(); + conf_mount_ro(); restart_service('freeradius'); } @@ -557,17 +554,17 @@ EOD; } else { $conf .= <<<EOD -client 127.0.0.1 { - secret = pfsense - shortname = localhost -} + client 127.0.0.1 { + secret = pfsense + shortname = localhost + } EOD; } - conf_mount_rw(); + conf_mount_rw(); file_put_contents(RADDB . '/clients.conf', $conf); - conf_mount_ro(); + conf_mount_ro(); restart_service("freeradius"); } ?> diff --git a/config/freeradius2/freeradius.xml b/config/freeradius2/freeradius.xml index 86a3300f..79787e56 100644 --- a/config/freeradius2/freeradius.xml +++ b/config/freeradius2/freeradius.xml @@ -119,17 +119,17 @@ <additional_files_needed> <prefix>/usr/local/pkg/</prefix> <chmod>0775</chmod> - <item>http://www.pfsense.org/packages/config/freeradiusclients.xml</item> + <item>http://www.pfsense.org/packages/config/freeradius2/freeradiusclients.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> <chmod>0775</chmod> - <item>http://www.pfsense.org/packages/config/freeradiussettings.xml</item> + <item>http://www.pfsense.org/packages/config/freeradius2/freeradiussettings.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> <chmod>0775</chmod> - <item>http://www.pfsense.org/packages/config/freeradius.inc</item> + <item>http://www.pfsense.org/packages/config/freeradius2/freeradius.inc</item> </additional_files_needed> <fields> <field> |