Revision f3f98e97
Added by Phillip Davis almost 6 years ago
BOOTSTRAP.md | ||
---|---|---|
11 | 11 |
* html attributes should be using double-quoted attribute-values. This means your php-code should probably use single-quoted strings |
12 | 12 |
* we use icons for status-indication and buttons for actions |
13 | 13 |
* **do not** refactor any of the 'backend' code that is on top of each file. Only changes necessary after updating are acceptable; any other changes will be rejected (including changes that were done upstream) |
14 |
* we accepth both [K&R](https://en.wikipedia.org/wiki/Indent_style#K.26R_style) and [ZF](http://framework.zend.com/manual/1.12/en/coding-standard.html) styled code, the above guidelines have a higher precedence
|
|
14 |
* we accept both [K&R](https://en.wikipedia.org/wiki/Indent_style#K.26R_style) and [ZF](http://framework.zend.com/manual/1.12/en/coding-standard.html) styled code, the above guidelines have a higher precedence |
|
15 | 15 |
|
16 | 16 |
If you feel adventurous you can sometimes rewrite some PHP & javascript code as well; but try to keep this to a minimum. |
17 | 17 |
|
18 | 18 |
# Development setup |
19 | 19 |
|
20 |
We suggest you setup a development enviroment for testing your changes. This can be done with either Virtualbox or Qemu. |
|
20 |
We suggest you setup a development environment for testing your changes. This can be done with either Virtualbox or Qemu.
|
|
21 | 21 |
|
22 | 22 |
## Qemu |
23 | 23 |
|
src/etc/inc/acb.inc | ||
---|---|---|
134 | 134 |
return; |
135 | 135 |
} |
136 | 136 |
|
137 |
// Seperator used during client / server communications
|
|
137 |
// Separator used during client / server communications
|
|
138 | 138 |
$oper_sep = "\|\|"; |
139 | 139 |
|
140 | 140 |
// Encryption password |
src/etc/inc/auth.inc | ||
---|---|---|
1643 | 1643 |
} |
1644 | 1644 |
if (!is_ipaddr($nasip)) { |
1645 | 1645 |
$nasip = get_interface_ip($nasip); |
1646 |
|
|
1646 |
|
|
1647 | 1647 |
if (!is_ipaddr($nasip)) { |
1648 | 1648 |
$nasip = get_interface_ip();//We use wan interface IP as fallback for NAS-IP-Address |
1649 | 1649 |
} |
... | ... | |
1652 | 1652 |
|
1653 | 1653 |
$rauth->putAttribute(RADIUS_NAS_IP_ADDRESS, $nasip, "addr"); |
1654 | 1654 |
$rauth->putAttribute(RADIUS_NAS_IDENTIFIER, $nasid); |
1655 |
|
|
1655 |
|
|
1656 | 1656 |
if(!empty($attributes['calling_station_id'])) { |
1657 | 1657 |
$rauth->putAttribute(RADIUS_CALLING_STATION_ID, $attributes['calling_station_id']); |
1658 | 1658 |
} |
... | ... | |
1663 | 1663 |
} |
1664 | 1664 |
if(!empty($attributes['nas_port_type'])) { |
1665 | 1665 |
$rauth->putAttribute(RADIUS_NAS_PORT_TYPE, $attributes['nas_port_type']); |
1666 |
}
|
|
1666 |
} |
|
1667 | 1667 |
if(!empty($attributes['nas_port'])) { |
1668 | 1668 |
$rauth->putAttribute(RADIUS_NAS_PORT, intval($attributes['nas_port']), 'integer'); |
1669 | 1669 |
} |
... | ... | |
1686 | 1686 |
$ret = false; |
1687 | 1687 |
} |
1688 | 1688 |
|
1689 |
|
|
1689 |
|
|
1690 | 1690 |
// Get attributes, even if auth failed. |
1691 | 1691 |
if ($rauth->getAttributes()) { |
1692 | 1692 |
$attributes = array_merge($attributes,$rauth->listAttributes()); |
... | ... | |
1697 | 1697 |
$stt = strtotime(preg_replace("/\+(\d+):(\d+)$/", " +\${1}\${2}", preg_replace("/(\d+)T(\d+)/", "\${1} \${2}",$stt))); |
1698 | 1698 |
} |
1699 | 1699 |
} |
1700 |
|
|
1700 |
|
|
1701 | 1701 |
// close OO RADIUS_AUTHENTICATION |
1702 | 1702 |
$rauth->close(); |
1703 | 1703 |
|
... | ... | |
1890 | 1890 |
} |
1891 | 1891 |
|
1892 | 1892 |
/* |
1893 |
Possible return values :
|
|
1893 |
Possible return values : |
|
1894 | 1894 |
true : authentication worked |
1895 |
false : authentication failed (invalid login/password, not enought permission, etc...)
|
|
1895 |
false : authentication failed (invalid login/password, not enough permission, etc...) |
|
1896 | 1896 |
null : error during authentication process (unable to reach remote server, etc...) |
1897 | 1897 |
*/ |
1898 | 1898 |
function authenticate_user($username, $password, $authcfg = NULL, &$attributes = array()) { |
src/etc/inc/auth_check.inc | ||
---|---|---|
19 | 19 |
* limitations under the License. |
20 | 20 |
*/ |
21 | 21 |
/* |
22 |
* Light weight authentication check thats ment as a substitute for guiconfig.inc
|
|
22 |
* Light weight authentication check that is meant as a substitute for guiconfig.inc
|
|
23 | 23 |
* in cases where frequent automatic requests are made like graphs and widget pages. |
24 | 24 |
*/ |
25 | 25 |
|
src/etc/inc/auth_func.inc | ||
---|---|---|
26 | 26 |
*/ |
27 | 27 |
|
28 | 28 |
/* |
29 |
* Function put in seperate file to avoid processing priv.inc which is cpu intensive
|
|
29 |
* Function put in separate file to avoid processing priv.inc which is cpu intensive
|
|
30 | 30 |
* cmp_page_matches is used by both auth_check.inc and priv.inc which is used by guiconfig.inc |
31 | 31 |
*/ |
32 | 32 |
|
src/etc/inc/captiveportal.inc | ||
---|---|---|
2304 | 2304 |
|
2305 | 2305 |
if ($attributes['voucher']) { |
2306 | 2306 |
$remaining_time = $attributes['session_timeout']; |
2307 |
$authmethod = "voucher"; // Set RADIUS-Attribute to Voucher to prevent ReAuth-Reqeuest for Vouchers Bug: #2155
|
|
2307 |
$authmethod = "voucher"; // Set RADIUS-Attribute to Voucher to prevent ReAuth-Request for Vouchers Bug: #2155 |
|
2308 | 2308 |
$context = "voucher"; |
2309 | 2309 |
} |
2310 | 2310 |
|
2311 | 2311 |
$writecfg = false; |
2312 |
/* If both "Add MAC addresses of connected users as pass-through MAC" and "Disable concurrent logins" are checked,
|
|
2313 |
then we need to check if the user was already authenticated using another MAC Address, and if so remove the previous Pass-Through MAC. */
|
|
2312 |
/* If both "Add MAC addresses of connected users as pass-through MAC" and "Disable concurrent logins" are checked, |
|
2313 |
then we need to check if the user was already authenticated using another MAC Address, and if so remove the previous Pass-Through MAC. */ |
|
2314 | 2314 |
if ((isset($config['captiveportal'][$cpzone]['noconcurrentlogins'])) && ($username != 'unauthenticated') && isset($config['captiveportal'][$cpzone]['passthrumacadd'])) { |
2315 | 2315 |
$mac = captiveportal_passthrumac_findbyname($username); |
2316 | 2316 |
if (!empty($mac)) { |
src/etc/inc/config.lib.inc | ||
---|---|---|
292 | 292 |
******/ |
293 | 293 |
/* mount flash card read/write */ |
294 | 294 |
function conf_mount_rw() { |
295 |
/* Obsoleted. Keep it here untill all calls are removed */
|
|
295 |
/* Obsoleted. Keep it here until all calls are removed */ |
|
296 | 296 |
return; |
297 | 297 |
} |
298 | 298 |
|
... | ... | |
303 | 303 |
* null |
304 | 304 |
******/ |
305 | 305 |
function conf_mount_ro() { |
306 |
/* Obsoleted. Keep it here untill all calls are removed */
|
|
306 |
/* Obsoleted. Keep it here until all calls are removed */ |
|
307 | 307 |
return; |
308 | 308 |
} |
309 | 309 |
|
... | ... | |
467 | 467 |
global $config, $g; |
468 | 468 |
|
469 | 469 |
// Certain strings may be embedded in the $desc (reason) parameter to trigger certain behavior. |
470 |
// If detected, those strings are reomved and a variable set.
|
|
470 |
// If detected, those strings are removed and a variable set.
|
|
471 | 471 |
$doacb = true; |
472 | 472 |
$manual_acb = false; |
473 | 473 |
$rcnt = 0; |
src/etc/inc/copynotice.inc | ||
---|---|---|
29 | 29 |
##|*IDENT=page-system-copyright |
30 | 30 |
##|*NAME=System: Copyright notice |
31 | 31 |
##|*DESCR=Copyright and usage notice. |
32 |
##|*MATCH=copynitice.inc*
|
|
32 |
##|*MATCH=copynotice.inc*
|
|
33 | 33 |
##|-PRIV |
34 | 34 |
|
35 | 35 |
/* |
36 |
* This file deisplays the copyright modal when required. (New version installed or completion of the setup wizard)
|
|
36 |
* This file displays the copyright modal when required. (New version installed or completion of the setup wizard) |
|
37 | 37 |
* The copyright text may have been downloaded from the Netgate server, but if not the default text defined here |
38 | 38 |
* is used |
39 | 39 |
*/ |
src/etc/inc/interfaces.inc | ||
---|---|---|
4815 | 4815 |
if (isset($wancfg['dhcp6withoutra'])) { |
4816 | 4816 |
/* |
4817 | 4817 |
* Start dhcp6c here if we don't want to wait for ra - calls |
4818 |
* seperate function
|
|
4818 |
* separate function
|
|
4819 | 4819 |
* |
4820 | 4820 |
* In this mode dhcp6c launches rtsold via its script. RTSOLD |
4821 | 4821 |
* will then run the configure on receipt of the RA. |
src/etc/inc/parser_dhcpv6_leases.inc | ||
---|---|---|
446 | 446 |
* This part handles matching properly placed curly braces and semicolons. |
447 | 447 |
* If in doubt just do experiments! To achieve matching the curly braces we need |
448 | 448 |
* to check at all levels however we do just capture it all since matching the |
449 |
* individual components needs to be handled separatly at each level by other |
|
449 |
* individual components needs to be handled separately at each level by other
|
|
450 | 450 |
* regexes. |
451 | 451 |
* Same idea as with base_regex above, but not expanded to save space. |
452 | 452 |
*/ |
src/etc/inc/parser_ipv6.inc | ||
---|---|---|
31 | 31 |
* # Comment under Free-spacing mode. |
32 | 32 |
* If free-spacing mode is not on one can use (?#Some comment) |
33 | 33 |
* |
34 |
* (?(DEFINE) Subpatthern.
|
|
34 |
* (?(DEFINE) Subpattern. |
|
35 | 35 |
* Defines a subpattern that we intend to use |
36 | 36 |
* |
37 | 37 |
* (?'hexncolon' A named group. |
... | ... | |
62 | 62 |
* |
63 | 63 |
* (?> Atomic (capturing) group. |
64 | 64 |
* When it has a match it throws away all backtracking info it might have |
65 |
* meaning it won't try alternatations if there e.g. is a |.
|
|
65 |
* meaning it won't try alternations if there e.g. is a |. |
|
66 | 66 |
* |
67 | 67 |
* \G We use \G once to alternate away from acceptable characters and instead |
68 | 68 |
* match from the point where the last match ended. In our case below it is |
... | ... | |
181 | 181 |
* Enumerated comments/documentation |
182 | 182 |
* |
183 | 183 |
* 1. |
184 |
* check_noclosingsinglecolon checks with negative lookahed what we 'anti' match |
|
184 |
* check_noclosingsinglecolon checks with negative lookahead what we 'anti' match
|
|
185 | 185 |
* (remember we do not capture with negative lookahead). |
186 | 186 |
* check_noclosingsinglecolon defines inside (the inner check) the opposite of |
187 | 187 |
* what we match. Therefore 'anti' match. |
src/etc/inc/pkg-utils.inc | ||
---|---|---|
140 | 140 |
stream_set_blocking($pipes[1], 0); |
141 | 141 |
stream_set_blocking($pipes[2], 0); |
142 | 142 |
|
143 |
/* XXX: should be a tunnable? */
|
|
143 |
/* XXX: should be a tunable? */ |
|
144 | 144 |
$timeout = 60; // seconds |
145 | 145 |
$error_log = ''; |
146 | 146 |
|
... | ... | |
277 | 277 |
pkg_debug("Installing package {$shortname}\n"); |
278 | 278 |
if ($force || !is_pkg_installed($pkg_name)) { |
279 | 279 |
$result = pkg_call("install -y " . $pkg_force . $pkg_name); |
280 |
/* Cleanup cacke to free disk space */
|
|
280 |
/* Cleanup cache to free disk space */
|
|
281 | 281 |
pkg_call("clean -y"); |
282 | 282 |
} |
283 | 283 |
|
... | ... | |
294 | 294 |
pkg_debug("Removing package {$shortname}\n"); |
295 | 295 |
if (is_pkg_installed($pkg_name)) { |
296 | 296 |
pkg_call("delete -y " . $pkg_name); |
297 |
/* Cleanup unecessary dependencies */ |
|
297 |
/* Cleanup unnecessary dependencies */
|
|
298 | 298 |
pkg_call("autoremove -y"); |
299 | 299 |
} |
300 | 300 |
} |
... | ... | |
1073 | 1073 |
} |
1074 | 1074 |
|
1075 | 1075 |
/* |
1076 |
* Used during upgrade process or retore backup process, verify all |
|
1076 |
* Used during upgrade process or restore backup process, verify all
|
|
1077 | 1077 |
* packages installed in config.xml and install pkg accordingly |
1078 | 1078 |
*/ |
1079 | 1079 |
function package_reinstall_all() { |
src/etc/inc/upgrade_config.inc | ||
---|---|---|
2070 | 2070 |
$rrdinterval = 60; |
2071 | 2071 |
$valid = $rrdinterval * 2; |
2072 | 2072 |
|
2073 |
/* Asume GigE for now */ |
|
2073 |
/* Assume GigE for now */
|
|
2074 | 2074 |
$downstream = 125000000; |
2075 | 2075 |
$upstream = 125000000; |
2076 | 2076 |
|
... | ... | |
2781 | 2781 |
$rrdinterval = 60; |
2782 | 2782 |
$valid = $rrdinterval * 2; |
2783 | 2783 |
|
2784 |
/* Asume GigE for now */ |
|
2784 |
/* Assume GigE for now */
|
|
2785 | 2785 |
$downstream = 125000000; |
2786 | 2786 |
$upstream = 125000000; |
2787 | 2787 |
|
... | ... | |
5783 | 5783 |
function generate_usermanager_radius_config($cpzone, $counter, $protocol, $ip, $key, $port, $radiussrcip_attribute, $is_accounting=false, $accounting_port=false) { |
5784 | 5784 |
global $config; |
5785 | 5785 |
$pconfig = array(); |
5786 |
|
|
5786 |
|
|
5787 | 5787 |
if (!is_array($config['system']['authserver'])) { |
5788 | 5788 |
$config['system']['authserver'] = array(); |
5789 | 5789 |
} |
5790 |
|
|
5790 |
|
|
5791 | 5791 |
$pconfig['name'] = "Auto generated from Captive Portal {$cpzone}"; |
5792 | 5792 |
if ($counter != 1) { |
5793 | 5793 |
$pconfig['name'] .= " {$counter}"; |
... | ... | |
5800 | 5800 |
$pconfig['radius_timeout'] = 3; |
5801 | 5801 |
$pconfig['radius_auth_port'] = $port; |
5802 | 5802 |
$pconfig['radius_nasip_attribute'] = $radiussrcip_attribute; |
5803 |
|
|
5803 |
|
|
5804 | 5804 |
if($is_accounting) { |
5805 | 5805 |
$pconfig['radius_srvcs'] = "both"; |
5806 | 5806 |
$pconfig['radius_acct_port'] = $accounting_port; |
5807 | 5807 |
} |
5808 |
|
|
5808 |
|
|
5809 | 5809 |
$config['system']['authserver'][] = $pconfig; |
5810 |
|
|
5810 |
|
|
5811 | 5811 |
return 'radius - '.$pconfig['name']; |
5812 | 5812 |
} |
5813 | 5813 |
|
... | ... | |
5817 | 5817 |
|
5818 | 5818 |
if (is_array($config['captiveportal'])) { |
5819 | 5819 |
foreach ($config['captiveportal'] as $cpzone => $cp) { |
5820 |
// we flush any existing sqlite3 db.
|
|
5820 |
// we flush any existing sqlite3 db. |
|
5821 | 5821 |
// It will be automatically re-generated on next captiveportal_readdb()/captiveportal_writedb() |
5822 | 5822 |
$db_path = "{$g['vardb_path']}/captiveportal{$cpzone}.db"; |
5823 | 5823 |
unlink_if_exists($db_path); |
5824 |
|
|
5825 |
if ($cp['auth_method'] === 'radius') { // Radius Auth
|
|
5824 |
|
|
5825 |
if ($cp['auth_method'] === 'radius') { // Radius Auth |
|
5826 | 5826 |
$auth_servers = array(); |
5827 | 5827 |
$auth_servers2 = array(); |
5828 | 5828 |
$radiuscounter = 1; |
5829 |
|
|
5829 |
|
|
5830 | 5830 |
if (intval($cp['radiusport']) == 0) { |
5831 | 5831 |
$cp['radiusport'] = 1812; |
5832 | 5832 |
} |
... | ... | |
5837 | 5837 |
$cp['radiussrcip_attribute'] = 'wan'; |
5838 | 5838 |
} |
5839 | 5839 |
$auth_servers[] = generate_usermanager_radius_config($cpzone, $radiuscounter, $cp['radius_protocol'], $cp['radiusip'], $cp['radiuskey'], $cp['radiusport'], $cp['radiussrcip_attribute'], isset($cp['radacct_enable']), $cp['radiusacctport']); |
5840 |
|
|
5840 |
|
|
5841 | 5841 |
if (!empty($cp['radiusip2'])) { |
5842 | 5842 |
$radiuscounter++; |
5843 | 5843 |
if (intval($cp['radiusport2']) == 0) { |
5844 | 5844 |
$cp['radiusport2'] = 1812; |
5845 |
}
|
|
5846 |
$auth_servers[] = generate_usermanager_radius_config($cpzone, $radiuscounter, $cp['radius_protocol'], $cp['radiusip2'], $cp['radiuskey2'], $cp['radiusport2'], $cp['radiussrcip_attribute'], false, 0);
|
|
5845 |
} |
|
5846 |
$auth_servers[] = generate_usermanager_radius_config($cpzone, $radiuscounter, $cp['radius_protocol'], $cp['radiusip2'], $cp['radiuskey2'], $cp['radiusport2'], $cp['radiussrcip_attribute'], false, 0); |
|
5847 | 5847 |
} |
5848 | 5848 |
if (!empty($cp['radiusip3'])) { |
5849 | 5849 |
$radiuscounter++; |
5850 | 5850 |
if (intval($cp['radiusport3']) == 0) { |
5851 | 5851 |
$cp['radiusport3'] = 1812; |
5852 | 5852 |
} |
5853 |
$auth_servers2[] = generate_usermanager_radius_config($cpzone, $radiuscounter, $cp['radius_protocol'], $cp['radiusip3'], $cp['radiuskey3'], $cp['radiusport3'], $cp['radiussrcip_attribute'], false, 0);
|
|
5853 |
$auth_servers2[] = generate_usermanager_radius_config($cpzone, $radiuscounter, $cp['radius_protocol'], $cp['radiusip3'], $cp['radiuskey3'], $cp['radiusport3'], $cp['radiussrcip_attribute'], false, 0); |
|
5854 | 5854 |
} |
5855 | 5855 |
if (!empty($cp['radiusip4'])) { |
5856 | 5856 |
$radiuscounter++; |
5857 | 5857 |
if (intval($cp['radiusport4']) == 0) { |
5858 | 5858 |
$cp['radiusport4'] = 1812; |
5859 | 5859 |
} |
5860 |
$auth_servers2[] = generate_usermanager_radius_config($cpzone, $radiuscounter, $cp['radius_protocol'], $cp['radiusip4'], $cp['radiuskey4'], $cp['radiusport4'], $cp['radiussrcip_attribute'], false, 0);
|
|
5860 |
$auth_servers2[] = generate_usermanager_radius_config($cpzone, $radiuscounter, $cp['radius_protocol'], $cp['radiusip4'], $cp['radiuskey4'], $cp['radiusport4'], $cp['radiussrcip_attribute'], false, 0); |
|
5861 | 5861 |
} |
5862 |
|
|
5862 |
|
|
5863 | 5863 |
$cp['auth_method'] = 'authserver'; |
5864 | 5864 |
$cp['auth_server'] = implode(",", $auth_servers); |
5865 | 5865 |
$cp['auth_server2'] = implode(",", $auth_servers2); |
... | ... | |
5876 | 5876 |
} elseif ($cp['auth_method'] === 'local') { // Local Auth |
5877 | 5877 |
$cp['auth_method'] = 'authserver'; |
5878 | 5878 |
$cp['auth_server'] = "Local Auth - Local Database"; |
5879 |
}
|
|
5879 |
} |
|
5880 | 5880 |
// we don't need to update anything when "none" auth method is selected |
5881 |
|
|
5881 |
|
|
5882 | 5882 |
$config['captiveportal'][$cpzone] = $cp; |
5883 | 5883 |
} |
5884 | 5884 |
} |
... | ... | |
5975 | 5975 |
isset($config['hasync']['synchronizelb'])) { |
5976 | 5976 |
unset($config['hasync']['synchronizelb']); |
5977 | 5977 |
} |
5978 |
|
|
5978 |
|
|
5979 | 5979 |
/* If the LB widget is present, remove it*/ |
5980 | 5980 |
if (isset($config['widgets']) && |
5981 | 5981 |
isset($config['widgets']['sequence']) && |
src/etc/inc/vpn.inc | ||
---|---|---|
536 | 536 |
|
537 | 537 |
if (is_array($a_client) && isset($a_client['enable'])) { |
538 | 538 |
$strongswan .= "\t\tattr {\n"; |
539 |
|
|
539 |
|
|
540 | 540 |
$cfgservers = array(); |
541 | 541 |
if (!empty($a_client['wins_server1'])) { |
542 | 542 |
$cfgservers[] = $a_client['wins_server1']; |
... | ... | |
1030 | 1030 |
if (!empty($a_client['dns_server4'])) { |
1031 | 1031 |
$rightdnsservers[] = $a_client['dns_server4']; |
1032 | 1032 |
} |
1033 |
|
|
1033 |
|
|
1034 | 1034 |
if (count($rightdnsservers)) { |
1035 | 1035 |
$rightdnsserver = "\trightdns = " . implode(',', $rightdnsservers) . "\n"; |
1036 | 1036 |
} |
... | ... | |
1542 | 1542 |
// supported: ipv4, ipv6, rfc822, email, userfqdn, fqdn, dns, asn1dn, asn1gn, keyid |
1543 | 1543 |
// example: $ipsecfin = "\trightid = email:your@email.address\n"; |
1544 | 1544 |
|
1545 |
// note: comma seperated list for access restriction, regardless of firewall rules
|
|
1545 |
// note: comma separated list for access restriction, regardless of firewall rules
|
|
1546 | 1546 |
// example: $ipsecfin = "\tleftsubnet = 1.1.1.1/32,1.1.1.2/32,2.2.2.0/24\n"; |
1547 | 1547 |
|
1548 | 1548 |
$mobilekey_counter++; |
src/etc/rc.newwanip | ||
---|---|---|
187 | 187 |
|
188 | 188 |
if (platform_booting() && !in_array(substr($interface_real, 0, 3), array("ppp", "ppt", "l2t"))) { |
189 | 189 |
// unlike dhcp interfaces which wait until they get an ip, a ppp connection lets the boot continue while |
190 |
// trying to aquire a ip address so to avoid a race condition where it would be possible that the default |
|
190 |
// trying to acquire a ip address so to avoid a race condition where it would be possible that the default
|
|
191 | 191 |
// route would not be set, this script must continue to use the new assigned ip even while booting |
192 | 192 |
// https://redmine.pfsense.org/issues/8561 |
193 | 193 |
|
src/etc/sshd | ||
---|---|---|
172 | 172 |
file_notice("SSH", "{$g['product_name']} has completed creating your SSH keys. SSH is now started.", "SSH Startup", ""); |
173 | 173 |
} |
174 | 174 |
|
175 |
/* kill existing sshd process, server only, not the childs */
|
|
175 |
/* kill existing sshd process, server only, not the children */
|
|
176 | 176 |
$sshd_pid = exec("ps ax | egrep '/usr/sbin/[s]shd' | awk '{print $1}'"); |
177 | 177 |
if ($sshd_pid <> "") { |
178 | 178 |
echo "stopping ssh process $sshd_pid \n"; |
src/usr/local/bin/parser_ipv6_tester.php | ||
---|---|---|
44 | 44 |
* Tests the content for valid IPv6 addresses and compares the matches against |
45 | 45 |
* a checklist. Each checklist entry is also separately matched and compared |
46 | 46 |
* against itself. The order of the resulting matches must be identical to the |
47 |
* order of the list entries to provide succesful passes. |
|
47 |
* order of the list entries to provide successful passes.
|
|
48 | 48 |
* |
49 | 49 |
* Amount of matches should always equal amount of list entries in the |
50 | 50 |
* checklist. |
51 |
* Passes are for succesful matches. |
|
51 |
* Passes are for successful matches.
|
|
52 | 52 |
* Fails should always stay 0. |
53 | 53 |
* Fails are for iterations where: |
54 | 54 |
* * comparison between a current match of text and a current list entry are |
src/usr/local/www/css/login.css | ||
---|---|---|
182 | 182 |
height: 100%; |
183 | 183 |
} |
184 | 184 |
|
185 |
/** Re-style web-kit broswer autocomplete boxes (Fixes Chrome's ugly yellow background) **/
|
|
185 |
/** Re-style web-kit browser autocomplete boxes (Fixes Chrome's ugly yellow background) **/
|
|
186 | 186 |
@-webkit-keyframes autofill { |
187 | 187 |
to { |
188 | 188 |
color: white; |
src/usr/local/www/css/pfSense.css | ||
---|---|---|
926 | 926 |
content: normal; |
927 | 927 |
} |
928 | 928 |
|
929 |
/** Text color for diff display when comapring configs */
|
|
929 |
/** Text color for diff display when comparing configs */
|
|
930 | 930 |
.diff-text { |
931 | 931 |
color: #000000; |
932 | 932 |
} |
src/usr/local/www/firewall_rules_edit.php | ||
---|---|---|
1773 | 1773 |
|
1774 | 1774 |
// Remove focus on page load |
1775 | 1775 |
document.activeElement.blur() |
1776 |
|
|
1776 |
|
|
1777 | 1777 |
function show_advopts(ispageload) { |
1778 | 1778 |
var text; |
1779 | 1779 |
// On page load decide the initial state based on the data. |
... | ... | |
2123 | 2123 |
setHelpText(target, dispstr); |
2124 | 2124 |
} |
2125 | 2125 |
|
2126 |
// When editing "associated" rules, everything except the enable, action, address family and desscription
|
|
2126 |
// When editing "associated" rules, everything except the enable, action, address family and description |
|
2127 | 2127 |
// fields are disabled |
2128 | 2128 |
function disable_most(disable) { |
2129 | 2129 |
var elementsToDisable = [ |
src/usr/local/www/firewall_schedule_edit.php | ||
---|---|---|
210 | 210 |
|
211 | 211 |
include("head.inc"); |
212 | 212 |
|
213 |
// Returns a string containg the HTML to display a calendar table |
|
213 |
// Returns a string containing the HTML to display a calendar table
|
|
214 | 214 |
function build_date_table() { |
215 | 215 |
$tblstr = ""; |
216 | 216 |
|
src/usr/local/www/index.php | ||
---|---|---|
565 | 565 |
} |
566 | 566 |
|
567 | 567 |
// ---------------------Centralized widget refresh system ------------------------------------------- |
568 |
// These need to live outsie of the events.push() function to enable the widgets to see them |
|
568 |
// These need to live outside of the events.push() function to enable the widgets to see them
|
|
569 | 569 |
var ajaxspecs = new Array(); // Array to hold widget refresh specifications (objects ) |
570 | 570 |
var ajaxidx = 0; |
571 | 571 |
var ajaxmutex = false; |
src/usr/local/www/interfaces.php | ||
---|---|---|
85 | 85 |
$a_gateways = &$config['gateways']['gateway_item']; |
86 | 86 |
|
87 | 87 |
$interfaces = get_configured_interface_with_descr(); |
88 |
/* Interfaces which have addresses configired elsewhere and should not be
|
|
88 |
/* Interfaces which have addresses configured elsewhere and should not be
|
|
89 | 89 |
* configured here. See https://redmine.pfsense.org/issues/8687 */ |
90 | 90 |
$no_address_interfaces = array("ovpn", "ipsec", "gif", "gre"); |
91 | 91 |
$show_address_controls = true; |
src/usr/local/www/interfaces_assign.php | ||
---|---|---|
406 | 406 |
|
407 | 407 |
/* If we are in firewall/routing mode (not single interface) |
408 | 408 |
* then ensure that we are not running DHCP on the wan which |
409 |
* will make a lot of ISP's unhappy.
|
|
409 |
* will make a lot of ISPs unhappy. |
|
410 | 410 |
*/ |
411 | 411 |
if ($config['interfaces']['lan'] && $config['dhcpd']['wan']) { |
412 | 412 |
unset($config['dhcpd']['wan']); |
src/usr/local/www/pkg_mgr_install.php | ||
---|---|---|
387 | 387 |
if ($firmwareupdate): |
388 | 388 |
|
389 | 389 |
// Check to see if any new repositories have become available. This data is cached and |
390 |
// refreshed evrey 24 hours
|
|
390 |
// refreshed every 24 hours
|
|
391 | 391 |
update_repos(); |
392 | 392 |
$repopath = "/usr/local/share/{$g['product_name']}/pkg/repos"; |
393 | 393 |
$helpfilename = "{$repopath}/{$g['product_name']}-repo-custom.help"; |
src/usr/local/www/services_acb.php | ||
---|---|---|
195 | 195 |
} |
196 | 196 |
} |
197 | 197 |
if (curl_errno($curl_session)) { |
198 |
/* If an error occured, log the error in /tmp/ */ |
|
198 |
/* If an error occurred, log the error in /tmp/ */
|
|
199 | 199 |
$fd = fopen("/tmp/acb_restoredebug.txt", "w"); |
200 | 200 |
fwrite($fd, $get_url . "" . "action=restore&hostname={$hostname}&revision=" . urlencode($_REQUEST['newver']) . "\n\n"); |
201 | 201 |
fwrite($fd, $data); |
src/usr/local/www/services_captiveportal_filemanager.php | ||
---|---|---|
243 | 243 |
<?php endif; ?> |
244 | 244 |
</nav> |
245 | 245 |
<?php |
246 |
// The notes displayed on the page are large, the page content comparitively small. A "Note" button
|
|
246 |
// The notes displayed on the page are large, the page content comparatively small. A "Note" button
|
|
247 | 247 |
// is provided so that you only see the notes if you ask for them |
248 | 248 |
?> |
249 | 249 |
<div class="infoblock panel panel-default"> |
src/usr/local/www/services_captiveportal_vouchers.php | ||
---|---|---|
277 | 277 |
$config['voucher'][$cpzone] = $newvoucher; |
278 | 278 |
write_config(); |
279 | 279 |
voucher_configure_zone(); |
280 |
// Refresh captivportal login to show voucher changes |
|
280 |
// Refresh captiveportal login to show voucher changes
|
|
281 | 281 |
captiveportal_configure_zone($config['captiveportal'][$cpzone]); |
282 | 282 |
} else { |
283 | 283 |
$newvoucher['vouchersyncdbip'] = $_POST['vouchersyncdbip']; |
... | ... | |
349 | 349 |
$config['voucher'][$cpzone] = $newvoucher; |
350 | 350 |
write_config(); |
351 | 351 |
voucher_configure_zone(true); |
352 |
// Refresh captivportal login to show voucher changes |
|
352 |
// Refresh captiveportal login to show voucher changes
|
|
353 | 353 |
captiveportal_configure_zone($config['captiveportal'][$cpzone]); |
354 | 354 |
} |
355 | 355 |
} |
src/usr/local/www/status_queues.php | ||
---|---|---|
167 | 167 |
} |
168 | 168 |
} |
169 | 169 |
} |
170 |
// use a slowly sliding max scale value but do make sure its always large enough to accomodate the largest value.. |
|
170 |
// use a slowly sliding max scale value but do make sure its always large enough to accommodate the largest value..
|
|
171 | 171 |
if (graphstatmax < statmax) { |
172 | 172 |
// peek value + 10% keeps a little room for it to increase |
173 | 173 |
graphstatmax = statmax * 1.1; |
src/usr/local/www/system_update_settings.php | ||
---|---|---|
124 | 124 |
display_top_tabs($tab_array); |
125 | 125 |
|
126 | 126 |
// Check to see if any new repositories have become available. This data is cached and |
127 |
// refreshed evrey 24 hours
|
|
127 |
// refreshed every 24 hours
|
|
128 | 128 |
update_repos(); |
129 | 129 |
$repopath = "/usr/local/share/{$g['product_name']}/pkg/repos"; |
130 | 130 |
$helpfilename = "{$repopath}/{$g['product_name']}-repo-custom.help"; |
src/usr/local/www/system_usermanager_addprivs.php | ||
---|---|---|
332 | 332 |
}); |
333 | 333 |
|
334 | 334 |
function copyselect(selected) { |
335 |
// Copy all optionsfrom shadow to sysprivs |
|
335 |
// Copy all options from shadow to sysprivs
|
|
336 | 336 |
$('.multiselect').html($('.shadowselect').html()); |
337 | 337 |
|
338 | 338 |
if (selected) { |
src/usr/local/www/vpn_ipsec_phase1.php | ||
---|---|---|
1219 | 1219 |
ealgosel_change(id, 0); |
1220 | 1220 |
}); |
1221 | 1221 |
|
1222 |
// On ititial page load
|
|
1222 |
// On initial page load
|
|
1223 | 1223 |
myidsel_change(); |
1224 | 1224 |
peeridsel_change(); |
1225 | 1225 |
iketype_change(); |
src/usr/local/www/vpn_ipsec_phase2.php | ||
---|---|---|
241 | 241 |
|
242 | 242 |
foreach ($a_phase2 as $key => $name) { |
243 | 243 |
if (isset($name['mobile']) && $name['uniqid'] != $pconfig['uniqid']) { |
244 |
/* check duplicate localids only for mobile clents */ |
|
244 |
/* check duplicate localids only for mobile clients */
|
|
245 | 245 |
$localid_data = ipsec_idinfo_to_cidr($name['localid'], false, $name['mode']); |
246 | 246 |
$entered = array(); |
247 | 247 |
$entered['type'] = $pconfig['localid_type']; |
src/usr/local/www/widgets/widgets/ntp_status.widget.php | ||
---|---|---|
197 | 197 |
<?php if ($widget_first_instance): ?> |
198 | 198 |
<script type="text/javascript"> |
199 | 199 |
//<![CDATA[ |
200 |
// Have to convet the date to UTC time to match the PHP clock not the local client clock. |
|
200 |
// Have to convert the date to UTC time to match the PHP clock not the local client clock.
|
|
201 | 201 |
function convertDateToUTC(date,offset) { |
202 | 202 |
var hours_offset = offset/3600; |
203 | 203 |
var minute_offset = (offset % 3600)/60; |
src/usr/local/www/widgets/widgets/thermal_sensors.widget.php | ||
---|---|---|
113 | 113 |
//save widget config settings on POST |
114 | 114 |
if ($_POST['widgetkey']) { |
115 | 115 |
if (isset($_POST["thermal_sensors_widget_show_fahrenheit"])) { |
116 |
// convert back to celcius
|
|
116 |
// convert back to celsius
|
|
117 | 117 |
$_POST["thermal_sensors_widget_zone_warning_threshold"] = floor(($_POST["thermal_sensors_widget_zone_warning_threshold"] - 32) / 1.8); |
118 | 118 |
$_POST["thermal_sensors_widget_zone_critical_threshold"] = floor(($_POST["thermal_sensors_widget_zone_critical_threshold"] - 32) / 1.8); |
119 | 119 |
$_POST["thermal_sensors_widget_core_warning_threshold"] = floor(($_POST["thermal_sensors_widget_core_warning_threshold"] - 32) / 1.8); |
src/usr/local/www/wizard.php | ||
---|---|---|
142 | 142 |
} |
143 | 143 |
|
144 | 144 |
// Convert a string containing a text version of a PHP array into a real $config array |
145 |
// that can then be created. e.g.: config_array_from_str("['apple']['orange']['pear']['bannana']");
|
|
145 |
// that can then be created. e.g.: config_array_from_str("['apple']['orange']['pear']['banana']"); |
|
146 | 146 |
function config_array_from_str( $text) { |
147 | 147 |
$t = str_replace("[", "", $text); // Remove '[' |
148 | 148 |
$t = str_replace("'", "", $t); // Remove ' |
src/usr/local/www/xmlrpc.php | ||
---|---|---|
750 | 750 |
} |
751 | 751 |
} |
752 | 752 |
|
753 |
// run script untill its done and can 'unlock' the xmlrpc.lock, this prevents hanging php-fpm / webgui
|
|
753 |
// run script until its done and can 'unlock' the xmlrpc.lock, this prevents hanging php-fpm / webgui |
|
754 | 754 |
ignore_user_abort(true); |
755 | 755 |
set_time_limit(0); |
756 | 756 |
|
Also available in: Unified diff
Fix random typos