<?php 
/**
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: verycode.inc.php 25 2011-03-04 07:36:51Z along $
#
#	Copyright (C) 2008-2011 PHPDisk Team. All Rights Reserved.
#
*/

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

switch($action){
	
	default:
		
		if($task =='update'){
			if($p_formhash != formhash()){
				exit($L['system_error']);
			}
			$setting = array(
				'register_verycode' => 0,
				'login_verycode' => 0,
				'forget_verycode' => 0,
				'verycode_type' => 0,
			);
			$settings = gpc('setting','P',$setting);

			$settings['register_verycode'] = (int)$settings['register_verycode'];
			$settings['login_verycode'] = (int)$settings['login_verycode'];
			$settings['forget_verycode'] = (int)$settings['forget_verycode'];
			
			settings_cache($settings);
			
			$sysmsg[] = $L['verycode_update_success'];
			
			redirect($_SERVER['HTTP_REFERER'],$sysmsg);
		}else{	
			$settings['verycode_type'] = $settings['verycode_type'] ? (int)$settings['verycode_type'] : 1;
			$setting = $settings;
			require_once template_echo($item,$admin_tpl_dir,'',1);
		}
}
?>