<?php
////////////////////////////////////////////////////////////////////////
// Restrict Page Access //
// Breeze Website Builder
// Copyright EB Dynamics, Inc., Edward Lemmers, P.E.
// For licensing, see license.txt.
// Created: 4/9/2010
// Revised: 2/10/2012	ELL
// Added table prefix handling.
	
	include ("check_session.php");

	
	$query = "SELECT page_name FROM " . BWB_TABLE_PREFIX . "page_data";
	$result = mysql_query($query, $bwb_link);
	while($row = mysql_fetch_array($result))
	{
		$page_name = $row["page_name"];
		if (isset($_POST[$page_name]))
			$restricted = 1;
		else
			$restricted = 0;
			
		$query2 = "UPDATE " . BWB_TABLE_PREFIX . "page_data SET restricted = $restricted WHERE page_name = '$page_name'";
		$result2 = mysql_query($query2, $bwb_link);
	}
	
	header("Location: restrict_editing_access.php");
?>