addInput(new Form_Select( fwbranch, 'Branch', (is_pkg_installed($g['product_name'] . "-repo")) ? "stable":"development", ["stable" => gettext("Stable"), "development" => gettext("Development")] ))->setHelp('Please select the stable, or the development branch from which to update the system firmware. ' . '
' . 'Use of the development version is at your own risk!'); $form->add($section); $section = new Form_Section('Updates'); /* $section->addInput(new Form_Checkbox( 'allowinvalidsig', 'Unsigned images', 'Allow auto-update firmware images with a missing or invalid digital signature to be used', isset($curcfg['allowinvalidsig']) )); */ $section->addInput(new Form_Checkbox( 'disablecheck', 'Dashboard check', 'Disable the automatic dashboard auto-update check', isset($curcfg['disablecheck']) )); $form->add($section); if (file_exists("/usr/local/bin/git") && $g['platform'] == $g['product_name']) { $section = new Form_Section('GitSync'); $section->addInput(new Form_Checkbox( 'synconupgrade', 'Auto sync on update', 'After updating, sync with the following repository/branch before reboot', isset($gitcfg['synconupgrade']) ))->setHelp('After updating, sync with the following repository/branch before reboot'); if (is_dir("/root/pfsense/pfSenseGITREPO/pfSenseGITREPO")) { exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git config remote.origin.url", $output_str); if (is_array($output_str) && !empty($output_str[0])) { $lastrepositoryurl = $output_str[0]; } unset($output_str); } $section->addInput(new Form_Input( 'repositoryurl', 'Repository URL', 'text', ($gitcfg['repositoryurl'] ? $gitcfg['repositoryurl'] : '') ))->setHelp('The most recently used repository was %s. This repository will be used if the field is left blank.', [$lastrepositoryurl]); if (is_dir("/root/pfsense/pfSenseGITREPO/pfSenseGITREPO")) { exec("cd /root/pfsense/pfSenseGITREPO/pfSenseGITREPO && git branch", $output_str); if (is_array($output_str)) { foreach ($output_str as $output_line) { if (strstr($output_line, '* ')) { $lastbranch = substr($output_line, 2); break; } } unset($output_str); } unset($output_str); } $section->addInput(new Form_Input( 'branch', 'Branch name', 'text', ($gitcfg['branch'] ? $gitcfg['branch'] : '') ))->setHelp('The most recently used branch was "%s". (Usually the branch name is master)' . '
Note: Sync will not be performed if a branch is not specified', [$lastbranch]); $form->add($section); } // e-o-if(file_exista() print($form); include("foot.inc");