diff options
Diffstat (limited to 'packages/siproxdusers.xml')
-rw-r--r-- | packages/siproxdusers.xml | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/packages/siproxdusers.xml b/packages/siproxdusers.xml new file mode 100644 index 00000000..9209bf84 --- /dev/null +++ b/packages/siproxdusers.xml @@ -0,0 +1,68 @@ +<packagegui> + <name>siproxdusers</name> + <version>0.5.9</version> + <title>siproxd: Users</title> + <tabs> + <tab> + <text>Settings</text> + <url>/pkg_edit.php?xml=siproxd.xml&id=0</url> + </tab> + <tab> + <text>Users</text> + <url>/pkg.php?xml=siproxdusers.xml</url> + <active/> + </tab> + </tabs> + <configpath>installedpackages->package->$packagename->configuration->settings</configpath> + <adddeleteeditpagefields> + <columnitem> + <fielddescr>Username</fielddescr> + <fieldname>username</fieldname> + </columnitem> + <columnitem> + <fielddescr>Description</fielddescr> + <fieldname>description</fieldname> + </columnitem> + </adddeleteeditpagefields> + <fields> + <field> + <fielddescr>Username</fielddescr> + <fieldname>username</fieldname> + <description>Enter the username here</description> + <type>input</type> + </field> + <field> + <fielddescr>Password</fielddescr> + <fieldname>password</fieldname> + <description>Enter the password here</description> + <type>password</type> + </field> + <field> + <fielddescr>Username Description</fielddescr> + <fieldname>description</fieldname> + <description>Enter the description of the user here</description> + <type>input</type> + </field> + </fields> + <custom_add_php_command> + function sync_package() + { + conf_mount_rw(); + config_lock(); + global $config; + $fout = fopen("/usr/local/etc/siproxd_passwd.cfg","w"); + fwrite($fout, "# This file was automatically generated by the pfSense\n# package management system.\n\n"); + if($config['installedpackages']['siproxdusers']['config'] != "") { + foreach($config['installedpackages']['siproxdusers']['config'] as $rowhelper) { + fwrite($fout, $rowhelper['username'] . " " . $rowhelper['password'] . "\n"); + } + } + fclose($fout); + conf_mount_ro(); + config_unlock(); + system("/usr/bin/killall -HUP siproxd"); + } + sync_package(); + </custom_add_php_command> +</packagegui> + |