Commit 52d74d1b authored by Ad Schellevis's avatar Ad Schellevis

(captiveportal, new) work in progress, save template

parent 72e0a851
......@@ -143,6 +143,12 @@ class ServiceController extends ApiControllerBase
if (strlen($this->request->getPost("content", "striptags", "")) > 20
|| strlen((string)$template->content) == 0
) {
$temp_filename = 'cp_' . (string)$mdlCP->uuid . '.tmp';
file_put_contents('/tmp/'.$temp_filename, $this->request->getPost("content", "striptags", ""));
// strip defaults from template (standard js libs, etc)
$backend = new Backend();
$response = $backend->configdpRun("captiveportal strip_template", array($temp_filename));
// todo, handle response
// only set data if new content is provided
$template->content = $this->request->getPost("content", "striptags", "");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment