Project

General

Profile

Download (18.7 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
 * xmlrpc.php
4
 *
5
 * part of pfSense (https://www.pfsense.org)
6
 * Copyright (c) 2004-2019 Rubicon Communications, LLC (Netgate)
7
 * Copyright (c) 2005 Colin Smith
8
 * All rights reserved.
9
 *
10
 * Licensed under the Apache License, Version 2.0 (the "License");
11
 * you may not use this file except in compliance with the License.
12
 * You may obtain a copy of the License at
13
 *
14
 * http://www.apache.org/licenses/LICENSE-2.0
15
 *
16
 * Unless required by applicable law or agreed to in writing, software
17
 * distributed under the License is distributed on an "AS IS" BASIS,
18
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19
 * See the License for the specific language governing permissions and
20
 * limitations under the License.
21
 */
22

    
23
##|+PRIV
24
##|*IDENT=page-xmlrpclibrary
25
##|*NAME=XMLRPC Library
26
##|*DESCR=Allow access to the 'XMLRPC Library' page.
27
##|*MATCH=xmlrpc.php*
28
##|-PRIV
29

    
30
require_once("config.inc");
31
require_once("functions.inc");
32
require_once("auth.inc");
33
require_once("filter.inc");
34
require_once("ipsec.inc");
35
require_once("vpn.inc");
36
require_once("captiveportal.inc");
37
require_once("shaper.inc");
38
require_once("XML/RPC2/Server.php");
39

    
40
class pfsense_xmlrpc_server {
41

    
42
	private $loop_detected = false;
43
	private $remote_addr;
44

    
45
	private function auth() {
46
		global $config;
47
		$username = $_SERVER['PHP_AUTH_USER'];
48
		$password = $_SERVER['PHP_AUTH_PW'];
49

    
50
		$login_ok = false;
51
		if (!empty($username) && !empty($password)) {
52
			$attributes = array();
53
			$authcfg = auth_get_authserver(
54
			    $config['system']['webgui']['authmode']);
55

    
56
			if (authenticate_user($username, $password,
57
			    $authcfg, $attributes) ||
58
			    authenticate_user($username, $password)) {
59
				$login_ok = true;
60
			}
61
		}
62

    
63
		if (!$login_ok) {
64
			log_auth("webConfigurator authentication error for '" .
65
			    $username . "' from " . $this->remote_addr);
66

    
67
			require_once("XML/RPC2/Exception.php");
68
			throw new XML_RPC2_FaultException(gettext(
69
			    'Authentication failed: Invalid username or password'),
70
			    -1);
71
		}
72

    
73
		$user_entry = getUserEntry($username);
74
		/*
75
		 * admin (uid = 0) is allowed
76
		 * or regular user with necessary privilege
77
		 */
78
		if (isset($user_entry['uid']) && $user_entry['uid'] != '0' &&
79
		    !userHasPrivilege($user_entry, 'system-xmlrpc-ha-sync')) {
80
			log_auth("webConfigurator authentication error for '" .
81
			    $username . "' from " . $this->remote_addr .
82
			    " not enough privileges");
83

    
84
			require_once("XML/RPC2/Exception.php");
85
			throw new XML_RPC2_FaultException(gettext(
86
			    'Authentication failed: not enough privileges'),
87
			    -2);
88
		}
89

    
90
		return;
91
	}
92

    
93
	private function array_overlay($a1, $a2) {
94
		foreach ($a1 as $k => $v) {
95
			if (!array_key_exists($k, $a2)) {
96
				continue;
97
			}
98
			if (is_array($v) && is_array($a2[$k])) {
99
				$a1[$k] = $this->array_overlay($v, $a2[$k]);
100
			} else {
101
				$a1[$k] = $a2[$k];
102
			}
103
		}
104

    
105
		return $a1;
106
	}
107

    
108
	public function __construct() {
109
		global $config;
110

    
111
		$this->remote_addr = $_SERVER['REMOTE_ADDR'];
112

    
113
		/* grab sync to ip if enabled */
114
		if (isset($config['hasync']['synchronizetoip']) &&
115
		    $config['hasync']['synchronizetoip'] == $this->remote_addr) {
116
			$this->loop_detected = true;
117
		}
118
	}
119

    
120
	/**
121
	 * Get host version information
122
	 *
123
	 * @return array
124
	 */
125
	public function host_firmware_version($dummy = 1) {
126
		$this->auth();
127
		return host_firmware_version();
128
	}
129

    
130
	/**
131
	 * Executes a PHP block of code
132
	 *
133
	 * @param string $code
134
	 *
135
	 * @return bool
136
	 */
137
	public function exec_php($code) {
138
		$this->auth();
139

    
140
		eval($code);
141
		if ($toreturn) {
142
			return $toreturn;
143
		}
144

    
145
		return true;
146
	}
147

    
148
	/**
149
	 * Executes shell commands
150
	 *
151
	 * @param string $code
152
	 *
153
	 * @return bool
154
	 */
155
	public function exec_shell($code) {
156
		$this->auth();
157

    
158
		mwexec($code);
159
		return true;
160
	}
161

    
162
	/**
163
	 * Backup chosen config sections
164
	 *
165
	 * @param array $section
166
	 *
167
	 * @return array
168
	 */
169
	public function backup_config_section($section) {
170
		$this->auth();
171

    
172
		global $config;
173

    
174
		return array_intersect_key($config, array_flip($section));
175
	}
176

    
177
	/**
178
	 * Restore defined config section into local config
179
	 *
180
	 * @param array $sections
181
	 *
182
	 * @return bool
183
	 */
184
	public function restore_config_section($sections) {
185
		$this->auth();
186

    
187
		global $config, $cpzone, $cpzoneid;
188

    
189
		$old_config = $config;
190
		$old_ipsec_enabled = ipsec_enabled();
191

    
192
		if ($this->loop_detected) {
193
			log_error("Disallowing CARP sync loop");
194
			return true;
195
		}
196

    
197
		/*
198
		 * Some sections should just be copied and not merged or we end
199
		 * up unable to sync the deletion of the last item in a section
200
		 */
201
		$sync_full_sections = array(
202
			'aliases',
203
			'ca',
204
			'cert',
205
			'crl',
206
			'dhcpd',
207
			'dhcpv6',
208
			'dnsmasq',
209
			'filter',
210
			'ipsec',
211
			'nat',
212
			'openvpn',
213
			'schedules',
214
			'unbound',
215
			'wol',
216
		);
217

    
218
		$syncd_full_sections = array();
219

    
220
		foreach ($sync_full_sections as $section) {
221
			if (!isset($sections[$section])) {
222
				continue;
223
			}
224

    
225
			$config[$section] = $sections[$section];
226
			unset($sections[$section]);
227
			$syncd_full_sections[] = $section;
228
		}
229

    
230
		/* Create a list of CP zones to be deleted locally */
231
		$cp_to_del = array();
232
		if (is_array($config['captiveportal'])) {
233
			if (is_array($sections['captiveportal'])) {
234
				$remote_cp = $sections['captiveportal'];
235
			} else {
236
				$remote_cp = array();
237
			}
238
			foreach ($config['captiveportal'] as $zone => $item) {
239
				if (!isset($remote_cp[$zone])) {
240
					$cp_to_del[] = $zone;
241
				}
242
			}
243
			unset($remote_cp);
244
		}
245

    
246
		/* Only touch users if users are set to synchronize from the primary node
247
		 * See https://redmine.pfsense.org/issues/8450
248
		 */
249
		if ($sections['system']['user'] && $sections['system']['group']) {
250
			$g2add = array();
251
			$g2del = array();
252
			$g2del_idx = array();
253
			$g2keep = array();
254
			if (is_array($sections['system']['group'])) {
255
				$local_groups = isset($config['system']['group'])
256
				    ? $config['system']['group']
257
				    : array();
258

    
259
				foreach ($sections['system']['group'] as $group) {
260
					$idx = array_search($group['name'],
261
					    array_column($local_groups, 'name'));
262

    
263
					if ($idx === false) {
264
						$g2add[] = $group;
265
					} else if ($group['gid'] < 1999) {
266
						$g2keep[] = $idx;
267
					} else if ($group != $local_groups[$idx]) {
268
						$g2add[] = $group;
269
						$g2del[] = $group;
270
						$g2del_idx[] = $idx;
271
					} else {
272
						$g2keep[] = $idx;
273
					}
274
				}
275
			}
276
			if (is_array($config['system']['group'])) {
277
				foreach ($config['system']['group'] as $idx => $group) {
278
					if (array_search($idx, $g2keep) === false &&
279
					    array_search($idx, $g2del_idx) === false) {
280
						$g2del[] = $group;
281
						$g2del_idx[] = $idx;
282
					}
283
				}
284
			}
285
			unset($sections['system']['group'], $g2keep, $g2del_idx);
286

    
287
			$u2add = array();
288
			$u2del = array();
289
			$u2del_idx = array();
290
			$u2keep = array();
291
			if (is_array($sections['system']['user'])) {
292
				$local_users = isset($config['system']['user'])
293
				    ? $config['system']['user']
294
				    : array();
295

    
296
				foreach ($sections['system']['user'] as $user) {
297
					$idx = array_search($user['name'],
298
					    array_column($local_users, 'name'));
299

    
300
					if ($idx === false) {
301
						$u2add[] = $user;
302
					} else if (($user['uid'] < 2000) && ($sections['hasync']['adminsync'] != 'on')) {
303
						$u2keep[] = $idx;
304
					} else if ($user != $local_users[$idx]) {
305
						$u2add[] = $user;
306
						$u2del[] = $user;
307
						$u2del_idx[] = $idx;
308
					} else {
309
						$u2keep[] = $idx;
310
					}
311
				}
312
			}
313
			if (is_array($config['system']['user'])) {
314
				foreach ($config['system']['user'] as $idx => $user) {
315
					if (array_search($idx, $u2keep) === false &&
316
					    array_search($idx, $u2del_idx) === false) {
317
						$u2del[] = $user;
318
						$u2del_idx[] = $idx;
319
					}
320
				}
321
			}
322
			unset($sections['system']['user'], $u2keep, $u2del_idx);
323
		}
324

    
325
		$voucher = array();
326
		if (is_array($sections['voucher'])) {
327
			/* Save voucher rolls to process after merge */
328
			$voucher = $sections['voucher'];
329

    
330
			foreach($sections['voucher'] as $zone => $item) {
331
				unset($sections['voucher'][$zone]['roll']);
332
				if (isset($config['voucher'][$zone]['vouchersyncdbip'])) {
333
					$sections['voucher'][$zone]['vouchersyncdbip'] =
334
					    $config['voucher'][$zone]['vouchersyncdbip'];
335
				} else {
336
					unset($sections['voucher'][$zone]['vouchersyncdbip']);
337
				}
338
				if (isset($config['voucher'][$zone]['vouchersyncport'])) {
339
					$sections['voucher'][$zone]['vouchersyncport'] =
340
					    $config['voucher'][$zone]['vouchersyncport'];
341
				} else {
342
					unset($sections['voucher'][$zone]['vouchersyncport']);
343
				}
344
				if (isset($config['voucher'][$zone]['vouchersyncusername'])) {
345
					$sections['voucher'][$zone]['vouchersyncusername'] =
346
					    $config['voucher'][$zone]['vouchersyncusername'];
347
				} else {
348
					unset($sections['voucher'][$zone]['vouchersyncusername']);
349
				}
350
				if (isset($config['voucher'][$zone]['vouchersyncpass'])) {
351
					$sections['voucher'][$zone]['vouchersyncpass'] =
352
					    $config['voucher'][$zone]['vouchersyncpass'];
353
				} else {
354
					unset($sections['voucher'][$zone]['vouchersyncpass']);
355
				}
356
			}
357
		}
358

    
359
		$vipbackup = array();
360
		$oldvips = array();
361
		if (isset($sections['virtualip']) &&
362
		    is_array($config['virtualip']['vip'])) {
363
			foreach ($config['virtualip']['vip'] as $vip) {
364
				if ($vip['mode'] == "carp") {
365
					$key = $vip['interface'] .
366
					    "_vip" . $vip['vhid'];
367

    
368
					$oldvips[$key]['content'] =
369
					    $vip['password'] .
370
					    $vip['advskew'] .
371
					    $vip['subnet'] .
372
					    $vip['subnet_bits'] .
373
					    $vip['advbase'];
374
					$oldvips[$key]['interface'] =
375
					    $vip['interface'];
376
					$oldvips[$key]['subnet'] =
377
					    $vip['subnet'];
378
				} else if ($vip['mode'] == "ipalias" &&
379
				    (substr($vip['interface'], 0, 4) == '_vip'
380
				    || strstr($vip['interface'], "lo0"))) {
381
					$oldvips[$vip['subnet']]['content'] =
382
					    $vip['interface'] .
383
					    $vip['subnet'] .
384
					    $vip['subnet_bits'];
385
					$oldvips[$vip['subnet']]['interface'] =
386
					    $vip['interface'];
387
					$oldvips[$vip['subnet']]['subnet'] =
388
					    $vip['subnet'];
389
				} else if (($vip['mode'] == "ipalias" ||
390
				    $vip['mode'] == 'proxyarp') &&
391
				    !(substr($vip['interface'], 0, 4) == '_vip')
392
				    || strstr($vip['interface'], "lo0")) {
393
					$vipbackup[] = $vip;
394
				}
395
			}
396
		}
397

    
398
		/* For vip section, first keep items sent from the master */
399
		$config = array_merge_recursive_unique($config, $sections);
400

    
401
		/* Remove local CP zones removed remote */
402
		foreach ($cp_to_del as $zone) {
403
			$cpzone = $zone;
404
			$cpzoneid = $config['captiveportal'][$cpzone]['zoneid'];
405
			unset($config['captiveportal'][$cpzone]['enable']);
406
			captiveportal_configure_zone(
407
			    $config['captiveportal'][$cpzone]);
408
			unset($config['captiveportal'][$cpzone]);
409
			if (isset($config['voucher'][$cpzone])) {
410
				unset($config['voucher'][$cpzone]);
411
			}
412
		}
413

    
414
		/* Remove locally items removed remote */
415
		foreach ($voucher as $zone => $item) {
416
			/* No rolls on master, delete local ones */
417
			if (!is_array($item['roll'])) {
418
				unset($config['voucher'][$zone]['roll']);
419
			}
420
		}
421

    
422
		$l_rolls = array();
423
		if (is_array($config['voucher'])) {
424
			foreach ($config['voucher'] as $zone => $item) {
425
				if (!is_array($item['roll'])) {
426
					continue;
427
				}
428
				foreach ($item['roll'] as $idx => $roll) {
429
					/* Make it easy to find roll by # */
430
					$l_rolls[$zone][$roll['number']] = $idx;
431
				}
432
			}
433
		}
434

    
435
		/*
436
		 * Process vouchers sent by primary node and:
437
		 * - Add new items
438
		 * - Update existing items based on 'lastsync' field
439
		 */
440
		foreach ($voucher as $zone => $item) {
441
			if (!is_array($item['roll'])) {
442
				continue;
443
			}
444
			foreach ($item['roll'] as $idx => $roll) {
445
				if (!isset($l_rolls[$zone][$roll['number']])) {
446
					$config['voucher'][$zone]['roll'][] =
447
					    $roll;
448
					continue;
449
				}
450
				$l_roll_idx = $l_rolls[$zone][$roll['number']];
451
				init_config_arr(array('voucher', $zone));
452
				$l_vouchers = &$config['voucher'][$zone];
453
				$l_roll = $l_vouchers['roll'][$l_roll_idx];
454
				if (!isset($l_roll['lastsync'])) {
455
					$l_roll['lastsync'] = 0;
456
				}
457

    
458
				if (isset($roll['lastsync']) &&
459
				    $roll['lastsync'] != $l_roll['lastsync']) {
460
					$l_vouchers['roll'][$l_roll_idx] =
461
					    $roll;
462
					unset($l_rolls[$zone][$roll['number']]);
463
				}
464
			}
465
		}
466

    
467
		/*
468
		 * At this point $l_rolls contains only items that are not
469
		 * present on primary node. They must be removed
470
		 */
471
		foreach ($l_rolls as $zone => $item) {
472
			foreach ($item as $number => $idx) {
473
				unset($config['voucher'][$zone][$idx]);
474
			}
475
		}
476

    
477
		/*
478
		 * Then add ipalias and proxyarp types already defined
479
		 * on the backup
480
		 */
481
		if (is_array($vipbackup) && !empty($vipbackup)) {
482
			if (!is_array($config['virtualip'])) {
483
				$config['virtualip'] = array();
484
			}
485
			if (!is_array($config['virtualip']['vip'])) {
486
				$config['virtualip']['vip'] = array();
487
			}
488
			foreach ($vipbackup as $vip) {
489
				array_unshift($config['virtualip']['vip'], $vip);
490
			}
491
		}
492

    
493
		/* Log what happened */
494
		$mergedkeys = implode(", ", array_merge(array_keys($sections),
495
		    $syncd_full_sections));
496
		write_config(sprintf(gettext(
497
		    "Merged in config (%s sections) from XMLRPC client."),
498
		    $mergedkeys));
499

    
500
		/*
501
		 * The real work on handling the vips specially
502
		 * This is a copy of intefaces_vips_configure with addition of
503
		 * not reloading existing/not changed carps
504
		 */
505
		if (isset($sections['virtualip']) &&
506
		    is_array($config['virtualip']) &&
507
		    is_array($config['virtualip']['vip'])) {
508
			$carp_setuped = false;
509
			$anyproxyarp = false;
510

    
511
			foreach ($config['virtualip']['vip'] as $vip) {
512
				$key = "{$vip['interface']}_vip{$vip['vhid']}";
513

    
514
				if ($vip['mode'] == "carp" &&
515
				    isset($oldvips[$key])) {
516
					if ($oldvips[$key]['content'] ==
517
					    $vip['password'] .
518
					    $vip['advskew'] .
519
					    $vip['subnet'] .
520
					    $vip['subnet_bits'] .
521
					    $vip['advbase'] &&
522
					    does_vip_exist($vip)) {
523
						unset($oldvips[$key]);
524
						/*
525
						 * Skip reconfiguring this vips
526
						 * since nothing has changed.
527
						 */
528
						continue;
529
					}
530

    
531
				} elseif ($vip['mode'] == "ipalias" &&
532
				    (substr($vip['interface'], 0, 4) == '_vip'
533
				    || strstr($vip['interface'], "lo0")) &&
534
				    isset($oldvips[$vip['subnet']])) {
535
					$key = $vip['subnet'];
536
					if ($oldvips[$key]['content'] ==
537
					    $vip['interface'] .
538
					    $vip['subnet'] .
539
					    $vip['subnet_bits'] &&
540
					    does_vip_exist($vip)) {
541
						unset($oldvips[$key]);
542
						/*
543
						 * Skip reconfiguring this vips
544
						 * since nothing has changed.
545
						 */
546
						continue;
547
					}
548
					unset($oldvips[$key]);
549
				}
550

    
551
				switch ($vip['mode']) {
552
				case "proxyarp":
553
					$anyproxyarp = true;
554
					break;
555
				case "ipalias":
556
					interface_ipalias_configure($vip);
557
					break;
558
				case "carp":
559
					$carp_setuped = true;
560
					interface_carp_configure($vip);
561
					break;
562
				}
563
			}
564

    
565
			/* Cleanup remaining old carps */
566
			foreach ($oldvips as $oldvipar) {
567
				$oldvipif = get_real_interface(
568
				    $oldvipar['interface']);
569

    
570
				if (empty($oldvipif)) {
571
					continue;
572
				}
573

    
574
				if (is_ipaddrv6($oldvipar['subnet'])) {
575
					 mwexec("/sbin/ifconfig " .
576
					     escapeshellarg($oldvipif) .
577
					     " inet6 " .
578
					     escapeshellarg($oldvipar['subnet']) .
579
					     " delete");
580
				} else {
581
					pfSense_interface_deladdress($oldvipif,
582
					    $oldvipar['subnet']);
583
				}
584
			}
585
			if ($carp_setuped == true) {
586
				interfaces_sync_setup();
587
			}
588
			if ($anyproxyarp == true) {
589
				interface_proxyarp_configure();
590
			}
591
		}
592

    
593
		if ($old_ipsec_enabled !== ipsec_enabled()) {
594
			vpn_ipsec_configure();
595
		}
596

    
597
		unset($old_config);
598

    
599
		local_sync_accounts($u2add, $u2del, $g2add, $g2del);
600
		$this->filter_configure(false);
601

    
602
		return true;
603
	}
604

    
605
	/**
606
	 * Merge items into installedpackages config section
607
	 *
608
	 * @param array $section
609
	 *
610
	 * @return bool
611
	 */
612
	public function merge_installedpackages_section($section) {
613
		$this->auth();
614

    
615
		global $config;
616

    
617
		if ($this->loop_detected) {
618
			log_error("Disallowing CARP sync loop");
619
			return true;
620
		}
621

    
622
		$config['installedpackages'] = array_merge(
623
		    $config['installedpackages'], $section);
624
		$mergedkeys = implode(", ", array_keys($section));
625
		write_config(sprintf(gettext(
626
		    "Merged in config (%s sections) from XMLRPC client."),
627
		    $mergedkeys));
628

    
629
		return true;
630
	}
631

    
632
	/**
633
	 * Merge items into config
634
	 *
635
	 * @param array $section
636
	 *
637
	 * @return bool
638
	 */
639
	public function merge_config_section($section) {
640
		$this->auth();
641

    
642
		global $config;
643

    
644
		if ($this->loop_detected) {
645
			log_error("Disallowing CARP sync loop");
646
			return true;
647
		}
648

    
649
		$config_new = $this->array_overlay($config, $section);
650
		$config = $config_new;
651
		$mergedkeys = implode(", ", array_keys($section));
652
		write_config(sprintf(gettext(
653
		    "Merged in config (%s sections) from XMLRPC client."),
654
		    $mergedkeys));
655

    
656
		return true;
657
	}
658

    
659
	/**
660
	 * Wrapper for filter_configure()
661
	 *
662
	 * @return bool
663
	 */
664
	private function filter_configure($reset_accounts = true) {
665
		global $g, $config;
666

    
667
		filter_configure();
668
		system_routing_configure();
669
		setup_gateways_monitor();
670
		require_once("openvpn.inc");
671
		openvpn_resync_all();
672

    
673
		/*
674
		 * The DNS Resolver and the DNS Forwarder may both be active so
675
		 * long as * they are running on different ports.
676
		 * See ticket #5882
677
		 */
678
		if (isset($config['dnsmasq']['enable'])) {
679
			/* Configure dnsmasq but tell it NOT to restart DHCP */
680
			services_dnsmasq_configure(false);
681
		} else {
682
			/* kill any running dnsmasq instance */
683
			if (isvalidpid("{$g['varrun_path']}/dnsmasq.pid")) {
684
				sigkillbypid("{$g['varrun_path']}/dnsmasq.pid",
685
				    "TERM");
686
			}
687
		}
688
		if (isset($config['unbound']['enable'])) {
689
			/* Configure unbound but tell it NOT to restart DHCP */
690
			services_unbound_configure(false);
691
		} else {
692
			/* kill any running Unbound instance */
693
			if (isvalidpid("{$g['varrun_path']}/unbound.pid")) {
694
				sigkillbypid("{$g['varrun_path']}/unbound.pid",
695
				    "TERM");
696
			}
697
		}
698

    
699
		/*
700
		 * Call this separately since the above are manually set to
701
		 * skip the DHCP restart they normally perform.
702
		 * This avoids restarting dhcpd twice as described on
703
		 * ticket #3797
704
		 */
705
		services_dhcpd_configure();
706

    
707
		if ($reset_accounts) {
708
			local_reset_accounts();
709
		}
710

    
711
		captiveportal_configure();
712

    
713
		return true;
714
	}
715

    
716
	/**
717
	 * Wrapper for configuring CARP interfaces
718
	 *
719
	 * @return bool
720
	 */
721
	public function interfaces_carp_configure() {
722
		$this->auth();
723

    
724
		if ($this->loop_detected) {
725
			log_error("Disallowing CARP sync loop");
726
			return true;
727
		}
728

    
729
		interfaces_vips_configure();
730

    
731
		return true;
732
	}
733

    
734
	/**
735
	 * Wrapper for rc.reboot
736
	 *
737
	 * @return bool
738
	 */
739
	public function reboot() {
740
		$this->auth();
741

    
742
		mwexec_bg("/etc/rc.reboot");
743

    
744
		return true;
745
	}
746
}
747

    
748
// run script untill its done and can 'unlock' the xmlrpc.lock, this prevents hanging php-fpm / webgui
749
ignore_user_abort(true);
750
set_time_limit(0);
751

    
752
$xmlrpclockkey = lock('xmlrpc', LOCK_EX);
753

    
754
XML_RPC2_Backend::setBackend('php');
755
$HTTP_RAW_POST_DATA = file_get_contents('php://input');
756

    
757
$options = array(
758
	'prefix' => 'pfsense.',
759
	'encoding' => 'utf-8',
760
	'autoDocument' => false,
761
);
762

    
763
$server = XML_RPC2_Server::create(new pfsense_xmlrpc_server(), $options);
764
$server->handleCall();
765

    
766
unlock($xmlrpclockkey);
767

    
768
?>
(225-225/225)