<?php
/**
 * MachForm
 * 
 * © 2007–2025 Appnitro Software. All rights reserved.
 * 
 * This source code is proprietary and may not be copied, modified,
 * or distributed in any form without express written permission from Appnitro Software.
 * 
 * License information: https://www.machform.com/license-agreement/
 */
	$is_ajax = true;

	require('config.php');
	require('lib/db-session-handler.php');
	require('includes/init.php');
	require('includes/db-core.php');
	require('includes/helper-functions.php');
	require('includes/filter-functions.php');
	require('includes/check-session.php');
	require('includes/users-functions.php');
	
	$dbh = mf_connect_db();
	
	$_POST = json_decode(file_get_contents('php://input'), true);
	
	$pin_folder	= (int) $_POST['pin_folder'];

	$params = array($pin_folder,$_SESSION['mf_user_id']);
	$query = "UPDATE `".MF_TABLE_PREFIX."users` SET folders_pinned=? WHERE user_id=?";
			
	mf_do_query($query,$params,$dbh);
			
	$response_data = new stdClass();
	
	$response_data->status    	= "ok";
	$response_json = json_encode($response_data);
	
	echo $response_json;
	
?>