Project

General

Profile

« Previous | Next » 

Revision 1af5edbf

Added by Stephen Beaver over 9 years ago

Rename of files to better match their position in the memory structure

View differences:

src/etc/inc/filter_log.inc
578 578
					$icon_act = "fa-check icon-success";
579 579
				}
580 580

  
581
				$btn = '<i class="fa ' . $icon_act . ' icon-pointer" title="' . $log_row['act'] . '/' . $log_row['tracker'] . '" onclick="javascript:getURL(\'diag_logs_filter.php?getrulenum=' . $log_row['rulenum'] . ',' . $log_row['tracker'] . ',' . $log_row['act'] . '\', outputrule);"></i>';
581
				$btn = '<i class="fa ' . $icon_act . ' icon-pointer" title="' . $log_row['act'] . '/' . $log_row['tracker'] . '" onclick="javascript:getURL(\'status_logs_filter.php?getrulenum=' . $log_row['rulenum'] . ',' . $log_row['tracker'] . ',' . $log_row['act'] . '\', outputrule);"></i>';
582 582
				$new_rules .= "{$btn}||{$log_row['time']}||{$log_row['interface']}||{$log_row['srcip']}||{$log_row['srcport']}||{$log_row['dstip']}||{$log_row['dstport']}||{$log_row['proto']}||{$log_row['version']}||" . time() . "||\n";
583 583
			}
584 584
		}
