<?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 = $_REQUEST['user_name'];
	$table = $_REQUEST['table'];
	$no_prefix = $_REQUEST['no_prefix'];
	
	if (!isset($table) || ($table == "-not selected-") || ($table == ""))
	{
		echo MANAGE_USERS_NO_TABLE_TO_DELETE_USER_FROM_ERR . " " . CLICK_WORD . " <a href=\"manage_page_access.php\" title=\"" . HERE_WORD . "\">" . HERE_WORD . "</a> " . MANAGE_USERS_NO_TABLE_TO_ADD_USER_TO_2_ERR;
		exit;
	}
	
	if (isset($no_prefix) && ($no_prefix == 1))
		$prefix = "";
	else
		$prefix = BWB_TABLE_PREFIX;
	
	// Go ahead and delete page record from table.
	$query = "DELETE FROM " . $prefix . $table . " WHERE UserID = '$user_name'";
		
	$cnt = $bwb_dbh->exec($query);
	
	echo $user_name;	
?>
