Bug #5683
closed
print_info_box() does not work with pkg_edit.php
Added by BBcan177 . over 8 years ago.
Updated over 8 years ago.
Description
In the pfBlockerNG IPv4 tab, I added a print_info_box() call on user "save", but it does not print the info box to the screen?
Sounds risky :) Is that in the currently published version? i.e.: If I install the package now will I see the print_info_block() in the php?
- Status changed from New to Feedback
- Assignee set to BBcan177 .
I think this is because the print_infox_box() call takes place before the include("head.inc") line, so the HTML environment is not yet set up and there is nothing to print to. In other words the box is being printed long before the html/head/body tags.
So what alternatives/workaround do we have to print a pop-up message?
Well the "usual" way to do it is something like:
if ($_POST['sync']) {
do_clever_stuff();
$savemsg = "pfBlockerNG has successfully synced with the server");
}
pkg.php will automatically print an info_box with that messages when the time comes.
I tried that already ... See post #2 above... Add:
pfblockerng.inc Line: 1765
$savemsg = "Test";
Also tried to set $savemsg as a global variable.
It looks like on clicking the save button you are saving the page via jQuery/AJAX and then the function exits without re-drawing the screen, hence you don't see the info_box. THe only thing I see that might be useful is this:
if ($_GET['savemsg'] != "") {
$savemsg = htmlspecialchars($_GET['savemsg']);
}
So presumably if you do a get to the page with savemsg="The file has been saved", it will generate the pop-up message.
This seems to work as expected and might be of use to you:
pkg.php?xml=/pfblockerng/pfblockerng_v4lists.xml&savemsg=This%20is%20a%20test
Added to my browser address bar this produced the print_info_box
- Status changed from Feedback to Closed
Also available in: Atom
PDF