src/etc/inc/priv.defs.inc
23 23
$priv_list['page-status-carp']['name'] = gettext("WebCfg - Status: CARP");
24 24
$priv_list['page-status-carp']['descr'] = gettext("Allow access to the 'Status: CARP' page.");
25 25
$priv_list['page-status-carp']['match'] = array();
26
$priv_list['page-status-carp']['match'][] = "carp_status.php*";
26
$priv_list['page-status-carp']['match'][] = "status_carp.php*";
27 27

  
28 28
$priv_list['page-diagnostics-crash-reporter'] = array();
29 29
$priv_list['page-diagnostics-crash-reporter']['name'] = gettext("WebCfg - Crash reporter");
......
89 89
$priv_list['page-status-ipsec']['name'] = gettext("WebCfg - Status: IPsec");
90 90
$priv_list['page-status-ipsec']['descr'] = gettext("Allow access to the 'Status: IPsec' page.");
91 91
$priv_list['page-status-ipsec']['match'] = array();
92
$priv_list['page-status-ipsec']['match'][] = "diag_ipsec.php*";
92
$priv_list['page-status-ipsec']['match'][] = "status_ipsec.php*";
93 93

  
94 94
$priv_list['page-status-ipsec-leases'] = array();
95 95
$priv_list['page-status-ipsec-leases']['name'] = gettext("WebCfg - Status: IPsec: Leases");
96 96
$priv_list['page-status-ipsec-leases']['descr'] = gettext("Allow access to the 'Status: IPsec: Leases' page.");
97 97
$priv_list['page-status-ipsec-leases']['match'] = array();
98
$priv_list['page-status-ipsec-leases']['match'][] = "diag_ipsec_leases.php*";
98
$priv_list['page-status-ipsec-leases']['match'][] = "status_ipsec_leases.php*";
99 99

  
100 100
$priv_list['page-status-ipsec-sad'] = array();
101 101
$priv_list['page-status-ipsec-sad']['name'] = gettext("WebCfg - Status: IPsec: SAD");
102 102
$priv_list['page-status-ipsec-sad']['descr'] = gettext("Allow access to the 'Status: IPsec: SAD' page.");
103 103
$priv_list['page-status-ipsec-sad']['match'] = array();
104
$priv_list['page-status-ipsec-sad']['match'][] = "diag_ipsec_sad.php*";
104
$priv_list['page-status-ipsec-sad']['match'][] = "status_ipsec_sad.php*";
105 105

  
106 106
$priv_list['page-status-ipsec-spd'] = array();
107 107
$priv_list['page-status-ipsec-spd']['name'] = gettext("WebCfg - Status: IPsec: SPD");
108 108
$priv_list['page-status-ipsec-spd']['descr'] = gettext("Allow access to the 'Status: IPsec: SPD' page.");
109 109
$priv_list['page-status-ipsec-spd']['match'] = array();
110
$priv_list['page-status-ipsec-spd']['match'][] = "diag_ipsec_spd.php*";
110
$priv_list['page-status-ipsec-spd']['match'][] = "status_ipsec_spd.php*";
111 111

  
112 112
$priv_list['page-diagnostics-limiter-info'] = array();
113 113
$priv_list['page-diagnostics-limiter-info']['name'] = gettext("WebCfg - Diagnostics: Limiter Info");
......
119 119
$priv_list['page-diagnostics-logs-system']['name'] = gettext("WebCfg - Status: Logs: System");
120 120
$priv_list['page-diagnostics-logs-system']['descr'] = gettext("Allow access to the 'Status: System Logs: General' page.");
121 121
$priv_list['page-diagnostics-logs-system']['match'] = array();
122
$priv_list['page-diagnostics-logs-system']['match'][] = "diag_logs.php";
122
$priv_list['page-diagnostics-logs-system']['match'][] = "status_logs.php";
123 123

  
124 124
$priv_list['page-diagnostics-logs-firewall'] = array();
125 125
$priv_list['page-diagnostics-logs-firewall']['name'] = gettext("WebCfg - Status: Logs: Firewall");
126 126
$priv_list['page-diagnostics-logs-firewall']['descr'] = gettext("Allow access to the 'Status: Logs: Firewall' page.");
127 127
$priv_list['page-diagnostics-logs-firewall']['match'] = array();
128
$priv_list['page-diagnostics-logs-firewall']['match'][] = "diag_logs_filter.php*";
128
$priv_list['page-diagnostics-logs-firewall']['match'][] = "status_logs_filter.php*";
129 129

  
130 130
$priv_list['page-diagnostics-logs-firewall-dynamic'] = array();
131 131
$priv_list['page-diagnostics-logs-firewall-dynamic']['name'] = gettext("WebCfg - Status: System Logs: Firewall (Dynamic View)");
132 132
$priv_list['page-diagnostics-logs-firewall-dynamic']['descr'] = gettext("Allow access to the 'Status: System Logs: Firewall (Dynamic View)' page");
133 133
$priv_list['page-diagnostics-logs-firewall-dynamic']['match'] = array();
134
$priv_list['page-diagnostics-logs-firewall-dynamic']['match'][] = "diag_logs_filter_dynamic.php*";
134
$priv_list['page-diagnostics-logs-firewall-dynamic']['match'][] = "status_logs_filter_dynamic.php*";
135 135

  
136 136
$priv_list['page-diagnostics-logs-firewall-summary'] = array();
137 137
$priv_list['page-diagnostics-logs-firewall-summary']['name'] = gettext("WebCfg - Status: System Logs: Firewall Log Summary");
138 138
$priv_list['page-diagnostics-logs-firewall-summary']['descr'] = gettext("Allow access to the 'Status: System Logs: Firewall Log Summary' page");
139 139
$priv_list['page-diagnostics-logs-firewall-summary']['match'] = array();
140
$priv_list['page-diagnostics-logs-firewall-summary']['match'][] = "diag_logs_filter_summary.php*";
140
$priv_list['page-diagnostics-logs-firewall-summary']['match'][] = "status_logs_filter_summary.php*";
141 141

  
142 142
$priv_list['page-diagnostics-logs-settings'] = array();
143 143
$priv_list['page-diagnostics-logs-settings']['name'] = gettext("WebCfg - Status: Logs: Settings");
144 144
$priv_list['page-diagnostics-logs-settings']['descr'] = gettext("Allow access to the 'Status: Logs: Settings' page.");
145 145
$priv_list['page-diagnostics-logs-settings']['match'] = array();
146
$priv_list['page-diagnostics-logs-settings']['match'][] = "diag_logs_settings.php*";
146
$priv_list['page-diagnostics-logs-settings']['match'][] = "status_logs_settings.php*";
147 147

  
148 148
$priv_list['page-diagnostics-logs-pptpvpn'] = array();
149 149
$priv_list['page-diagnostics-logs-pptpvpn']['name'] = gettext("WebCfg - Status: Logs: VPN");
150 150
$priv_list['page-diagnostics-logs-pptpvpn']['descr'] = gettext("Allow access to the 'Status: Logs: VPN' page.");
151 151
$priv_list['page-diagnostics-logs-pptpvpn']['match'] = array();
152
$priv_list['page-diagnostics-logs-pptpvpn']['match'][] = "diag_logs_vpn.php*";
152
$priv_list['page-diagnostics-logs-pptpvpn']['match'][] = "status_logs_vpn.php*";
153 153

  
154 154
$priv_list['page-diagnostics-nanobsd'] = array();
155 155
$priv_list['page-diagnostics-nanobsd']['name'] = gettext("WebCfg - Diagnostics: NanoBSD");
......
185 185
$priv_list['page-status-packagelogs']['name'] = gettext("WebCfg - Status: Package logs");
186 186
$priv_list['page-status-packagelogs']['descr'] = gettext("Allow access to the 'Status: Package logs' page.");
187 187
$priv_list['page-status-packagelogs']['match'] = array();
188
$priv_list['page-status-packagelogs']['match'][] = "diag_pkglogs.php*";
188
$priv_list['page-status-packagelogs']['match'][] = "status_pkglogs.php*";
189 189

  
190 190
$priv_list['page-diagnostics-resetstate'] = array();
191 191
$priv_list['page-diagnostics-resetstate']['name'] = gettext("WebCfg - Diagnostics: Reset states");
......
227 227
$priv_list['page-diagnostics-system-pftop']['name'] = gettext("WebCfg - Diagnostics: pfTop");
228 228
$priv_list['page-diagnostics-system-pftop']['descr'] = gettext("Allows access to the 'Diagnostics: pfTop' page");
229 229
$priv_list['page-diagnostics-system-pftop']['match'] = array();
230
$priv_list['page-diagnostics-system-pftop']['match'][] = "diag_system_pftop.php*";
230
$priv_list['page-diagnostics-system-pftop']['match'][] = "diag_pftop.php*";
231 231

  
232 232
$priv_list['page-diagnostics-tables'] = array();
233 233
$priv_list['page-diagnostics-tables']['name'] = gettext("WebCfg - Diagnostics: pf Table IP addresses");
......
422 422
$priv_list['page-diagnostics-haltsystem']['name'] = gettext("WebCfg - Diagnostics: Halt system");
423 423
$priv_list['page-diagnostics-haltsystem']['descr'] = gettext("Allow access to the 'Diagnostics: Halt system' page.");
424 424
$priv_list['page-diagnostics-haltsystem']['match'] = array();
425
$priv_list['page-diagnostics-haltsystem']['match'][] = "halt.php*";
425
$priv_list['page-diagnostics-haltsystem']['match'][] = "diag_halt.php*";
426 426

  
427 427
$priv_list['page-xmlrpcinterfacestats'] = array();
428 428
$priv_list['page-xmlrpcinterfacestats']['name'] = gettext("WebCfg - XMLRPC Interface Stats");
......
638 638
$priv_list['page-diagnostics-rebootsystem']['name'] = gettext("WebCfg - Diagnostics: Reboot System");
639 639
$priv_list['page-diagnostics-rebootsystem']['descr'] = gettext("Allow access to the 'Diagnostics: Reboot System' page.");
640 640
$priv_list['page-diagnostics-rebootsystem']['match'] = array();
641
$priv_list['page-diagnostics-rebootsystem']['match'][] = "reboot.php*";
641
$priv_list['page-diagnostics-rebootsystem']['match'][] = "diag_reboot.php*";
642 642

  
643 643
$priv_list['page-diagnostics-restart-httpd'] = array();
644 644
$priv_list['page-diagnostics-restart-httpd']['name'] = gettext("WebCfg - Diagnostics: Restart Web Server Daemon");
......
1278 1278
$priv_list['page-services-pppoeserver']['name'] = gettext("WebCfg - Services: PPPoE Server");
1279 1279
$priv_list['page-services-pppoeserver']['descr'] = gettext("Allow access to the 'Services: PPPoE Server' page.");
1280 1280
$priv_list['page-services-pppoeserver']['match'] = array();
1281
$priv_list['page-services-pppoeserver']['match'][] = "vpn_pppoe.php*";
1281
$priv_list['page-services-pppoeserver']['match'][] = "services_pppoe.php*";
1282 1282

  
1283 1283
$priv_list['page-services-pppoeserver-edit'] = array();
1284 1284
$priv_list['page-services-pppoeserver-edit']['name'] = gettext("WebCfg - Services: PPPoE Server: Edit");
1285 1285
$priv_list['page-services-pppoeserver-edit']['descr'] = gettext("Allow access to the 'Services: PPPoE Server: Edit' page.");
1286 1286
$priv_list['page-services-pppoeserver-edit']['match'] = array();
1287
$priv_list['page-services-pppoeserver-edit']['match'][] = "vpn_pppoe_edit.php*";
1287
$priv_list['page-services-pppoeserver-edit']['match'][] = "services_pppoe_edit.php*";
1288 1288

  
1289 1289
$priv_list['page-pfsensewizardsubsystem'] = array();
1290 1290
$priv_list['page-pfsensewizardsubsystem']['name'] = gettext("WebCfg - pfSense wizard subsystem");
src/etc/inc/priv/user.priv.inc
22 22
$priv_list['page-dashboard-all']['match'][] = "graph_cpu.php*";
23 23
$priv_list['page-dashboard-all']['match'][] = "getstats.php*";
24 24
$priv_list['page-dashboard-all']['match'][] = "ifstats.php*";
25
$priv_list['page-dashboard-all']['match'][] = "diag_logs_filter_dynamic.php*";
25
$priv_list['page-dashboard-all']['match'][] = "status_logs_filter_dynamic.php*";
26 26

  
27 27
$priv_list['page-dashboard-widgets'] = array();
28 28
$priv_list['page-dashboard-widgets']['name'] = gettext("WebCfg - Dashboard widgets (direct access).");
......
70 70
$priv_list['page-status-systemlogs-portalauth']['name'] = gettext("WebCfg - Status: System logs: Portal Auth");
71 71
$priv_list['page-status-systemlogs-portalauth']['descr'] = gettext("Allow access to the 'Status: System logs: Portal Auth' page.");
72 72
$priv_list['page-status-systemlogs-portalauth']['match'] = array();
73
$priv_list['page-status-systemlogs-portalauth']['match'][] = "diag_logs.php?logfile=portalauth";
73
$priv_list['page-status-systemlogs-portalauth']['match'][] = "status_logs.php?logfile=portalauth";
74 74

  
75 75
$priv_list['page-diagnostics-logs-dhcp'] = array();
76 76
$priv_list['page-diagnostics-logs-dhcp']['name'] = gettext("WebCfg - Status: Logs: DHCP");
77 77
$priv_list['page-diagnostics-logs-dhcp']['descr'] = gettext("Allow access to the 'Status: Logs: DHCP' page.");
78 78
$priv_list['page-diagnostics-logs-dhcp']['match'] = array();
79
$priv_list['page-diagnostics-logs-dhcp']['match'][] = "diag_logs.php?logfile=dhcpd";
79
$priv_list['page-diagnostics-logs-dhcp']['match'][] = "status_logs.php?logfile=dhcpd";
80 80

  
81 81
$priv_list['page-diagnostics-logs-gateways'] = array();
82 82
$priv_list['page-diagnostics-logs-gateways']['name'] = gettext("WebCfg - Status: Logs: Gateways");
83 83
$priv_list['page-diagnostics-logs-gateways']['descr'] = gettext("Allow access to the 'Status: Logs: System: Gateways' page.");
84 84
$priv_list['page-diagnostics-logs-gateways']['match'] = array();
85
$priv_list['page-diagnostics-logs-gateways']['match'][] = "diag_logs.php?logfile=gateways";
85
$priv_list['page-diagnostics-logs-gateways']['match'][] = "status_logs.php?logfile=gateways";
86 86

  
87 87
$priv_list['page-diagnostics-logs-resolver'] = array();
88 88
$priv_list['page-diagnostics-logs-resolver']['name'] = gettext("WebCfg - Status: Logs: Resolver");
89 89
$priv_list['page-diagnostics-logs-resolver']['descr'] = gettext("Allow access to the 'Status: Logs: System: Resolver' page.");
90 90
$priv_list['page-diagnostics-logs-resolver']['match'] = array();
91
$priv_list['page-diagnostics-logs-resolver']['match'][] = "diag_logs.php?logfile=resolver";
91
$priv_list['page-diagnostics-logs-resolver']['match'][] = "status_logs.php?logfile=resolver";
92 92

  
93 93
$priv_list['page-status-systemlogs-ipsecvpn'] = array();
94 94
$priv_list['page-status-systemlogs-ipsecvpn']['name'] = gettext("WebCfg - Status: System logs: IPsec VPN");
95 95
$priv_list['page-status-systemlogs-ipsecvpn']['descr'] = gettext("Allow access to the 'Status: System logs: IPsec VPN' page.");
96 96
$priv_list['page-status-systemlogs-ipsecvpn']['match'] = array();
97
$priv_list['page-status-systemlogs-ipsecvpn']['match'][] = "diag_logs.php?logfile=ipsec";
97
$priv_list['page-status-systemlogs-ipsecvpn']['match'][] = "status_logs.php?logfile=ipsec";
98 98

  
99 99
$priv_list['page-status-systemlogs-ntpd'] = array();
100 100
$priv_list['page-status-systemlogs-ntpd']['name'] = gettext("WebCfg - Status: System logs: NTP");
101 101
$priv_list['page-status-systemlogs-ntpd']['descr'] = gettext("Allow access to the 'Status: System logs: NTP' page.");
102 102
$priv_list['page-status-systemlogs-ntpd']['match'] = array();
103
$priv_list['page-status-systemlogs-ntpd']['match'][] = "diag_logs.php?logfile=ntpd";
103
$priv_list['page-status-systemlogs-ntpd']['match'][] = "status_logs.php?logfile=ntpd";
104 104

  
105 105
$priv_list['page-status-systemlogs-openvpn'] = array();
106 106
$priv_list['page-status-systemlogs-openvpn']['name'] = gettext("WebCfg - Status: System logs: OpenVPN");
107 107
$priv_list['page-status-systemlogs-openvpn']['descr'] = gettext("Allow access to the 'Status: System logs: OpenVPN' page.");
108 108
$priv_list['page-status-systemlogs-openvpn']['match'] = array();
109
$priv_list['page-status-systemlogs-openvpn']['match'][] = "diag_logs.php?logfile=openvpn";
109
$priv_list['page-status-systemlogs-openvpn']['match'][] = "status_logs.php?logfile=openvpn";
110 110

  
111 111
$priv_list['page-status-systemlogs-ppp'] = array();
112 112
$priv_list['page-status-systemlogs-ppp']['name'] = gettext("WebCfg - Status: System logs: IPsec VPN");
113 113
$priv_list['page-status-systemlogs-ppp']['descr'] = gettext("Allow access to the 'Status: System logs: IPsec VPN' page.");
114 114
$priv_list['page-status-systemlogs-ppp']['match'] = array();
115
$priv_list['page-status-systemlogs-ppp']['match'][] = "diag_logs.php?logfile=ppp";
115
$priv_list['page-status-systemlogs-ppp']['match'][] = "status_logs.php?logfile=ppp";
116 116

  
117 117
$priv_list['page-status-systemlogs-loadbalancer'] = array();
118 118
$priv_list['page-status-systemlogs-loadbalancer']['name'] = gettext("WebCfg - Status: System logs: Load Balancer");
119 119
$priv_list['page-status-systemlogs-loadbalancer']['descr'] = gettext("Allow access to the 'Status: System logs: Load Balancer' page.");
120 120
$priv_list['page-status-systemlogs-loadbalancer']['match'] = array();
121
$priv_list['page-status-systemlogs-loadbalancer']['match'][] = "diag_logs.php?logfile=relayd";
121
$priv_list['page-status-systemlogs-loadbalancer']['match'][] = "status_logs.php?logfile=relayd";
122 122

  
123 123
$priv_list['page-status-systemlogs-routing'] = array();
124 124
$priv_list['page-status-systemlogs-routing']['name'] = gettext("WebCfg - Status: System logs: Routing");
125 125
$priv_list['page-status-systemlogs-routing']['descr'] = gettext("Allow access to the 'Status: System logs: System: Routing' page.");
126 126
$priv_list['page-status-systemlogs-routing']['match'] = array();
127
$priv_list['page-status-systemlogs-routing']['match'][] = "diag_logs.php?logfile=routing";
127
$priv_list['page-status-systemlogs-routing']['match'][] = "status_logs.php?logfile=routing";
128 128

  
129 129
$priv_list['page-status-systemlogs-wireless'] = array();
130 130
$priv_list['page-status-systemlogs-wireless']['name'] = gettext("WebCfg - Status: System logs: Wireless");
131 131
$priv_list['page-status-systemlogs-wireless']['descr'] = gettext("Allow access to the 'Status: System logs: System: Wireless' page.");
132 132
$priv_list['page-status-systemlogs-wireless']['match'] = array();
133
$priv_list['page-status-systemlogs-wireless']['match'][] = "diag_logs.php?logfile=wireless";
133
$priv_list['page-status-systemlogs-wireless']['match'][] = "status_logs.php?logfile=wireless";
134 134

  
135 135
?>
src/etc/pfSense.obsoletedfiles
739 739
/usr/local/share/strongswan/templates/config/plugins/smp.conf
740 740
/usr/local/share/xml
741 741
/usr/local/www/auto_complete_helper.js
742
/usr/local/www/carp_status.php
742 743
/usr/local/www/classes/maintable.inc
743 744
/usr/local/www/code-syntax-highlighter
744 745
/usr/local/www/csrf/csrf-secret.php
......
749 750
/usr/local/www/dfuife.css
750 751
/usr/local/www/dfuife.js
751 752
/usr/local/www/diag_dhcp_leases.php
753
/usr/local/www/diag_ipsec.php
754
/usr/local/www/diag_ipsec_leases.php
755
/usr/local/www/diag_ipsec_sad.php
756
/usr/local/www/diag_ipsec_spd.php
757
/usr/local/www/diag_logs.php
752 758
/usr/local/www/diag_logs_auth.php
753 759
/usr/local/www/diag_logs_dhcp.php
760
/usr/local/www/diag_logs_filter.php
761
/usr/local/www/diag_logs_filter_dynamic.php
762
/usr/local/www/diag_logs_filter_summary.php
754 763
/usr/local/www/diag_logs_gateways.php
755 764
/usr/local/www/diag_logs_ipsec.php
756 765
/usr/local/www/diag_logs_ntpd.php
......
759 768
/usr/local/www/diag_logs_relayd.php
760 769
/usr/local/www/diag_logs_resolver.php
761 770
/usr/local/www/diag_logs_routing.php
771
/usr/local/www/diag_logs_settings.php
762 772
/usr/local/www/diag_logs_slbd.php
773
/usr/local/www/diag_logs_vpn.php
763 774
/usr/local/www/diag_logs_wireless.php
764 775
/usr/local/www/diag_patterns.php
776
/usr/local/www/diag_pkglogs.php
765 777
/usr/local/www/diag_showbogons.php
778
/usr/local/diag_system_pftop.php
766 779
/usr/local/www/dom-drag.js
767 780
/usr/local/www/draglist.js
768 781
/usr/local/www/dtree.js
......
780 793
/usr/local/www/fred.png
781 794
/usr/local/www/green_dot.jpg
782 795
/usr/local/www/gui.css
796
/usr/local/www/halt.php
783 797
/usr/local/www/headjs.php
784 798
/usr/local/www/ifstats.cgi
785 799
/usr/local/www/includes/javascript.inc.php
......
815 829
/usr/local/www/protochart/ProtoChart.js
816 830
/usr/local/www/protochart/excanvas-compressed.js
817 831
/usr/local/www/protochart/excanvas.js
832
/usr/local/www/reboot.php
818 833
/usr/local/www/row_helper.js
819 834
/usr/local/www/row_helper_dynamic.js
820 835
/usr/local/www/row_toggle.js
......
857 872
/usr/local/www/vpn_openvpn_crl_edit.php
858 873
/usr/local/www/vpn_openvpn_srv.php
859 874
/usr/local/www/vpn_openvpn_srv_edit.php
875
/usr/local/www/vpn_pppoe.php
876
/usr/local/www/vpn_pppoe_edit.php
860 877
/usr/local/www/vpn_pppoe_users.php
861 878
/usr/local/www/vpn_pppoe_users_edit.php
862 879
/usr/local/www/wizards/traffic_shaper_wizard.inc
src/usr/local/www/carp_status.php
1
<?php
2
/*
3
	carp_status.php
4
*/
5
/* ====================================================================
6
 *  Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
7
 *
8
 *  Redistribution and use in source and binary forms, with or without modification,
9
 *  are permitted provided that the following conditions are met:
10
 *
11
 *  1. Redistributions of source code must retain the above copyright notice,
12
 *      this list of conditions and the following disclaimer.
13
 *
14
 *  2. Redistributions in binary form must reproduce the above copyright
15
 *      notice, this list of conditions and the following disclaimer in
16
 *      the documentation and/or other materials provided with the
17
 *      distribution.
18
 *
19
 *  3. All advertising materials mentioning features or use of this software
20
 *      must display the following acknowledgment:
21
 *      "This product includes software developed by the pfSense Project
22
 *       for use in the pfSense software distribution. (http://www.pfsense.org/).
23
 *
24
 *  4. The names "pfSense" and "pfSense Project" must not be used to
25
 *       endorse or promote products derived from this software without
26
 *       prior written permission. For written permission, please contact
27
 *       coreteam@pfsense.org.
28
 *
29
 *  5. Products derived from this software may not be called "pfSense"
30
 *      nor may "pfSense" appear in their names without prior written
31
 *      permission of the Electric Sheep Fencing, LLC.
32
 *
33
 *  6. Redistributions of any form whatsoever must retain the following
34
 *      acknowledgment:
35
 *
36
 *  "This product includes software developed by the pfSense Project
37
 *  for use in the pfSense software distribution (http://www.pfsense.org/).
38
 *
39
 *  THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
40
 *  EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41
 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42
 *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
43
 *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45
 *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47
 *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48
 *  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49
 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50
 *  OF THE POSSIBILITY OF SUCH DAMAGE.
51
 *
52
 *  ====================================================================
53
 *
54
 */
