diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-02-24 12:24:52 -0300 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-02-24 12:25:59 -0300 |
commit | b5388f033c51ba1102ec00d8c1d604c6ea39827d (patch) | |
tree | 2c6fff94449bece12e3d46c7c1530d09a3736e8a /usr/local/www | |
parent | 732b160dbac6d6cb3e0be169d517d1a5f1ff523c (diff) | |
download | pfsense-b5388f033c51ba1102ec00d8c1d604c6ea39827d.zip pfsense-b5388f033c51ba1102ec00d8c1d604c6ea39827d.tar.gz |
Fix #2302, save custom uploaded l7 pattern files on config.xml and replicate it to slave
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/diag_patterns.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/usr/local/www/diag_patterns.php b/usr/local/www/diag_patterns.php index e545fc7..da7969e 100755 --- a/usr/local/www/diag_patterns.php +++ b/usr/local/www/diag_patterns.php @@ -42,6 +42,11 @@ require("guiconfig.inc"); //Move the upload file to /usr/local/share/protocols (is_uploaded_file must use tmp_name as argument) if (($_POST['submit'] == gettext("Upload Pattern file")) && is_uploaded_file($_FILES['ulfile']['tmp_name'])) { if(fileExtension($_FILES['ulfile']['name'])) { + if (!is_array($config['l7shaper']['custom_pat'])) + $config['l7shaper']['custom_pat'] = array(); + + $config['l7shaper']['custom_pat'][$_FILES['ulfile']['name']] = base64_encode(file_get_contents($_FILES['ulfile']['tmp_name'])); + write_config(sprintf(gettext("Added custom l7 pattern %s"), $_FILES['ulfile']['name'])); move_uploaded_file($_FILES['ulfile']['tmp_name'], "/usr/local/share/protocols/" . $_FILES['ulfile']['name']); $ulmsg = gettext("Uploaded file to") . " /usr/local/share/protocols/" . htmlentities($_FILES['ulfile']['name']); } |