<?php
require("session_check.php");
require("../api/base_support.php");
	$is_check=check_rights("c33");
	if(!$is_check){
		echo 'no permission';
		exit;
	}
	//变量区
	$share_id=intval(get_argg('sid'));
	$type_value=short_check(get_argg('type_value'));

	$dbo = new dbex;
	dbtarget('w',$dbServs);

	//表定义区
	$t_share=$tablePreStr."share";

	$sql="update $t_share set is_pass=$type_value where s_id=$share_id";
	$dbo->exeUpdate($sql);
	
	//发送锁定通知
	if($type_value==0){
		$sql = "select s_title,user_name,user_id from $t_share where s_id=$share_id";
		$notice = $dbo->getRow($sql);
		preg_match("/<a href=\"[^\"]*\" target=\"_blank\">([^<]*)<\/a>/",$notice['s_title'],$take_data);
		$title = $take_data[1];
		$titles = "您的".$title."分享已被锁定";
		$scrip_content = $notice['user_name']."，您的分享".$title."因违反本站协议已被锁定，请您尽快修改，否则由管理员对您的信息进行修改和删除等操作所产生的一切后果，将由您自己承担。";
		$is_success = api_proxy('scrip_send',"系统发送",$titles,$scrip_content,$notice['user_id'],0);
		if($is_success){
			api_proxy("message_set",$notice['user_id'],"{num}个通知","modules.php?app=msg_notice",0,1,"remind");
		}
	}
?>