55

  
56
##|+PRIV
57
##|*IDENT=page-status-carp
58
##|*NAME=Status: CARP
59
##|*DESCR=Allow access to the 'Status: CARP' page.
60
##|*MATCH=carp_status.php*
61
##|-PRIV
62

  
63
/*
64
	pfSense_MODULE:	carp
65
*/
66

  
67
require_once("guiconfig.inc");
68
require_once("globals.inc");
69

  
70
function gentitle_pkg($pgname) {
71
	global $config;
72
	return $config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pgname;
73
}
74

  
75
unset($interface_arr_cache);
76
unset($carp_interface_count_cache);
77
unset($interface_ip_arr_cache);
78

  
79
$status = get_carp_status();
80
$status = intval($status);
81

  
82
if ($_POST['carp_maintenancemode'] != "") {
83
	interfaces_carp_set_maintenancemode(!isset($config["virtualip_carp_maintenancemode"]));
84
}
85

  
86
if ($_POST['disablecarp'] != "") {
87
	if ($status > 0) {
88
		set_single_sysctl('net.inet.carp.allow', '0');
89
		if (is_array($config['virtualip']['vip'])) {
90
			$viparr = &$config['virtualip']['vip'];
91
			foreach ($viparr as $vip) {
92
				switch ($vip['mode']) {
93
					case "carp":
94
						interface_vip_bring_down($vip);
95

  
96
						/*
97
						 * Reconfigure radvd when necessary
98
						 * XXX: Is it the best way to do it?
99
						 */
100
						if (isset($config['dhcpdv6']) && is_array($config['dhcpdv6'])) {
101
							foreach ($config['dhcpdv6'] as $dhcpv6if => $dhcpv6ifconf) {
102
								if ($dhcpv6if !== $vip['interface'] ||
103
								    $dhcpv6ifconf['ramode'] === "disabled") {
104
									continue;
105
								}
106

  
107
								services_radvd_configure();
108
								break;
109
							}
110
						}
111

  
112
						sleep(1);
113
						break;
114
				}
115
			}
116
		}
117
		$savemsg = sprintf(gettext("%s IPs have been disabled. Please note that disabling does not survive a reboot and some configuration changes will re-enable."), $carp_counter);
118
		$status = 0;
119
	} else {
120
		$savemsg = gettext("CARP has been enabled.");
121
		if (is_array($config['virtualip']['vip'])) {
122
			$viparr = &$config['virtualip']['vip'];
123
			foreach ($viparr as $vip) {
124
				switch ($vip['mode']) {
125
					case "carp":
126
						interface_carp_configure($vip);
127
						sleep(1);
128
						break;
129
					case 'ipalias':
130
						if (strpos($vip['interface'], '_vip')) {
131
							interface_ipalias_configure($vip);
132
						}
133
						break;
134
				}
135
			}
136
		}
137
		interfaces_sync_setup();
138
		set_single_sysctl('net.inet.carp.allow', '1');
139
		$status = 1;
140
	}
141
}
142

  
143
$carp_detected_problems = get_single_sysctl("net.inet.carp.demotion");
144

  
145
if (!empty($_POST['resetdemotion'])) {
146
	set_single_sysctl("net.inet.carp.demotion", "-{$carp_detected_problems}");
147
	sleep(1);
148
	$carp_detected_problems = get_single_sysctl("net.inet.carp.demotion");
149
}
150

  
151
$pgtitle = array(gettext("Status"), gettext("CARP"));
152
$shortcut_section = "carp";
153

  
154
include("head.inc");
155
if ($savemsg)
156
	print_info_box($savemsg, 'success');
