diff options
Diffstat (limited to 'packages/freeradiusclients.xml')
-rw-r--r-- | packages/freeradiusclients.xml | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/packages/freeradiusclients.xml b/packages/freeradiusclients.xml index 61fbe5bc..89598ac1 100644 --- a/packages/freeradiusclients.xml +++ b/packages/freeradiusclients.xml @@ -6,6 +6,21 @@ <section>Services</section> <configfile>freeradiusclients.xml</configfile> </menu> + <tabs> + <tab> + <text>Users</text> + <url>/pkg_edit.php?xml=freeradius.xml</url> + </tab> + <tab> + <text>Clients</text> + <url>/pkg_edit.php?xml=freeradiusclients.xml</url> + <active/> + </tab> + <tab> + <text>Settings</text> + <url>/pkg_edit.php?xml=freeradiussettings.xml</url> + </tab> + </tabs> <configpath>installedpackages->package->$packagename->configuration->settings</configpath> <adddeleteeditpagefields> <columnitem> @@ -34,10 +49,12 @@ <description>Enter the client's shortname here</description> <type>input</type> </field> + <field> <fielddescr>Shared Secret</fielddescr> <fieldname>sharedsecret</fieldname> <description>Enter the client's shared secret here</description> <type>password</type> + </field> <field> <fielddescr>Description</fielddescr> <fieldname>description</fieldname> @@ -45,19 +62,13 @@ <type>input</type> </field> </fields> - <custom_php_install_command> - global $config; - system("rm /usr/local/etc/raddb/clients*"); - $fout = fopen("/usr/local/etc/raddb/clients.conf","w"); - fwrite($fout, "client 127.0.0.1 {\n secret = pfsense\n shortname = localhost\n}\n\n"); - fclose($fout); - </custom_php_install_command> <custom_php_command_before_form> function sync_package() { global $config; $fout = fopen("/usr/local/etc/raddb/clients.conf","w"); - if($config['installedpackages']['freeradius']['config'] != "") { - foreach($config['installedpackages']['freeradius']['config'] as $rowhelper) { + if($config['installedpackages']['freeradiusclients']['config'] != "") { + fwrite($fout, "client 127.0.0.1" . "{\n" . "secret = pfsense\n" . "shortname = localhost\n}\n\n"); + foreach($config['installedpackages']['freeradiusclients']['config'] as $rowhelper) { fwrite($fout, "client " . $rowhelper['client'] . "{\n" . "secret = " . $rowhelper['sharedsecret'] . "\nshortname = " . $rowhelper['shortname'] . "\n}\n\n"); } } |