<?php
include("../includes/common.php");
$act=isset($_GET['act'])?daddslashes($_GET['act']):null;
switch($act){
case 'user':
	$softcode_new=md5(daddslashes(strip_tags($_POST['admin_pass'])));
	if($a=='admin_pass')$value=md5(daddslashes($_POST['admin_pass']));
    saveSetting('admin_user',$_POST['admin_user']);
    saveSetting('admin_pass',$softcode_new);
	if(!$islogin==1) {
		exit('{"code":-1,"msg":"您不是管理员无权限使用本功能！"}');
	}
	$ad=$CACHE->clear();
	if($ad){
		exit('{"code":1,"msg":"修改成功！"}');
	}else{
		exit('{"code":-1,"msg":"修改失败！"}');
}
break;
	
case 'Set':
    saveSetting('title',$_POST['title']);
    saveSetting('kfqq',$_POST['kfqq']);
    saveSetting('ds_id',$_POST['ds_id']);
    saveSetting('ds_key',$_POST['ds_key']);
    saveSetting('ds_pass',$_POST['ds_pass']);
    saveSetting('jy_sxf',$_POST['jy_sxf']);
    saveSetting('qun',$_POST['qun']);
    saveSetting('url',$_POST['url']);
    saveSetting('foot',$_POST['foot']);
    saveSetting('money',$_POST['money']);
    saveSetting('yzf_url',$_POST['yzf_url']);
    saveSetting('yzf_id',$_POST['yzf_id']);
    saveSetting('yzf_key',$_POST['yzf_key']);
    saveSetting('jl',$_POST['jl']);
    saveSetting('on',$_POST['on']);
	if(!$islogin==1) {
		exit('{"code":-1,"msg":"您不是管理员无权限使用本功能！"}');
	}
	$ad=$CACHE->clear();
	if($ad){
		exit('{"code":1,"msg":"修改成功！"}');
	}else{
		exit('{"code":-1,"msg":"修改失败！"}');
}
break;
default:
	exit('{"code":-4,"msg":"参数错误"}');
break;
}
?>