Here is the code:
pkg/nut.xml: http://pastebin.com/f6qM2F87
pkg/nut.inc: http://pastebin.com/MsYsvUWC
www/status_nut.php : http://pastebin.com/0Zbvbfdb
What I need is for a sync_package() to happen on removal of a UPS, but I
am constrained by using nut.xml. If there was a
<custom_php_remove_command> I could specify in nut.xml, I would just add:
<custom_php_remove_command>
sync_package_nut();
</custom_php_remove_command>
As a workaround for this problem, I am considering writing a new www
page with the table of UPSs which would look the same as
pkg.php?xml=nut.xml, but I would be able add an action to the delete button.
Is this a good solution? Is there a better way? Any advice is appreciated.
On 01/13/2011 12:22 AM, Ermal Luçi wrote:
On Wed, Jan 12, 2011 at 7:52 PM, Grant Joy<[email protected]> wrote:
Hello,
I am rewriting the pfsense NUT package to work with multiple UPSs.
Everything is working, except deleting UPSs. I am using pkg.php and the
<adddeleteeditpagefields> XML tag to create the list of UPSs. What I really
need is for a PHP function to run when the remove button is clicked (one of
my functions defined in nut.inc.)
Is there a way to call a function (like the custom_php functions) on delete?
Am I going to be better off rewriting nut.xml as a /web file?
Thank you,
Grant Joy
A-1 Networks
Send the code to have an answer otherwise nobody can help you.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Commercial support available - https://portal.pfsense.org