Hi,
I think I finally found how to do it.
first, in
/user/local/www/services-captiveportal.php
find and add what are in remarks
if ($a_cp[$cpzone]) {
$cpzoneid = $pconfig['zoneid'] = $a_cp[$cpzone]['zoneid'];
$pconfig['descr'] = $a_cp[$cpzone]['descr'];
$pconfig['cinterface'] = $a_cp[$cpzone]['interface'];
$pconfig['language_cp'] = $a_cp[$cpzone]['language_cp']; // get the language from the config
// Check if is not set then get the global language
if (!isset($pconfig['language_cp'])) {
$pconfig['language_cp'] = $g['language'];
} // Check if is not set then get the global language
$pconfig['maxproc'] = $a_cp[$cpzone]['maxproc'];
$pconfig['maxprocperip'] = $a_cp[$cpzone]['maxprocperip'];
and
$newcp['descr'] = $_POST['descr'];
$newcp['language_cp']=$_POST['language_cp']; // get the language from the post variables
$newcp['maxproc'] = $_POST['maxproc'];
and
$section->addInput(new Form_Select(
'cinterface',
'*Interfaces',
explode(",", $pconfig['cinterface']),
get_configured_interface_with_descr(),
true
))->addClass('general')->setHelp('Select the interface(s) to enable for captive portal.');
// add the input in the form
$section->addInput(new Form_Select(
'language_cp',
'*Language',
$pconfig['language_cp'],
get_locale_list()
))->setHelp('Choose a language for the Captive portal'); // add the input in the form
$section->addInput(new Form_Input(
'maxprocperip',
'Maximum concurrent connections',
'number',
$pconfig['maxprocperip'],
['min' => '0', 'max' => '100']
))->setHelp('Limits the number of concurrent connections to the captive portal HTTP(S) server. This does not set how many users can be logged in ' .
'to the captive portal, but rather how many connections a single IP can establish to the portal web server.');
then in /usr/local/captiveportal/index.php
after
header("Expires: 0");
header("Cache-Control: no-cache, no-store, must-revalidate");
header("Pragma: no-cache");
header("Connection: close");
global $cpzone, $cpzoneid;
$cpzone = strtolower($_REQUEST['zone']);
$cpcfg = $config['captiveportal'][$cpzone];
add
$lang = $config['captiveportal'][$cpzone]['language_cp']; // get the language from the config
putenv("LANG={$lang}");
setlocale(LC_ALL, $lang);
textdomain("pfSense");
bindtextdomain("pfSense", "/usr/local/share/locale");
bind_textdomain_codeset("pfSense", $lang); // apply like done by pfsense
That's all it works for me, I don't know how to show the changes with github.