Project

General

Profile

Todo #12431 » 429-working.diff

Jim Pingle, 06/06/2023 05:40 PM

View differences:

src/usr/local/www/pkg.php
94 94

  
95 95
$evaledvar = config_get_path($config_path, []);
96 96

  
97
if ($_REQUEST['act'] == "update") {
97
if ($_POST['act'] == "update") {
98 98

  
99
	if (is_array($config['installedpackages'][$pkg['name']]) && $pkg['name'] != "" && $_REQUEST['ids'] !="") {
99
	if (is_array($config['installedpackages'][$pkg['name']]) && $pkg['name'] != "" && $_POST['ids'] !="") {
100 100
		// get current values
101 101
		$current_values=config_get_path("installedpackages/{$pkg['name']}/config");
102 102
		// get updated ids
103
		parse_str($_REQUEST['ids'], $update_list);
103
		parse_str($_POST['ids'], $update_list);
104 104
		// sort ids to know what to change
105 105
		// useful to do not lose data when using sorting and paging
106 106
		$sort_list=$update_list['ids'];
......
271 271
	var strloading="<?=gettext('Saving changes...')?>";
272 272
	if (confirm("<?=gettext("Confirmation Required to save changes.")?>")) {
273 273
		$.ajax({
274
			type: 'get',
274
			type: 'post',
275 275
			cache: false,
276 276
			url: "<?=$_SERVER['SCRIPT_NAME']?>",
277 277
			data: {xml:'<?=$xml?>', act:'update', ids: ids},
src/usr/local/www/services_captiveportal_vouchers.php
42 42

  
43 43
$cpzone = strtolower(htmlspecialchars($_REQUEST['zone']));
44 44

  
45
if ($_REQUEST['generatekey']) {
45
if ($_POST['generatekey']) {
46 46
	include_once("phpseclib/Math/BigInteger.php");
47 47
	include_once("phpseclib/Crypt/Hash.php");
48 48
	include_once("phpseclib/Crypt/RSA.php");
......
477 477
	var generateButton = $('<a class="btn btn-xs btn-warning"><i class="fa fa-refresh icon-embed-btn"></i><?=gettext("Generate new keys");?></a>');
478 478
	generateButton.on('click', function() {
479 479
		$.ajax({
480
			type: 'get',
481
			url: 'services_captiveportal_vouchers.php?generatekey=true',
480
			type: 'post',
481
			url: 'services_captiveportal_vouchers.php',
482
			data: {
483
				generatekey:           true,
484
			},
482 485
			dataType: 'json',
483 486
			success: function(data) {
484 487
				$('#publickey').val(data.public.replace(/\\n/g, '\n'));
src/usr/local/www/status_graph.php
294 294
	$.ajax(
295 295
		'/bandwidth_by_ip.php',
296 296
		{
297
			type: 'get',
297
			type: 'post',
298 298
			data: $(document.forms[0]).serialize(),
299 299
			success: function (data) {
300 300
				var hosts_split = data.split("|");
src/usr/local/www/status_openvpn.php
38 38
require_once("service-utils.inc");
39 39

  
40 40
/* Handle AJAX */
41
if ($_REQUEST['action']) {
42
	if ($_REQUEST['action'] == "kill") {
43
		$port  = $_REQUEST['port'];
44
		$remipp  = $_REQUEST['remipp'];
45
		$client_id  = $_REQUEST['client_id'];
41
if ($_POST['action']) {
42
	if ($_POST['action'] == "kill") {
43
		$port  = $_POST['port'];
44
		$remipp  = $_POST['remipp'];
45
		$client_id  = $_POST['client_id'];
46 46
		if (!empty($port) and !empty($remipp)) {
47 47
			$retval = openvpn_kill_client($port, $remipp, $client_id);
48 48
			echo htmlentities("|{$port}|{$remipp}|{$retval}|");
......
83 83
		$('img[name="i:' + mport + ":" + remipp + '"]').each(busy);
84 84

  
85 85
		$.ajax(
86
			"<?=$_SERVER['SCRIPT_NAME'];?>" +
87
				"?action=kill&port=" + mport + "&remipp=" + remipp + "&client_id=" + client_id,
88
			{ type: "get", complete: killComplete }
86
			"<?=$_SERVER['SCRIPT_NAME'];?>",
87
			{
88
				type: "post",
89
				data: {
90
					action:           "kill",
91
					port:		  mport,
92
					remipp:		  remipp,
93
					client_id:	  client_id
94
				},
95
				complete: killComplete
96
			}
89 97
		);
90 98
	}
91 99

  
src/usr/local/www/vpn_ipsec_phase1.php
40 40
require_once("vpn.inc");
41 41
require_once("filter.inc");
42 42

  
43
if ($_REQUEST['generatekey']) {
43
if ($_POST['generatekey']) {
44 44
	$keyoutput = "";
45 45
	$keystatus = "";
46 46
	exec("/bin/dd status=none if=/dev/random bs=4096 count=1 | /usr/bin/openssl sha224 | /usr/bin/cut -f2 -d' '", $keyoutput, $keystatus);
......
1485 1485
	var generateButton = $('<a class="btn btn-xs btn-warning"><i class="fa fa-refresh icon-embed-btn"></i><?=gettext("Generate new Pre-Shared Key");?></a>');
1486 1486
	generateButton.on('click', function() {
1487 1487
		$.ajax({
1488
			type: 'get',
1489
			url: 'vpn_ipsec_phase1.php?generatekey=true',
1488
			type: 'post',
1489
			url: 'vpn_ipsec_phase1.php',
1490
			data: {
1491
				generatekey:           true,
1492
			},
1490 1493
			dataType: 'json',
1491 1494
			success: function(data) {
1492 1495
				$('#pskey').val(data.pskey.replace(/\\n/g, '\n'));
src/usr/local/www/widgets/widgets/gmirror_status.widget.php
38 38
//<![CDATA[
39 39
function gmirrorStatusUpdateFromServer() {
40 40
	$.ajax({
41
		type: 'get',
41
		type: 'post',
42 42
		url: '/widgets/widgets/gmirror_status.widget.php',
43
		// Need to send some dummy value or else the CSRF token will not be sent either.
44
		data: { dummyvalue: true },
43 45
		dataType: 'html',
44 46
		dataFilter: function(raw){
45 47
			// We reload the entire widget, strip this block of javascript from it
src/usr/local/www/widgets/widgets/openvpn.widget.php
283 283
}
284 284

  
285 285
/* Handle AJAX */
286
if ($_GET['action']) {
287
	if ($_GET['action'] == "kill") {
288
		$port = $_GET['port'];
289
		$remipp = $_GET['remipp'];
290
		$client_id  = $_GET['client_id'];
286
if ($_POST['action']) {
287
	if ($_POST['action'] == "kill") {
288
		$port = $_POST['port'];
289
		$remipp = $_POST['remipp'];
290
		$client_id  = $_POST['client_id'];
291 291
		if (!empty($port) and !empty($remipp)) {
292 292
			$retval = openvpn_kill_client($port, $remipp, $client_id);
293 293
			echo htmlentities("|{$port}|{$remipp}|{$retval}|");
......
409 409
	function killClient(mport, remipp, client_id) {
410 410

  
411 411
		$.ajax(
412
			"widgets/widgets/openvpn.widget.php" +
413
				"?action=kill&port=" + mport + "&remipp=" + remipp + "&client_id=" + client_id,
414
			{ type: "get", complete: killComplete }
412
			"widgets/widgets/openvpn.widget.php",
413
			{
414
				type: "post",
415
				data: {
416
					action:           "kill",
417
					port:             mport,
418
					remipp:           remipp,
419
					client_id:        client_id
420
				},
421
				complete: killComplete
422
			}
415 423
		);
416 424
	}
417 425

  
(2-2/2)