summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2007-06-09 20:54:54 +0000
committerScott Ullrich <sullrich@pfsense.org>2007-06-09 20:54:54 +0000
commit1fadb31de46439a2af64b6247d7af43fa122b85d (patch)
treeb0a578e51be83336e783471989133792eb062698 /etc
parent5c6c1712b8318ecd663a312bb9b5ada9254b868e (diff)
downloadpfsense-1fadb31de46439a2af64b6247d7af43fa122b85d.zip
pfsense-1fadb31de46439a2af64b6247d7af43fa122b85d.tar.gz
Unbreak captive portal images.
Diffstat (limited to 'etc')
-rw-r--r--etc/inc/captiveportal.inc30
1 files changed, 17 insertions, 13 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index c25b7d8..6b0f9a1 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -936,19 +936,23 @@ function captiveportal_write_elements() {
mkdir($g['captiveportal_element_path']);
}
- if (is_array($config['captiveportal']['element'])) {
-
- foreach ($config['captiveportal']['element'] as $data) {
- $fd = @fopen($g['captiveportal_element_path'] . '/' . $data['name'], "wb");
- if (!$fd) {
- printf("Error: cannot open '{$data['name']}' in captiveportal_write_elements().\n");
- return 1;
- }
- $decoded = base64_decode($data['content']);
- fwrite($fd,$decoded);
- fclose($fd);
- }
- }
+ if (is_array($config['captiveportal']['element'])) {
+ conf_mount_rw();
+ foreach ($config['captiveportal']['element'] as $data) {
+ $fd = @fopen($g['captiveportal_element_path'] . '/' . $data['name'], "wb");
+ if (!$fd) {
+ printf("Error: cannot open '{$data['name']}' in captiveportal_write_elements().\n");
+ return 1;
+ }
+ $decoded = base64_decode($data['content']);
+ fwrite($fd,$decoded);
+ fclose($fd);
+ unlink_if_exists("{$g['captiveportal_path']}/{$data['name']}");
+ unlink_if_exists("{$g['captiveportal_path']}/{$data['name']}");
+ mwexec("cd {$g['captiveportal_path']}/ && ln -s {$g['captiveportal_element_path']}/{$data['name']} {$data['name']}");
+ }
+ conf_mount_ro();
+ }
return 0;
}
OpenPOWER on IntegriCloud