157

  
158
$carpcount = 0;
159
if (is_array($config['virtualip']['vip'])) {
160
	foreach ($config['virtualip']['vip'] as $carp) {
161
		if ($carp['mode'] == "carp") {
162
			$carpcount++;
163
			break;
164
		}
165
	}
166
}
167

  
168

  
169
// If $carpcount > 0 display buttons then display table
170
// otherwise display error box and quit
171

  
172
?>
173

  
174
<?php
175
if ($carpcount == 0) {
176
	print_info_box(gettext('No CARP interfaces have been defined.') . '<br />' .
177
				   '<a href="system_hasync.php" class="alert-link">' .
178
				   gettext("You can configure high availability sync settings here") .
179
				   '</a>');
180
} else
181
{
182
?>
183
<form action="carp_status.php" method="post">
184
<?php
185
	if($status > 0)
186
		$carp_enabled = true;
187
	else
188
		$carp_enabled = false;
189

  
190
	// Sadly this needs to be here so that it is inside the form
191
	if ($carp_detected_problems > 0) {
192
		print_info_box(
193
			gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "<br/>" .
194
			gettext("Check the link status on all interfaces with configured CARP VIPs.") . "<br/>" .
195
			gettext("Search the") .
196
			" <a href=\"/diag_logs.php?filtertext=carp%3A+demoted+by\">" .
197
			gettext("system log") .
198
			"</a> " .
199
			gettext("for CARP demotion-related events.") . "<br/><br/>" .
200
			'<input type="submit" class="btn btn-warning" name="resetdemotion" id="resetdemotion" value="' .
201
			gettext("Reset CARP Demotion Status") .
202
			'" />', 'danger'
203
		);
204
	}
205

  
206
?>
207
	<input type="submit" class="btn btn-warning" name="disablecarp" value="<?=($carp_enabled ? gettext("Temporarily Disable CARP") : gettext("Enable CARP"))?>" />
208
	<input type="submit" class="btn btn-info" name="carp_maintenancemode" id="carp_maintenancemode" value="<?=(isset($config["virtualip_carp_maintenancemode"]) ? gettext("Leave Persistent CARP Maintenance Mode") : gettext("Enter Persistent CARP Maintenance Mode"))?>" />
209

  
210
	<br /><br />
211

  
212
	<div class="panel panel-default">
213
		<div class="panel-heading"><h2 class="panel-title"><?=gettext('CARP Interfaces')?></h2></div>
214
			<div class="panel-body table-responsive">
215
				<table class="table table-striped table-condensed table-hover sortable-theme-bootstrap " data-sortable>
216
					<thead>
217
						<tr>
218
							<th><?=gettext("CARP Interface")?></th>
219
							<th><?=gettext("Virtual IP")?></th>
220
							<th><?=gettext("Status")?></th>
221
						</tr>
222
					</thead>
223
					<tbody>
224
<?php
225
	foreach ($config['virtualip']['vip'] as $carp) {
226
		if ($carp['mode'] != "carp") {
227
			continue;
228
		}
229

  
230
		$ipaddress = $carp['subnet'];
231
		$vhid = $carp['vhid'];
232
		$status = get_carp_interface_status("_vip{$carp['uniqid']}");
233

  
234
		if($carp_enabled == false) {
235
			$icon = 'times-circle';
236
			$status = "DISABLED";
237
		} else {
238
			if ($status == "MASTER") {
239
				$icon = 'check-circle';
240
			} else if ($status == "BACKUP") {
241
				$icon = 'check-circle-o';
242
			} else if ($status == "INIT") {
243
				$icon = 'question-circle';
244
			}
245
		}
246
?>
247
					<tr>
248
						<td><?=convert_friendly_interface_to_friendly_descr($carp['interface'])?>@<?=$vhid?></td>
249
						<td><?=$ipaddress?></td>
250
						<td><i class="fa fa-<?=$icon?>"></i>&nbsp;<?=$status?></td>
251
					</tr>
252
<?php }?>
253
				</tbody>
254
			</table>
255
		</div>
256
	</div>
257
</form>
258

  
259
<div class="panel panel-default">
260
	<div class="panel-heading"><h2 class="panel-title"><?=gettext('pfSync nodes')?></h2></div>
261
	<div class="panel-body">
262
		<ul>
263
<?php
264
	foreach (explode("\n", exec_command("/sbin/pfctl -vvss | /usr/bin/grep creator | /usr/bin/cut -d\" \" -f7 | /usr/bin/sort -u")) as $node) {
265
		echo '<li>'. $node .'</li>';
266
	}
267
?>
268
		</ul>
269
	</div>
270
</div>
271

  
272
<?php
273
}
274

  
275
include("foot.inc");
src/usr/local/www/diag_backup.php
617 617
if (is_subsystem_dirty('restore')):
618 618
?>
619 619
	<br/>
