<?php
/*
Simple:Press Forum Admin
Ahah form loader - Config
$LastChangedDate: 2009-11-08 14:27:41 -0700 (Sun, 08 Nov 2009) $
$Rev: 2939 $
*/

if (preg_match('#' . basename(__FILE__) . '#', $_SERVER['PHP_SELF']))
{
	die('Access Denied');
}

sfa_admin_ahah_support();

global $SFSTATUS;
if($SFSTATUS != 'ok')
{
	echo($SFSTATUS);
	die();
}

include_once (SF_PLUGIN_DIR.'/admin/panel-profiles/sfa-profiles-display.php');
include_once (SF_PLUGIN_DIR.'/admin/panel-profiles/support/sfa-profiles-prepare.php');
include_once (SF_PLUGIN_DIR.'/admin/panel-profiles/support/sfa-profiles-save.php');
include_once (SF_PLUGIN_DIR.'/admin/library/sfa-tab-support.php');

global $sfglobals;

global $adminhelpfile;
$adminhelpfile = 'admin-profiles';
# --------------------------------------------------------------------

# ----------------------------------
# Check Whether User Can Manage Profiles
if (!sfc_current_user_can('SPF Manage Profiles'))
{
	echo (__('Access Denied', "sforum"));
	die();
}

if(isset($_GET['loadform']))
{
	sfa_render_profiles_container($_GET['loadform']);
	die();
}

if(isset($_GET['saveform']))
{
	if($_GET['saveform'] == 'options')
	{
		echo sfa_save_options_data();
		die();
	}

	if($_GET['saveform'] == 'data')
	{
		echo sfa_save_data_data();
		die();
	}

	if($_GET['saveform'] == 'fields')
	{
		echo sfa_save_fields_data();
		die();
	}
	if($_GET['saveform'] == 'avatars')
	{
		echo sfa_save_avatars_data();
		die();
	}
}

die();

?>