aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--packages/freeradiussettings.xml48
1 files changed, 17 insertions, 31 deletions
diff --git a/packages/freeradiussettings.xml b/packages/freeradiussettings.xml
index 3bf3dfcd..a5a7b369 100644
--- a/packages/freeradiussettings.xml
+++ b/packages/freeradiussettings.xml
@@ -22,7 +22,7 @@
<field>
<fielddescr>Listening Interface(s)</fielddescr>
<fieldname>interface</fieldname>
- <description>Enter the desired listening interface(s) here</description>
+ <description>Enter the desired listening interface here</description>
<type>interfaces_selection</type>
</field>
<field>
@@ -33,36 +33,22 @@
</field>
</fields>
<custom_php_command_before_form>
- function sync_package() {
- global $config;
- $fout = fopen("/usr/local/etc/raddb/radiusd.conf.dynamic","w");
- if($config['installedpackages']['freeradiusclients']['config'] != "") {
- /* Comment out port entries to use listen directives instead.
- if($config['installedpackages']['freeradiussettings']['config']['port'] != "") {
- fwrite($fout, "port = " . $port . "\n\n");
- } else {
- fwrite($fout, "port = 0\n\n");
- }
- */
- if($config['installedpackages']['freeradiussettings']['config']['interface'] != "") {
- $split_int = split(" ", $config['installedpackages']['freeradiussettings']['config']['interface']);
- foreach($split_int as $int) {
- $int_ip = find_interface_ip($int);
- fwrite($fout, "{\nipaddr = " . $int_ip . "\n");
- if($config['installedpackages']['freeradiussettings']['config']['port'] != "") {
- fwrite($fout, "port = " . $config['installedpackages']['freeradiussettings']['config']['port'] . "\n");
- } else {
- fwrite($fout, "port = 0\n");
- }
- fwrite($fout, "type = auth\n}");
- }
- }
- }
- fclose($fout);
- mwexec("killall radiusd");
- mwexec("/usr/local/etc/rc.d/radiusd");
- }
- sync_package();
+ function sync_package() {
+ global $config;
+ $fout = fopen("/usr/local/etc/raddb/radiusd.conf.dynamic","w");
+ $int_ip = find_interface_ip($config['installedpackages']['freeradiussettings']['config']['interface']);
+ fwrite($fout, "{\nipaddr = " . $int_ip);
+ if($config['installedpackages']['freeradiussettings']['config']['port'] != "") {
+ fwrite($fout, "port = " . $port . "\n");
+ } else {
+ fwrite($fout, "port = 0\n");
+ }
+ fwrite($fout, "type = auth\n}\n\n") ;
+ fclose($fout);
+ }
+ mwexec("killall radiusd");
+ mwexec("/usr/local/etc/rc.d/radiusd");
+ sync_package();
</custom_php_command_before_form>
<custom_add_php_command>
sync_package();