34 |
34 |
require_once("pfsense-utils.inc");
|
35 |
35 |
require_once("system.inc");
|
36 |
36 |
|
|
37 |
$python_files = glob("{$g['unbound_chroot_path']}/*.py");
|
|
38 |
$python_scripts = array();
|
|
39 |
if (!empty($python_files)) {
|
|
40 |
foreach ($python_files as $file) {
|
|
41 |
$file = pathinfo($file, PATHINFO_FILENAME);
|
|
42 |
$python_scripts[$file] = $file;
|
|
43 |
}
|
|
44 |
}
|
|
45 |
else {
|
|
46 |
$python_scripts = array('' => 'No Python Module scripts found');
|
|
47 |
}
|
|
48 |
|
37 |
49 |
$pconfig['enable'] = config_path_enabled('unbound');
|
38 |
50 |
$pconfig['enablessl'] = config_path_enabled('unbound', 'enablessl');
|
39 |
51 |
$pconfig['strictout'] = config_path_enabled('unbound', 'strictout');
|
... | ... | |
140 |
152 |
$input_errors[] = gettext('A System Domain Local Zone Type of "redirect" is not compatible with dynamic DHCP Registration.');
|
141 |
153 |
}
|
142 |
154 |
|
|
155 |
if (isset($pconfig['python']) &&
|
|
156 |
!array_key_exists(array_get_path($pconfig, 'python_script'), $python_scripts)) {
|
|
157 |
array_del_path($pconfig, 'python_script');
|
|
158 |
$input_errors[] = gettext('The submitted Python Module Script does not exist or is invalid.');
|
|
159 |
}
|
|
160 |
|
143 |
161 |
$display_custom_options = $pconfig['custom_options'];
|
144 |
162 |
$pconfig['custom_options'] = base64_encode(str_replace("\r\n", "\n", $pconfig['custom_options']));
|
145 |
163 |
|
... | ... | |
365 |
383 |
$pconfig['python']
|
366 |
384 |
))->setHelp('Enable the Python Module.');
|
367 |
385 |
|
368 |
|
$python_files = glob("{$g['unbound_chroot_path']}/*.py");
|
369 |
|
$python_scripts = array();
|
370 |
|
if (!empty($python_files)) {
|
371 |
|
foreach ($python_files as $file) {
|
372 |
|
$file = pathinfo($file, PATHINFO_FILENAME);
|
373 |
|
$python_scripts[$file] = $file;
|
374 |
|
}
|
375 |
|
}
|
376 |
|
else {
|
377 |
|
$python_scripts = array('' => 'No Python Module scripts found');
|
378 |
|
}
|
379 |
|
|
380 |
386 |
$section->addInput(new Form_Select(
|
381 |
387 |
'python_order',
|
382 |
388 |
'Python Module Order',
|
Improve validation of DNS Resolver Python script. Fixes #15135