<?php
// DeleteMember.php
include_once('core/base/Action.php');

/**
 * Deletes a member.
 *
 * @author Matthew Lindberg
 */
class DeleteMember extends Action
{
	
	/**
	 * Sets view to the edit member form.
	 *
	 * @access public
	 * @return boolean
	 */
	function execute(& $context)
	{
		global $__CS; 
		$__CS->EnterMethod("execute:DeleteMember");
		
		$request	=& $context->getEntry(__REQUEST);
		$model		=& $context->getEntry(__MODEL);
		$controller =& $context->getEntry(__CONTROLLER);
		
		$member_id = $request->get("id");
		
	
		
		if( !$model->deleteMember($member_id)) {
			die("Problem deleting member in DeleteMember action");
		}
		
		$request->addFeedback("successfully deleted member");
		
		$request->set(__ACTION,__MEMBER_SEARCH);
		
		$controller->processRequest(& $request);
		
		$__CS->ExitMethod("execute:DeleteMember");
		return false;
	}
	
}
?>