620
	<form action="reboot.php" method="post">
620
	<form action="diag_reboot.php" method="post">
621 621
		<input name="Submit" type="hidden" value="Yes" />
622 622
		<?=print_info_box(gettext("The firewall configuration has been changed.") . "<br />" . gettext("The firewall is now rebooting."))?>
623 623
		<br />
src/usr/local/www/diag_halt.php
1
<?php
2
/*
3
	diag_halt.php
4
*/
5
/* ====================================================================
6
 *  Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
7
 *
8
 *  Some or all of this file is based on the m0n0wall project which is
9
 *  Copyright (c)  2004 Manuel Kasper (BSD 2 clause)
10
 *
11
 *  Redistribution and use in source and binary forms, with or without modification,
12
 *  are permitted provided that the following conditions are met:
13
 *
14
 *  1. Redistributions of source code must retain the above copyright notice,
15
 *      this list of conditions and the following disclaimer.
16
 *
17
 *  2. Redistributions in binary form must reproduce the above copyright
18
 *      notice, this list of conditions and the following disclaimer in
19
 *      the documentation and/or other materials provided with the
20
 *      distribution.
21
 *
22
 *  3. All advertising materials mentioning features or use of this software
23
 *      must display the following acknowledgment:
24
 *      "This product includes software developed by the pfSense Project
25
 *       for use in the pfSense software distribution. (http://www.pfsense.org/).
26
 *
27
 *  4. The names "pfSense" and "pfSense Project" must not be used to
28
 *       endorse or promote products derived from this software without
29
 *       prior written permission. For written permission, please contact
30
 *       coreteam@pfsense.org.
31
 *
32
 *  5. Products derived from this software may not be called "pfSense"
33
 *      nor may "pfSense" appear in their names without prior written
34
 *      permission of the Electric Sheep Fencing, LLC.
35
 *
36
 *  6. Redistributions of any form whatsoever must retain the following
37
 *      acknowledgment:
38
 *
39
 *  "This product includes software developed by the pfSense Project
40
 *  for use in the pfSense software distribution (http://www.pfsense.org/).
41
 *
42
 *  THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
43
 *  EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44
 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
45
 *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
46
 *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48
 *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50
 *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
51
 *  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52
 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
53
 *  OF THE POSSIBILITY OF SUCH DAMAGE.
54
 *
55
 *  ====================================================================
56
 *
57
 */
58
/*
59
	pfSense_MODULE: header
60
*/
61

  
62
##|+PRIV
63
##|*IDENT=page-diagnostics-haltsystem
64
##|*NAME=Diagnostics: Halt system
65
##|*DESCR=Allow access to the 'Diagnostics: Halt system' page.
66
##|*MATCH=diag_halt.php*
67
##|-PRIV
68

  
69
// Set DEBUG to true to prevent the system_halt() function from being called
70
define("DEBUG", false);
71

  
72
require("guiconfig.inc");
73
require("functions.inc");
74
require("captiveportal.inc");
75

  
76
if ($_POST['save'] == 'No') {
77
	header("Location: index.php");
78
	exit;
79
}
80

  
81
$pgtitle = array(gettext("Diagnostics"), gettext("Halt system"));
82
include('head.inc');
83

  
84
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
85
?>
86
	<meta http-equiv="refresh" content="70;url=/">
87
	<div class="alert alert-success" role="alert">
88
		<?=gettext("The system is halting now. This may take one minute or so.")?>
89
	</div>
90

  
91
<?php
92
	if (DEBUG) {
93
	   print("Not actually halting (DEBUG is set true)<br>");
94
	}
95
	else {
96
		print('<pre>');
97
		system_halt();
98
		print('</pre>');
99
	}
100
} else {
101
?>
102

  
103
<div class="panel panel-default">
104
	<div class="panel-heading">
105
		<h2 class="panel-title">Are you sure you want to halt the system?</h2>
106
	</div>
107
	<div class="panel-body">
108
		<div class="content">
109
			<p>Click "Halt" to halt the system immediately, or "No" to go to the system dashboard. (There will be a brief delay before the dashboard appears.)</p>
110
			<form action="diag_halt.php" method="post">
111
				<input type="submit" class="btn btn-danger pull-center" name="save" value="Halt">
112
				<a href="/" class="btn btn-default">No</a>
113
			</form>
114
		</div>
115
	</div>
116
</div>
117

  
118

  
119

  
120
<?php
121
}
122

  
123
include("foot.inc");
src/usr/local/www/diag_ipsec.php
1
<?php
2
/*
3
	diag_ipsec.php
4
*/
5
/* ====================================================================
6
 *  Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
7
 *  portions Copyright (c) 2008 Shrew Soft Inc <mgrooms@shrew.net>.
8
 *
9
 *  Parts of this code originally based on vpn_ipsec_sad.php from m0n0wall,
10
 *  Copyright (c) 2003-2004 Manuel Kasper (BSD 2 clause)
11
 *
12
 *  Redistribution and use in source and binary forms, with or without modification,
13
 *  are permitted provided that the following conditions are met:
14
 *
15
 *  1. Redistributions of source code must retain the above copyright notice,
16
 *      this list of conditions and the following disclaimer.
17
 *
18
 *  2. Redistributions in binary form must reproduce the above copyright
19
 *      notice, this list of conditions and the following disclaimer in
20
 *      the documentation and/or other materials provided with the
21
 *      distribution.
22
 *
23
 *  3. All advertising materials mentioning features or use of this software
24
 *      must display the following acknowledgment:
25
 *      "This product includes software developed by the pfSense Project
26
 *       for use in the pfSense software distribution. (http://www.pfsense.org/).
27
 *
28
 *  4. The names "pfSense" and "pfSense Project" must not be used to
29
 *       endorse or promote products derived from this software without
30
 *       prior written permission. For written permission, please contact
31
 *       coreteam@pfsense.org.
32
 *
33
 *  5. Products derived from this software may not be called "pfSense"
34
 *      nor may "pfSense" appear in their names without prior written
35
 *      permission of the Electric Sheep Fencing, LLC.
36
 *
37
 *  6. Redistributions of any form whatsoever must retain the following
38
 *      acknowledgment:
39
 *
40
 *  "This product includes software developed by the pfSense Project
41
 *  for use in the pfSense software distribution (http://www.pfsense.org/).
42
 *
43
 *  THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
44
 *  EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
45
 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
46
 *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
47
 *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
49
 *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
50
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
51
 *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
52
 *  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
53
 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
54
 *  OF THE POSSIBILITY OF SUCH DAMAGE.
55
 *
56
 *  ====================================================================
57
 *
58
 */
