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
			'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
				init_config_arr(array('voucher', $zone));
453
				$l_vouchers = &$config['voucher'][$zone];
454
				$l_roll = $l_vouchers['roll'][$l_roll_idx];
455
				if (!isset($l_roll['lastsync'])) {
456
					$l_roll['lastsync'] = 0;
457
				}
458

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

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

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

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

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

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

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

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

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

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

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

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

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

    
598
		unset($old_config);
599

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

    
603
		return true;
604
	}
605

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

    
616
		global $config;
617

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

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

    
630
		return true;
631
	}
632

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

    
643
		global $config;
644

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

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

    
657
		return true;
658
	}
659

    
660
	/**
661
	 * Wrapper for filter_configure()
662
	 *
663
	 * @return bool
664
	 */
665
	public function filter_configure($reset_accounts = true) {
666
		$this->auth();
667

    
668
		global $g, $config;
669

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

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

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

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

    
715
		captiveportal_configure();
716

    
717
		return true;
718
	}
719

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

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

    
733
		interfaces_vips_configure();
734

    
735
		return true;
736
	}
737

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

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

    
748
		return true;
749
	}
750
}
751

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

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

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

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

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

    
770
unlock($xmlrpclockkey);
771

    
772
?>
(234-234/234)