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-2018 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
			'load_balancer',
212
			'nat',
213
			'openvpn',
214
			'schedules',
215
			'unbound',
216
			'wol',
217
		);
218

    
219
		$syncd_full_sections = array();
220

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    
436
		/*
437
		 * Process vouchers sent by primary node and:
438
		 * - Add new items
439
		 * - Update existing items based on 'lastsync' field
440
		 */
441
		foreach ($voucher as $zone => $item) {
442
			if (!is_array($item['roll'])) {
443
				continue;
444
			}
445
			foreach ($item['roll'] as $idx => $roll) {
446
				if (!isset($l_rolls[$zone][$roll['number']])) {
447
					$config['voucher'][$zone]['roll'][] =
448
					    $roll;
449
					continue;
450
				}
451
				$l_roll_idx = $l_rolls[$zone][$roll['number']];
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
	public function filter_configure($reset_accounts = true) {
665
		$this->auth();
666

    
667
		global $g, $config;
668

    
669
		filter_configure();
670
		system_routing_configure();
671
		setup_gateways_monitor();
672
		relayd_configure();
673
		require_once("openvpn.inc");
674
		openvpn_resync_all();
675

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

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

    
710
		if ($reset_accounts) {
711
			local_reset_accounts();
712
		}
713

    
714
		captiveportal_configure();
715

    
716
		return true;
717
	}
718

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

    
727
		if ($this->loop_detected) {
728
			log_error("Disallowing CARP sync loop");
729
			return true;
730
		}
731

    
732
		interfaces_vips_configure();
733

    
734
		return true;
735
	}
736

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

    
745
		mwexec_bg("/etc/rc.reboot");
746

    
747
		return true;
748
	}
749
}
750

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

    
755
$xmlrpclockkey = lock('xmlrpc', LOCK_EX);
756

    
757
XML_RPC2_Backend::setBackend('php');
758
$HTTP_RAW_POST_DATA = file_get_contents('php://input');
759

    
760
$options = array(
761
	'prefix' => 'pfsense.',
762
	'encoding' => 'utf-8',
763
	'autoDocument' => false,
764
);
765

    
766
$server = XML_RPC2_Server::create(new pfsense_xmlrpc_server(), $options);
767
$server->handleCall();
768

    
769
unlock($xmlrpclockkey);
770

    
771
?>
(234-234/234)