59

  
60
/*
61
	pfSense_MODULE: ipsec
62
*/
63

  
64
##|+PRIV
65
##|*IDENT=page-status-ipsec
66
##|*NAME=Status: IPsec
67
##|*DESCR=Allow access to the 'Status: IPsec' page.
68
##|*MATCH=diag_ipsec.php*
69
##|-PRIV
70

  
71

  
72
global $g;
73

  
74
$pgtitle = array(gettext("Status"), gettext("IPsec"), gettext("Overview"));
75
$shortcut_section = "ipsec";
76

  
77
require("guiconfig.inc");
78
include("head.inc");
79
require_once("ipsec.inc");
80

  
81
if ($_GET['act'] == 'connect') {
82
	if (ctype_digit($_GET['ikeid'])) {
83
		$ph1ent = ipsec_get_phase1($_GET['ikeid']);
84
		if (!empty($ph1ent)) {
85
			if (empty($ph1ent['iketype']) || $ph1ent['iketype'] == 'ikev1') {
86
				$ph2entries = ipsec_get_number_of_phase2($_GET['ikeid']);
87
				for ($i = 0; $i < $ph2entries; $i++) {
88
					$connid = escapeshellarg("con{$_GET['ikeid']}00{$i}");
89
					mwexec("/usr/local/sbin/ipsec down {$connid}");
90
					mwexec("/usr/local/sbin/ipsec up {$connid}");
91
				}
92
			} else {
93
				mwexec("/usr/local/sbin/ipsec down con" . escapeshellarg($_GET['ikeid']));
94
				mwexec("/usr/local/sbin/ipsec up con" . escapeshellarg($_GET['ikeid']));
95
			}
96
		}
97
	}
98
} else if ($_GET['act'] == 'ikedisconnect') {
99
	if (ctype_digit($_GET['ikeid'])) {
100
		if (!empty($_GET['ikesaid']) && ctype_digit($_GET['ikesaid'])) {
101
			mwexec("/usr/local/sbin/ipsec down con" . escapeshellarg($_GET['ikeid']) . "[" . escapeshellarg($_GET['ikesaid']) . "]");
102
		} else {
103
			mwexec("/usr/local/sbin/ipsec down con" . escapeshellarg($_GET['ikeid']));
104
		}
105
	}
106
} else if ($_GET['act'] == 'childdisconnect') {
107
	if (ctype_digit($_GET['ikeid'])) {
108
		if (!empty($_GET['ikesaid']) && ctype_digit($_GET['ikesaid'])) {
109
			mwexec("/usr/local/sbin/ipsec down con" . escapeshellarg($_GET['ikeid']) . "{" . escapeshellarg($_GET['ikesaid']) . "}");
110
		}
111
	}
112
}
113

  
114
if (!is_array($config['ipsec']['phase1'])) {
115
	$config['ipsec']['phase1'] = array();
116
}
117

  
118
$a_phase1 = &$config['ipsec']['phase1'];
119

  
120
$status = ipsec_list_sa();
121

  
122
$tab_array = array();
123
$tab_array[] = array(gettext("Overview"), true, "diag_ipsec.php");
124
$tab_array[] = array(gettext("Leases"), false, "diag_ipsec_leases.php");
125
$tab_array[] = array(gettext("SAD"), false, "diag_ipsec_sad.php");
126
$tab_array[] = array(gettext("SPD"), false, "diag_ipsec_spd.php");
127
display_top_tabs($tab_array);
128
?>
129

  
130
<div class="panel panel-default">
131
	<div class="panel-heading">IPsec status</div>
132
	<div class="panel-body table responsive">
133
		<table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable>
134
			<thead>
135
				<tr>
136
					<th><?=gettext("Description")?></th>
137
					<th><?=gettext("Local ID")?></th>
138
					<th><?=gettext("Local IP")?></th>
139
					<th><?=gettext("Remote ID")?></th>
140
					<th><?=gettext("Remote IP")?></th>
141
					<th><?=gettext("Role")?></th>
142
					<th><?=gettext("Reauth")?></th>
143
					<th><?=gettext("Algo")?></th>
144
					<th><?=gettext("Status")?></th>
145
					<th></th>
146
				</tr>
147
			</thead>
148
			<tbody>
