Also, checking the "default gateway" checkbox doesn't persist when you re-visit interface_ppp_edit.php.
I've found this problem too. Here is what I've found.
1. User presses "Save"
2. Changes get flushed to config.xml
3. Changes don't get flushed to ppp.conf
4. Go edit the PPP interface again.
5. (Check the default gateway box again because it doesn't remain checked when you open the interface edit page again)
6. Click "Save" button.
7. Note that changes have been propagated to ppp.conf
The ppp_interface_configure function reads config data from conf.xml and its called before "write_config():" in interfaces_ppp_edit.php. So its pulling the old data from config.xml before the call to write the new settings to config.xml.
Here's the end of the POST function in interfaces_ppp_edit.php. I fixed mine by putting the interfaces_ppp_configure(); call after write_config();. BEWARE race condition. I put a sleep(6); command in there too to give the write command time to finish. It's a bad hack, but I'm not good enough to figure out how to do it elegantly.
$ppp['descr'] = $_POST['descr'];
interfaces_ppp_configure();
if (isset($id) && $a_ppps[$id])
$a_ppps[$id] = $ppp;
else
$a_ppps[] = $ppp;
write_config();
header("Location: interfaces_ppp.php");
exit;
}
}
Also, there's a mistake in interfaces_ppp_edit.php line 195. instead of quotes around the word "echo ->
"echo checked"
It should look like this.
<input type="checkbox" value="on" id="defaultgw" name="defaultgw" >
Incidentall, I noticed that its broken in system_gateways_edit.php too, but for a different reason. Code looks like this . . .
but should probably look like the above line, using -> if (isset($pconfig['defaultgw'])) echo "checked";
I tested it and it works.
Gabriel