<?php
////////////////////////////////////////////////////////////////////////
// Breeze Website Builder
// Copyright Silver Dolphin Solutions, LLC, Edward Lemmers, P.E.
// For licensing, see license.txt.
// Revised: 2/8/2012	ELL
// Added table prefix handling.
// Revised: 7/2/2012	ELL
// Adapted for website user page restrictions as well.
//
	include ("check_session.php");

	$user_name = $_GET['user_name'];
	$table = $_GET['table'];
	
	if ($table == "-not selected-")
	{
		echo "You must select a table first to delete a user from.  Click <a href=\"manage_page_access.php\" title=\"here\">here</a> to select a table and try again.";
		exit;
	}

	
	// Go ahead and delete page record from table.
	if ((!$table) || ($table == ""))
		$query = "DELETE FROM " . BWB_TABLE_PREFIX . "users WHERE UserID = '$user_name'";
	else
		$query = "DELETE FROM " . $table . " WHERE UserID = '$user_name'";
		
	$cnt = $bwb_dbh->exec($query);
	
	if ((!$table) || ($table == ""))
		header("Location: users.php");
	else
		header("Location: manage_page_access.php");
	
?>