149
<?php
150
$ipsecconnected = array();
151

  
152
if (is_array($status)) {
153
	foreach ($status as $ikeid => $ikesa) {
154
	$con_id = substr($ikeid, 3);
155

  
156
		if ($ikesa['version'] == 1) {
157
			$ph1idx = substr($con_id, 0, strrpos(substr($con_id, 0, -1), '00'));
158
			$ipsecconnected[$ph1idx] = $ph1idx;
159
		} else {
160
			$ipsecconnected[$con_id] = $ph1idx = $con_id;
161
		}
162
?>
163
				<tr>
164
					<td>
165
						<?=htmlspecialchars(ipsec_get_descr($ph1idx))?>
166
					</td>
167
					<td>
168
<?php
169
		if (!empty($ikesa['local-id'])) {
170
			if ($ikesa['local-id'] == '%any') {
171
				print(gettext('Any identifier'));
172
			} else {
173
				print(htmlspecialchars($ikesa['local-id']));
174
			}
175
		} else {
176
			print(gettext("Unknown"));
177
		}
178

  
179
?>
180
					</td>
181
					<td>
182
<?php
183
		if (!empty($ikesa['local-host'])) {
184
			print(htmlspecialchars($ikesa['local-host']));
185
		} else {
186
			print(gettext("Unknown"));
187
		}
188
		/*
189
		 * XXX: local-nat-t was defined by pfSense
190
		 * When strongswan team accepted the change, they changed it to
191
		 * nat-local. Keep both for a while and remove local-nat-t in
192
		 * the future
193
		 */
194
		if (isset($ikesa['local-nat-t']) || isset($ikesa['nat-local'])) {
195
			print(" NAT-T");
196
		}
197
?>
198
					</td>
199
					<td>
200
<?php
201
		$identity = "";
202
		if (!empty($ikesa['remote-id'])) {
203
			if ($ikesa['remote-id'] == '%any') {
204
				$identity = 'Any identifier';
205
			} else {
206
				$identity = htmlspecialchars($ikesa['remote']['identification']);
207
			}
208
		}
209
		if (!empty($ikesa['remote-xauth-id'])) {
210
			echo htmlspecialchars($ikesa['remote-xauth-id']);
211
			echo "<br/>{$identity}";
212
		} elseif (!empty($ikesa['remote-eap-id'])) {
213
			echo htmlspecialchars($ikesa['remote-eap-id']);
214
			echo "<br/>{$identity}";
215
		} else {
216
			if (empty($identity)) {
217
				print(gettext("Unknown"));
218
			} else {
219
				print($identity);
220
			}
221
		}
222
?>
223
					</td>
224
					<td>
225
<?php
226
		if (!empty($ikesa['remote-host'])) {
227
			print(htmlspecialchars($ikesa['remote-host']));
228
		} else {
229
			print(gettext("Unknown"));
230
		}
231
		/*
232
		 * XXX: remote-nat-t was defined by pfSense
233
		 * When strongswan team accepted the change, they changed it to
234
		 * nat-remote. Keep both for a while and remove remote-nat-t in
235
		 * the future
236
		 */
237
		if (isset($ikesa['remote-nat-t']) || isset($ikesa['nat-remote'])) {
238
			print(" NAT-T");
239
		}
240
?>
241
					</td>
242
					<td>
243
						IKEv<?=htmlspecialchars($ikesa['version'])?>
244
						<br/>
245
<?php
246
		if ($ikesa['initiator'] == 'yes') {
247
			print("initiator");
248
		} else {
249
			print("responder");
250
		}
251
?>
252
					</td>
253
					<td>
254
						<?=htmlspecialchars($ikesa['reauth-time']) . gettext(" seconds (") . convert_seconds_to_hms($ikesa['reauth-time']) . ")";?>
255
					</td>
256
					<td>
257
						<?=htmlspecialchars($ikesa['encr-alg'])?>
258
						<br/>
259
						<?=htmlspecialchars($ikesa['integ-alg'])?>
260
						<br/>
261
						<?=htmlspecialchars($ikesa['prf-alg'])?>
262
						<br/>
263
						<?=htmlspecialchars($ikesa['dh-group'])?>
264
					</td>
265
					<td>
266
<?php
267
		if ($ikesa['state'] == 'ESTABLISHED') {
268
			print('<span style="color:green">');
269
		} else {
270
			print('<span>');
271
		}
272
?>
273
						<?=ucfirst(htmlspecialchars($ikesa['state']))?>
274
						<br/><?=htmlspecialchars($ikesa['established']) . gettext(" seconds (" . convert_seconds_to_hms($ikesa['established']) . ") ago")?>
275
						</span>
276
					</td>
277
					<td >
278
<?php
279
		if ($ikesa['state'] != 'ESTABLISHED') {
280
?>
281
					<a href="diag_ipsec.php?act=connect&amp;ikeid=<?=$con_id; ?>" class="btn btn-xs btn-success" data-toggle="tooltip" title="Connect VPN" >
282
							<?=gettext("Connect VPN")?>
283
						</a>
284
<?php
285
		} else {
286
?>
287
						<a href="diag_ipsec.php?act=ikedisconnect&amp;ikeid=<?=$con_id; ?>" class="btn btn-xs btn-danger" data-toggle="tooltip" title="Disconnect VPN">
288
							<?=gettext("Disconnect")?>
289
						</a><br />
290
<?php
291
		}
292
?>
293
					</td>
294
				</tr>
295
				<tr>
296
					<td colspan = 10>
297
<?php
298
		if (is_array($ikesa['child-sas']) && (count($ikesa['child-sas']) > 0)) {
299
?>
300
						<div id="btnchildsa-<?=$ikeid?>">
301
							<a type="button" onclick="show_childsa('childsa-<?=$ikeid?>','btnchildsa-<?=$ikeid?>');" class="btn btn-sm btn-default" />
302
								<?=gettext('Show child SA entries')?>
303
							</a>
304
						</div>
305

  
306
						<table class="table table-hover table-condensed" id="childsa-<?=$ikeid?>" style="display:none">
307
							<thead>
308
								<tr class="info">
309
									<th><?=gettext("Local subnets")?></th>
310
									<th><?=gettext("Local SPI(s)")?></th>
311
									<th><?=gettext("Remote subnets")?></th>
312
									<th><?=gettext("Times")?></th>
313
									<th><?=gettext("Algo")?></th>
314
									<th><?=gettext("Stats")?></th>
315
									<th><!-- Buttons --></th>
316
								</tr>
317
							</thead>
318
							<tbody>
319
<?php
320
			foreach ($ikesa['child-sas'] as $childid => $childsa) {
321
?>
322
								<tr>
323
									<td>
324
<?php
325
				if (is_array($childsa['local-ts'])) {
326
					foreach ($childsa['local-ts'] as $lnets) {
327
						print(htmlspecialchars(ipsec_fixup_network($lnets)) . "<br />");
328
					}
329
				} else {
330
					print(gettext("Unknown"));
331
				}
332
?>
333
									</td>
334
									<td>
335
<?php
336
				if (isset($childsa['spi-in'])) {
337
					print(gettext("Local: ") . htmlspecialchars($childsa['spi-in']));
338
				}
339

  
340
				if (isset($childsa['spi-out'])) {
341
					print('<br/>' . gettext('Remote: ') . htmlspecialchars($childsa['spi-out']));
342
				}
343
?>
344
									</td>
345
									<td>
346
<?php
347
				if (is_array($childsa['remote-ts'])) {
348
					foreach ($childsa['remote-ts'] as $rnets) {
349
						print(htmlspecialchars(ipsec_fixup_network($rnets)) . '<br />');
350
					}
351
				} else {
352
					print(gettext("Unknown"));
353
				}
354
?>
355
									</td>
356
									<td>
357
<?php
358
				print(gettext("Rekey: ") . htmlspecialchars($childsa['rekey-time']) . gettext(" seconds (") . convert_seconds_to_hms($childsa['rekey-time']) . ")");
359
				print('<br/>' . gettext('Life: ') . htmlspecialchars($childsa['life-time']) . gettext(" seconds (") . convert_seconds_to_hms($childsa['life-time']) . ")" );
360
				print('<br/>' . gettext('Install: ') .htmlspecialchars($childsa['install-time']) . gettext(" seconds (") . convert_seconds_to_hms($childsa['install-time']) . ")" );
361

  
362
?>
363
									</td>
364
									<td>
365
<?php
366
				print(htmlspecialchars($childsa['encr-alg']) . '<br/>');
367
				print(htmlspecialchars($childsa['integ-alg']) . '<br/>');
368

  
369
				if (!empty($childsa['prf-alg'])) {
370
					print(htmlspecialchars($childsa['prf-alg']) . '<br/>');
371
				}
372
				if (!empty($childsa['dh-group'])) {
373
					print(htmlspecialchars($childsa['dh-group']) . '<br/>');
374
				}
375
				if (!empty($childsa['esn'])) {
376
					print(htmlspecialchars($childsa['esn']) . '<br/>');
377
				}
378

  
379
				print(gettext("IPComp: "));
380
				if (!empty($childsa['cpi-in']) || !empty($childsa['cpi-out'])) {
381
					print(htmlspecialchars($childsa['cpi-in']) . " " . htmlspecialchars($childsa['cpi-out']));
382
				} else {
383
					print(gettext('none'));
384
				}
385
?>
386
									</td>
387
									<td>
388
<?php
389
				print(gettext("Bytes-In: ") . htmlspecialchars(number_format($childsa['bytes-in'])) . ' (' . htmlspecialchars(format_bytes($childsa['bytes-in'])) . ')<br/>');
390
				print(gettext("Packets-In: ") . htmlspecialchars(number_format($childsa['packets-in'])) . '<br/>');
391
				print(gettext("Bytes-Out: ") . htmlspecialchars(number_format($childsa['bytes-out'])) . ' (' . htmlspecialchars(format_bytes($childsa['bytes-out'])) . ')<br/>');
392
				print(gettext("Packets-Out: ") . htmlspecialchars(number_format($childsa['packets-out'])) . '<br/>');
393
?>
394
									</td>
395
									<td>
396
										<a href="diag_ipsec.php?act=childdisconnect&amp;ikeid=<?=$con_id; ?>&amp;ikesaid=<?=$childsa['uniqueid']; ?>" class="btn btn-xs btn-warning" data-toggle="tooltip" title="<?=gettext('Disconnect Child SA')?>">
397
											<?=gettext("Disconnect")?>
398
										</a>
399
									</td>
400
								</tr>
401
<?php
402
			}
403
?>
404

  
405
							</tbody>
406
						</table>
407
					</td>
408
				</tr>
409
<?php
410
		}
411

  
412
		unset($con_id);
413
	}
414

  
415
}
416

  
417
$rgmap = array();
418
foreach ($a_phase1 as $ph1ent) {
419
	if (isset($ph1ent['disabled'])) {
420
		continue;
421
	}
422

  
423
	$rgmap[$ph1ent['remote-gateway']] = $ph1ent['remote-gateway'];
424

  
425
	if ($ipsecconnected[$ph1ent['ikeid']]) {
426
		continue;
427
	}
428
?>
429
				<tr>
430
					<td>
431
<?php
432
	print(htmlspecialchars($ph1ent['descr']));
433
?>
434
					</td>
435
					<td>
436
<?php
437
	list ($myid_type, $myid_data) = ipsec_find_id($ph1ent, "local");
438
	if (empty($myid_data))
439
		print(gettext("Unknown"));
440
	else
441
		print(htmlspecialchars($myid_data));
442
?>
443
					</td>
444
					<td>
445
<?php
446
	$ph1src = ipsec_get_phase1_src($ph1ent);
447

  
448
	if (empty($ph1src))
449
		print(gettext("Unknown"));
450
	else
451
		print(htmlspecialchars($ph1src));
452
?>
453
					</td>
454
					<td>
455
<?php
456
	list ($peerid_type, $peerid_data) = ipsec_find_id($ph1ent, "peer", $rgmap);
457
	if (empty($peerid_data))
458
		print(gettext("Unknown"));
459
	else
460
		print(htmlspecialchars($peerid_data));
461
?>
462
					</td>
463
					<td>
464
<?php
465
	$ph1src = ipsec_get_phase1_dst($ph1ent);
466
	if (empty($ph1src))
467
		print(gettext("Unknown"));
468
	else
469
		print(htmlspecialchars($ph1src));
470
?>
471
					</td>
472
					<td>
473
					</td>
474
					<td>
475
					</td>
476
					<td>
477
					</td>
478
<?php
479
	if (isset($ph1ent['mobile'])) {
480
?>
481
					<td>
482
						<?=gettext("Awaiting connections")?>
483
					</td>
484
					<td>
485
					</td>
486
<?php
487
	} else {
488
?>
489
					<td>
490
						<?=gettext("Disconnected")?>
491
					</td>
492
					<td >
493
						<a href="diag_ipsec.php?act=connect&amp;ikeid=<?=$ph1ent['ikeid']; ?>" class="btn btn-xs btn-success">
494
							<?=gettext("Connect VPN")?>
495
						</a>
496
					</td>
497
<?php
498
	}
499
?>
500
					<td>
501
					</td>
502
				</tr>
503
<?php
504
}
505
unset($ipsecconnected, $phase1, $rgmap);
506
?>
507
			</tbody>
