<?php 
/**
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: union.inc.php 2 2011-05-27 02:59:23Z along $
#
#	Copyright (C) 2008-2011 PHPDisk Team. All Rights Reserved.
#
*/

if(!defined('IN_PHPDISK') || !defined('IN_ADMINCP')) {
	exit('[PHPDisk] Access Denied');
}
lang('admin/union');

switch($action){
	
	default:
		
		if($task =='update'){
			if($p_formhash != formhash()){
				exit($L['system_error']);
			}
			$setting = array(
				'open_thunder' => 0,
				'thunder_pid' => '',
				'open_flashget' => 0,
				'flashget_uid' => '',
			);	
			$online_demo = $settings['online_demo'];
			$settings = gpc('setting','P',$setting);
				
			if($online_demo){
				$error = true;
				$sysmsg[] = $L['online_demo_deny'];
			}
			if(!$error){
				
				settings_cache($settings);
				
				$sysmsg[] = $L['union_update_success'];
				redirect(urr("admincp","item=$item"),$sysmsg);
				
			}else{
				redirect('back',$sysmsg);
			}
		
		}else{
			$setting['thunder_pid'] = $settings['thunder_pid'];
			$setting['open_thunder'] = $settings['open_thunder'] ? 1 : 0;
			$setting['flashget_uid'] = $settings['flashget_uid'];
			$setting['open_flashget'] = $settings['open_flashget'] ? 1 : 0;
			require_once template_echo($item,$admin_tpl_dir,'',1);
		}
}
?>