diff options
author | Colin Smith <colin@pfsense.org> | 2005-02-19 19:45:38 +0000 |
---|---|---|
committer | Colin Smith <colin@pfsense.org> | 2005-02-19 19:45:38 +0000 |
commit | fd9b2470f1a530a6bcb9320380d52044e2ad15ba (patch) | |
tree | f01fd32ca6bd52c60e0e652ecf651881b5d5966a | |
parent | 308a5ced4dde2964ddfcdc4f9e4d7a8d28c9ab05 (diff) | |
download | pfsense-packages-fd9b2470f1a530a6bcb9320380d52044e2ad15ba.tar.gz pfsense-packages-fd9b2470f1a530a6bcb9320380d52044e2ad15ba.tar.bz2 pfsense-packages-fd9b2470f1a530a6bcb9320380d52044e2ad15ba.zip |
Update to working settings code.
-rw-r--r-- | packages/freeradiussettings.xml | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/packages/freeradiussettings.xml b/packages/freeradiussettings.xml index a5a432e7..eced7861 100644 --- a/packages/freeradiussettings.xml +++ b/packages/freeradiussettings.xml @@ -1,22 +1,22 @@ <packagegui> <name>freeradiussettings</name> <title>FreeRADIUS: Settings</title> - <aftersaveredirect>pkg_edit.php?xml=freeradiussettings.xml&id=1</aftersaveredirect> - <tabs> - <tab> + <aftersaveredirect>pkg_edit.php?xml=freeradiussettings.xml&id=0</aftersaveredirect> + <tabs> + <tab> <text>Users</text> <url>/pkg.php?xml=freeradius.xml</url> - </tab> + </tab> <tab> <text>Clients</text> <url>/pkg.php?xml=freeradiusclients.xml</url> - </tab> + </tab> <tab> <text>Settings</text> <url>/pkg_edit.php?xml=freeradiussettings.xml&id=0</url> <active/> </tab> - </tabs> + </tabs> <configpath>installedpackages->package->$packagename->configuration->settings</configpath> <fields> <field> @@ -33,22 +33,23 @@ </field> </fields> <custom_php_command_before_form> - 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(); + Function sync_package() { + global $config; + $fout = fopen("/usr/local/etc/raddb/radiusd.conf.dynamic","w"); + $int_ip = find_interface_ip($config['interfaces'][$_POST['interface']]['if']); + $port = $config['installedpackages']['freeradiussettings']['config'][0]['port']; + fwrite($fout, "{\nipaddr = " . $int_ip); + if($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(); |