508
		</table>
509
	</div>
510
</div>
511

  
512
<script type="text/javascript">
513
//<![CDATA[
514
function show_childsa(id, buttonid) {
515
	document.getElementById(buttonid).innerHTML='';
516
	aodiv = document.getElementById(id);
517
	aodiv.style.display = "block";
518
}
519
//]]>
520
</script>
521

  
522
<?php
523
unset($status);
524
print_info_box(gettext("You can configure IPsec ") . '<a href="vpn_ipsec.php">Here</a>');
525
include("foot.inc"); ?>
src/usr/local/www/diag_ipsec_leases.php
1
<?php
2
/*
3
	diag_ipsec_leases.php
4
*/
5
/* ====================================================================
6
 *  Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
7
 *
8
 *  Redistribution and use in source and binary forms, with or without modification,
9
 *  are permitted provided that the following conditions are met:
10
 *
11
 *  1. Redistributions of source code must retain the above copyright notice,
12
 *      this list of conditions and the following disclaimer.
13
 *
14
 *  2. Redistributions in binary form must reproduce the above copyright
15
 *      notice, this list of conditions and the following disclaimer in
16
 *      the documentation and/or other materials provided with the
17
 *      distribution.
18
 *
19
 *  3. All advertising materials mentioning features or use of this software
20
 *      must display the following acknowledgment:
21
 *      "This product includes software developed by the pfSense Project
22
 *       for use in the pfSense software distribution. (http://www.pfsense.org/).
23
 *
24
 *  4. The names "pfSense" and "pfSense Project" must not be used to
25
 *       endorse or promote products derived from this software without
26
 *       prior written permission. For written permission, please contact
27
 *       coreteam@pfsense.org.
28
 *
29
 *  5. Products derived from this software may not be called "pfSense"
30
 *      nor may "pfSense" appear in their names without prior written
31
 *      permission of the Electric Sheep Fencing, LLC.
32
 *
33
 *  6. Redistributions of any form whatsoever must retain the following
34
 *      acknowledgment:
35
 *
36
 *  "This product includes software developed by the pfSense Project
37
 *  for use in the pfSense software distribution (http://www.pfsense.org/).
38
 *
39
 *  THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
40
 *  EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
41
 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42
 *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
43
 *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
44
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
45
 *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
46
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
47
 *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
48
 *  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
49
 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
50
 *  OF THE POSSIBILITY OF SUCH DAMAGE.
51
 *
52
 *  ====================================================================
53
 *
54
 */
55

  
56
/*
57
	pfSense_BUILDER_BINARIES:	/usr/local/sbin/ipsec
58
	pfSense_MODULE: ipsec
59
*/
60

  
61
##|+PRIV
62
##|*IDENT=page-status-ipsec-leases
63
##|*NAME=Status: IPsec: Leases
64
##|*DESCR=Allow access to the 'Status: IPsec: Leases' page.
65
##|*MATCH=diag_ipsec_leases.php*
66
##|-PRIV
67

  
68
define(DEBUG, true); // Force dummy data for testing. Setting up a pFSense box to get real data is far too hard!
69

  
70
require("guiconfig.inc");
71
require("ipsec.inc");
72

  
73
$pgtitle = array(gettext("Status"), gettext("IPsec"), gettext("Leases"));
74
$shortcut_section = "ipsec";
75
include("head.inc");
76

  
77
$mobile = ipsec_dump_mobile();
78

  
79
$tab_array = array();
80
$tab_array[] = array(gettext("Overview"), false, "diag_ipsec.php");
81
$tab_array[] = array(gettext("Leases"), true, "diag_ipsec_leases.php");
82
$tab_array[] = array(gettext("SAD"), false, "diag_ipsec_sad.php");
83
$tab_array[] = array(gettext("SPD"), false, "diag_ipsec_spd.php");
84
display_top_tabs($tab_array);
85

  
86
if (isset($mobile['pool']) && is_array($mobile['pool'])) {
87
?>
88
	<div class="table-responsive">
89
		<table class="table table-striped table-condensed table-hover sortable-theme-bootstrap" data-sortable>
90
			<thead>
91
				<tr>
92
					<th><?=gettext("Pool")?></th>
93
					<th><?=gettext("Usage")?></th>
94
					<th><?=gettext("Online")?></th>
95
					<th><?=gettext("ID")?></th>
96
					<th><?=gettext("Host")?></th>
97
					<th><?=gettext("Status")?></th>
98
				</tr>
99
			</thead>
100
			<tbody>
101
<?php
102
			foreach ($mobile['pool'] as $pool) {
103
				// The first row of each pool includes the pool information
104
?>
105
				<tr>
106
					<td>
107
						<?=$pool['name']?>
108
					</td>
109
					<td>
110
						<?=$pool['usage']?>
111
					</td>
112
					<td>
113
						<?=$pool['online']?>
114
					</td>
115

  
116
<?php
117
				$leaserow = true;
118
				if (is_array($pool['lease']) && count($pool['lease']) > 0) {
119
					foreach ($pool['lease'] as $lease) {
120
						if (!$leaserow) {
121
							// On subsequent rows the first three columns are blank
122
?>
123
				<tr>
124
					<td></td>
125
					<td></td>
126
					<td></td>
127
<?php
128
						}
129
						$leaserow = false;
130
?>
131
					<td>
132
						<?=htmlspecialchars($lease['id'])?>
133
					</td>
134
					<td>
135
						<?=htmlspecialchars($lease['host'])?>
136
					</td>
137
					<td>
138
						<?=htmlspecialchars($lease['status'])?>
139
					</td>
140
				</tr>
141
<?php
142

  
143
					}
144
				}
145
				else {
146
?>
147
					<td colspan="3" class="warning"><?=gettext('No leases from this pool yet.')?></td>
148
				</tr>
149
<?php
150
				}
151
			}
152
?>
153
			</tbody>
154
		</table>
155
	</div>
156
<?php
157
}
158
else
159
	print_info_box(gettext('No IPsec pools.'));
160

  
161
print_info_box(gettext('You can configure your IPsec subsystem by clicking ') . '<a href="vpn_ipsec.php">' . gettext("here.") . '</a>');
162

  
163
include("foot.inc");
src/usr/local/www/diag_ipsec_sad.php
1
<?php
2
/*
3
	diag_ipsec_sad.php
4
*/
5
/* ====================================================================
6
 *  Copyright (c)  2004-2015  Electric Sheep Fencing, LLC. All rights reserved.
7
 *
8
 *  Some or all of this file is based on the m0n0wall project which is
9
 *  Copyright (c)  2004 Manuel Kasper (BSD 2 clause)
10
 *
11
 *  Redistribution and use in source and binary forms, with or without modification,
12
 *  are permitted provided that the following conditions are met:
13
 *
14
 *  1. Redistributions of source code must retain the above copyright notice,
15
 *      this list of conditions and the following disclaimer.
16
 *
17
 *  2. Redistributions in binary form must reproduce the above copyright
18
 *      notice, this list of conditions and the following disclaimer in
19
 *      the documentation and/or other materials provided with the
20
 *      distribution.
21
 *
22
 *  3. All advertising materials mentioning features or use of this software
23
 *      must display the following acknowledgment:
24
 *      "This product includes software developed by the pfSense Project
25
 *       for use in the pfSense software distribution. (http://www.pfsense.org/).
26
 *
27
 *  4. The names "pfSense" and "pfSense Project" must not be used to
28
 *       endorse or promote products derived from this software without
29
 *       prior written permission. For written permission, please contact
30
 *       coreteam@pfsense.org.
31
 *
32
 *  5. Products derived from this software may not be called "pfSense"
33
 *      nor may "pfSense" appear in their names without prior written
34
 *      permission of the Electric Sheep Fencing, LLC.
35
 *
36
 *  6. Redistributions of any form whatsoever must retain the following
37
 *      acknowledgment:
38
 *
39
 *  "This product includes software developed by the pfSense Project
40
 *  for use in the pfSense software distribution (http://www.pfsense.org/).
41
 *
42
 *  THIS SOFTWARE IS PROVIDED BY THE pfSense PROJECT ``AS IS'' AND ANY
43
 *  EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44
 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
45
 *  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE pfSense PROJECT OR
46
 *  ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
47
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
48
 *  NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
49
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
50
 *  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
51
 *  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
52
 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
53
 *  OF THE POSSIBILITY OF SUCH DAMAGE.
54
 *
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff