include "./db_conn.php";
include "./include/jsonRPCClient.php";
/*
$rpcService = new jsonRPCClient("$PACKETMON_HTTP_URL/JSON-RPC");
$param = array();
$arr = $rpcService->__call("shield.server.view",$param);
$resultArr = $arr['list'];
*/
$flag = $_GET["flag"] ;
$dno = $_GET["dno"] ;
$use_data = $_POST["use_data"] ;
$code = $_POST["code"] ;
$domain = $_POST["domain"] ;
$ssn = $_POST["ssn"] ;
$brn = $_POST["brn"] ;
$hpn = $_POST["hpn"] ;
$acn = $_POST["acn"] ;
$cdn = $_POST["cdn"] ;
$email = $_POST["email"] ;
$mailto = $_POST["mailto"] ;
$sid = $_POST["sid"] ;
$xwd = $_POST["xwd"] ;
$pwd = $_POST["pwd"] ;
$yuri = $_POST["yuri"] ;
$filter_str = $_POST["filter_str"] ;
$site_alerm = $_POST["site_alerm"] ;
$push_email = $_POST["push_email"] ;
$push_sms = $_POST["push_sms"] ;
$noti_msg = $_POST["noti_msg"] ;
$code_dno = $_POST["code_dno"] ;
$regdate = $_POST["regdate"] ;
function moveOneUp($current_policy_order, $id, $connect)
{
// 0. 최상위 레벨 return
if ($current_policy_order == 1) return;
// 1. 바꿀 order 를 구한다.
$changed_order = $current_policy_order - 1;
// 2. 이전 id 를 구한다.
$before_id_sql = " select id from MAIL_POLICY where policy_order = '$changed_order' " ;
$id_result = mysql_query($before_id_sql, $connect) or die (mysql_error());
if ($data = mysql_fetch_array($id_result)) {
$before_id = $data[0]; //total_count
}
// 3. 한단계 내린다.
$sql = " update MAIL_POLICY set
policy_order = '$current_policy_order'
where id = '$before_id'
" ;
$result = @mysql_query($sql, $connect) or die(mysql_error());
// 4. 현재를 한단계 올린다.
$sql = " update MAIL_POLICY set
policy_order = '$changed_order'
where id = '$id'
" ;
$result = @mysql_query($sql, $connect) or die(mysql_error());
}
function moveOneDown($current_policy_order, $id, $connect)
{
$last_order_sql = " select policy_order from MAIL_POLICY order by policy_order desc limit 1 " ;
$order_result = mysql_query($last_order_sql, $connect) or die (mysql_error());
if ($data=mysql_fetch_array($order_result)) {
$last_order = $data[0]; //total_count
}
// 0. 현재가 마지막 레벨 이면 return
if ($current_policy_order == $last_order) return;
// 1. 바꿀 order 를 구한다.
$changed_order = $current_policy_order + 1;
// 2. 이전 id 를 구한다.
$after_id_sql = " select id from MAIL_POLICY where policy_order = '$changed_order' " ;
$id_result = mysql_query($after_id_sql, $connect) or die (mysql_error());
if ($data = mysql_fetch_array($id_result)) {
$after_id = $data[0]; //total_count
}
// 3. 한단계 올린다.
$sql = " update MAIL_POLICY set
policy_order = '$current_policy_order'
where id = '$after_id'
" ;
$result = @mysql_query($sql, $connect) or die(mysql_error());
// 4. 현재를 한단계 내린다.
$sql = " update MAIL_POLICY set
policy_order = '$changed_order'
where id = '$id'
" ;
$result = @mysql_query($sql, $connect) or die(mysql_error());
}
function moveLastDown($current_policy_order, $id, $connect)
{
$last_order_sql = " select policy_order from MAIL_POLICY order by policy_order desc limit 1 " ;
$order_result = mysql_query($last_order_sql, $connect) or die (mysql_error());
if ($data=mysql_fetch_array($order_result)) {
$last_order = $data[0]; //total_count
}
// 0. 현재가 마지막 레벨 이면 return
if ($current_policy_order == $last_order) return;
// 1. 현재 이후 order 를 하나씩 줄인다.
$sql = " update MAIL_POLICY set
policy_order = policy_order - 1
where policy_order > '$current_policy_order'
" ;
$result = @mysql_query($sql, $connect) or die(mysql_error());
// 2. 현재를 마지막으로 내린다.
$sql = " update MAIL_POLICY set
policy_order = '$last_order'
where id = '$id'
" ;
$result = @mysql_query($sql, $connect) or die(mysql_error());
}
function moveTopUp($current_policy_order, $id, $connect)
{
$last_order_sql = " select policy_order from MAIL_POLICY order by policy_order desc limit 1 " ;
$order_result = mysql_query($last_order_sql, $connect) or die (mysql_error());
if ($data=mysql_fetch_array($order_result)) {
$last_order = $data[0]; //total_count
}
// 0. 현재가 최상 레벨 이면 return
if ($current_policy_order == "1") return;
// 1. 현재 이전 order 를 하나씩 올린다.
$sql = " update MAIL_POLICY set
policy_order = policy_order + 1
where policy_order < '$current_policy_order'
" ;
$result = @mysql_query($sql, $connect) or die(mysql_error());
// 2. 현재를 최상으로 올린다.
$sql = " update MAIL_POLICY set
policy_order = '1'
where id = '$id'
" ;
$result = @mysql_query($sql, $connect) or die(mysql_error());
}
if ($flag == "list" ) {
$startDate = $_GET["startDate"] ;
$endDate = $_GET["endDate"] ;
error_log ($startDate, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($endDate, 3, "/usr/local/imagefilter30/var/logs/php.log");
$from_sql =
" from check_setting cs where dno > 0 and code = '$code' ";
$count_sql = " select count(*) as cnt
$from_sql " ;
$sql = " select cs.*
$from_sql
order by code_dno asc " ;
$count_result=mysql_query($count_sql, $connect) or die (mysql_error());
if ($data=mysql_fetch_array($count_result)) {
$total_count = $data[0]; //total_count
} else {
$total_count=0;
}
// $result=mysql_query($sql, $connect) or die (mysql_error());
$result=mysql_query($sql, $connect);
//error_log("쿼리오류 발생: " . mysqli_error(), 3, "/usr/local/imagefilter30/var/logs/php.log");
?>
{"list":[
$count = 0;
while ($data = mysql_fetch_array($result)) {
if ( $count != 0 ) { echo(","); }
$dno = $data["dno"] ;
$use_data = $data["use_data"] ;
if ($use_data == "1") $use_data = "true"; else $use_data = "false";
$code = $data["code"] ;
$domain = $data["domain"] ;
$ssn = $data["ssn"] ;
if ($ssn == "1") $ssn = "true"; else $ssn = "false";
$brn = $data["brn"] ;
if ($brn == "1") $brn = "true"; else $brn = "false";
$hpn = $data["hpn"] ;
if ($hpn == "1") $hpn = "true"; else $hpn = "false";
$acn = $data["acn"] ;
if ($acn == "1") $acn = "true"; else $acn = "false";
$cdn = $data["cdn"] ;
if ($cdn == "1") $cdn = "true"; else $cdn = "false";
$email = $data["email"] ;
if ($email == "1") $email = "true"; else $email = "false";
$mailto = $dataT["mailto"] ;
if ($mailto == "1") $mailto = "true"; else $mailto = "false";
$sid = $data["sid"] ;
if ($sid == "1") $sid = "true"; else $sid = "false";
$xwd = $data["xwd"] ;
if ($xwd == "1") $xwd = "true"; else $xwd = "false";
$pwd = $data["pwd"] ;
if ($pwd == "1") $pwd = "true"; else $pwd = "false";
$yuri = $data["yuri"] ;
if ($yuri == "1") $yuri = "true"; else $yuri = "false";
$filter_str = $data["filter_str"] ;
$site_alerm = $data["site_alerm"] ;
if ($site_alerm == "1") $site_alerm = "true"; else $site_alerm = "false";
$push_email = $data["push_email"] ;
$push_sms = $data["push_sms"] ;
$noti_msg = $data["noti_msg"] ;
$code_dno = $data["code_dno"] ;
$regdate = $data["regdate"] ;
/*
error_log ($id, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($use_yn, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($name, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($user_include, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($user_exlude, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($mail_policy, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
*/
?>
{"dno":"","useData":"","code":"","domain":"","ssn":"","brn":"","hpn":"","acn":"","cdn":"","email":"","mailto":"","sid":"","xwd":"","pwd":"","yuri":"","filterStr":"","siteAlarm":"","pushEmail":"","pushSms":"","notiMsg":"$noti_msg","codeDno":"$code_dno","regdate":""}
$count++;
}
?>
]}
if($connect) mysql_close($connect);
exit;
}
if ($flag == "update_list" ) {
error_log ("dno=", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($dno, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
if ($dno == 0) exit;
$from_sql =
" from MAIL_POLICY mp where id = " . $dno . " ";
$sql = " select mp.* ,
( select item from MAIL_POLICY_CONDITION where condition_type ='user_include' and policy_id = mp.id limit 0 , 1) as user_include,
( select item from MAIL_POLICY_CONDITION where condition_type ='user_exclude' and policy_id = mp.id limit 0 , 1) as user_exclude,
( select item from MAIL_POLICY_CONDITION where condition_type ='doc_size' and policy_id = mp.id limit 0 , 1) as doc_size,
( select item from MAIL_POLICY_CONDITION where condition_type ='ext_mode' and policy_id = mp.id limit 0 , 1) as ext_mode,
( select item from MAIL_POLICY_CONDITION where condition_type ='image_check' and policy_id = mp.id limit 0 , 1) as image_check,
( select item from MAIL_POLICY_CONDITION where condition_type ='select_keyword' and policy_id = mp.id limit 0 , 1) as select_keyword,
( select item from MAIL_POLICY_CONDITION where condition_type ='content_type' and policy_id = mp.id limit 0 , 1) as content_type,
( select item from MAIL_POLICY_CONDITION where search_type ='scnt' and policy_id = mp.id limit 0 , 1) as scnt,
( select item from MAIL_POLICY_CONDITION where search_type ='lcnt' and policy_id = mp.id limit 0 , 1) as lcnt,
( select item from MAIL_POLICY_CONDITION where search_type ='acnt' and policy_id = mp.id limit 0 , 1) as acnt,
( select item from MAIL_POLICY_CONDITION where search_type ='bcnt' and policy_id = mp.id limit 0 , 1) as bcnt,
( select item from MAIL_POLICY_CONDITION where search_type ='pcnt' and policy_id = mp.id limit 0 , 1) as pcnt,
( select item from MAIL_POLICY_CONDITION where search_type ='icnt' and policy_id = mp.id limit 0 , 1) as icnt,
( select item from MAIL_POLICY_CONDITION where search_type ='ecnt' and policy_id = mp.id limit 0 , 1) as ecnt,
( select item from MAIL_POLICY_CONDITION where search_type ='hcnt' and policy_id = mp.id limit 0 , 1) as hcnt,
( select item from MAIL_POLICY_CONDITION where search_type ='ucnt' and policy_id = mp.id limit 0 , 1) as ucnt,
( select item from MAIL_POLICY_CONDITION where condition_type ='mail_policy' and policy_id = mp.id limit 0 , 1) as mail_policy
$from_sql
order by policy_order asc " ;
// $result=mysql_query($sql, $connect) or die (mysql_error());
$result=mysql_query($sql, $connect);
?>
{"list":[
$count = 0;
while ($data = mysql_fetch_array($result)) {
if ( $count != 0 ) { echo(","); }
$id = $data['id'];
$use_yn = $data['use_yn'];
$name = $data['name'];
$reg_date = $data['regdate'];
$user_include = $data['user_include'];
$user_exclude = $data['user_exclude'];
if ($user_exclude == NULL) $user_exclude = "";
$doc_size = $data['doc_size'];
$ext_mode = $data['ext_mode'];
$image_check = $data['image_check'];
$select_keyword = $data['select_keyword'];
$content_type = $data['content_type'];
$scnt = $data['scnt'];
if ($scnt == NULL) $scnt = "0";
$lcnt = $data['lcnt'];
if ($lcnt == NULL) $lcnt = "0";
$acnt = $data['acnt'];
if ($acnt == NULL) $acnt = "0";
$bcnt = $data['bcnt'];
if ($bcnt == NULL) $bcnt = "0";
$pcnt = $data['pcnt'];
if ($pcnt == NULL) $pcnt = "0";
$icnt = $data['icnt'];
if ($icnt == NULL) $icnt = "0";
$ecnt = $data['ecnt'];
if ($ecnt == NULL) $ecnt = "0";
$hcnt = $data['hcnt'];
if ($hcnt == NULL) $hcnt = "0";
$ucnt = $data['ucnt'];
if ($ucnt == NULL) $ucnt = "0";
$mail_policy = $data['mail_policy'];
/*
error_log ($id, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($use_yn, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($name, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($user_include, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($user_exlude, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($mail_policy, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
*/
?>
{"dno":"","useData":"","policyName":"","userInclude":"","userExclude":"","docSize":"","ext_mode":"","image_check":"","select_keyword":"","content_type":"","scnt":"","lcnt":"","acnt":"","bcnt":"","pcnt":"","icnt":"","ecnt":"","hcnt":"","ucnt":"","mail_policy":""}
$count++;
}
?>
]}
if($connect) mysql_close($connect);
exit;
}
if ($flag == "delete" ) {
$delete_sql = "DELETE MAIL_POLICY, MAIL_POLICY_CONDITION FROM MAIL_POLICY LEFT JOIN MAIL_POLICY_CONDITION ON MAIL_POLICY.id = MAIL_POLICY_CONDITION.policy_id WHERE MAIL_POLICY.id = '$dno'" ;
error_log ($delete_sql, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
@mysql_query($delete_sql, $connect) or die(mysql_error());
if($connect) mysql_close($connect);
exit;
}
if ($flag == "move" ) {
$method = $_GET["method"] ;
error_log ("move_dno=", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($dno, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("method=", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($method, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
$current_order_sql = " select policy_order from MAIL_POLICY where id = '$dno' " ;
$order_result=mysql_query($current_order_sql, $connect) or die (mysql_error());
if ($data=mysql_fetch_array($order_result)) {
$current_order = $data[0]; //total_count
}
if ($method == "oneUp")
{
moveOneUp($current_order, $dno, $connect);
}
else if ($method == "oneDown")
{
moveOneDown($current_order, $dno, $connect);
}
else if ($method == "lastDown")
{
moveLastDown($current_order, $dno, $connect);
}
else if ($method == "topUp")
{
moveTopUp($current_order, $dno, $connect);
}
if($connect) mysql_close($connect);
exit;
}
if ($flag == "insert") {
$date = date('Y-m-d h:i:s', time());
$count_sql = " select count(*) as cnt from MAIL_POLICY " ;
$count_result=mysql_query($count_sql, $connect) or die (mysql_error());
if ($data=mysql_fetch_array($count_result)) {
$total_count = $data[0]; //total_count
} else {
$total_count=0;
}
if ($total_count == 0)
{
$policy_order = 1;
} else
{
$last_order_sql = " select policy_order from MAIL_POLICY order by policy_order desc limit 1 " ;
$order_result=mysql_query($last_order_sql, $connect) or die (mysql_error());
if ($data=mysql_fetch_array($order_result)) {
$order_count = $data[0]; //total_count
}
$policy_order = $order_count + 1;
}
error_log ("policy_order=", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ($policy_order, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
$sql = " insert into MAIL_POLICY (
policy_order
,policy_type
,name
,use_yn
,regdate
) value (
'$policy_order'
, '$policy_type'
, '$policy_title'
,'$use_yn'
,'$date'
) " ;
$result = @mysql_query($sql, $connect) or die(mysql_error());
} else if ($flag == "update") {
$sql = " update MAIL_POLICY set
name = '$policy_title' ,
policy_type = '$policy_type' ,
use_yn = '$use_yn'
where id = $dno
" ;
$result = @mysql_query($sql, $connect) or die(mysql_error());
$chkDelete = " DELETE from MAIL_POLICY_CONDITION \n";
$chkDelete .= " WHERE policy_id = $dno ";
@mysql_query($chkDelete, $connect) or die(mysql_error());
}
if ( $result ) {
if ($flag == "insert") {
$policy_id = mysql_insert_id();
} else if ($flag == "update") {
$policy_id = $dno ;
}
// include_all_user, include_selected_user, include_mail_user
if( $all_user != "" ) {
if ($all_user == "include_all_user")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'user_include','include_all_user','all')" , $connect) or die(mysql_error());
} else if ($all_user == "include_selected_user")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'user_include','include_selected_user','$doccontents_inc')" , $connect) or die(mysql_error());
} else if ($all_user == "include_mail_user")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'user_include','include_mail_user','$doccontents_inc')" , $connect) or die(mysql_error());
}
}
// exception_all_user, exception_selected_user, exception_mail_user
if( $select_user != "" ) {
if ($select_user == "exception_all_user")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'user_exclude','exception_all_user','all')" , $connect) or die(mysql_error());
} else if ($select_user == "exception_selected_user")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'user_exclude','exception_selected_user','$doccontents_ex')" , $connect) or die(mysql_error());
} else if ($select_user == "exception_mail_user")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'user_exclude','exception_mail_user','$doccontents_ex')" , $connect) or die(mysql_error());
}
}
if( $doc_size != "" ) {
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'doc_size','','$doc_size')" , $connect) or die(mysql_error());
}
// 0 (모두무시), 1(제외), 2(포함)
if( $ext_mode != "" ) {
if ($ext_mode == "0")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'ext_mode','0','0')" , $connect) or die(mysql_error());
} else if ($ext_mode == "1")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'ext_mode','1','1')" , $connect) or die(mysql_error());
} else if ($ext_mode == "2")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'ext_mode','2','2')" , $connect) or die(mysql_error());
}
}
// 0 (본문 및 첨부), 1(본문), 2(첨부), 3(제목)
if( $content_type != "" ) {
if ($content_type == "0")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'content_type','0','0')" , $connect) or die(mysql_error());
} else if ($content_type == "1")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'content_type','1','1')" , $connect) or die(mysql_error());
} else if ($content_type == "2")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'content_type','2','2')" , $connect) or die(mysql_error());
} else if ($content_type == "3")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'content_type','3','3')" , $connect) or die(mysql_error());
}
}
// 0 (적용안함), 1(적용)
if( $image_check != "" ) {
if ($image_check == "0")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'image_check','0','0')" , $connect) or die(mysql_error());
} else if ($select_keyword == "1")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'image_check','1','1')" , $connect) or die(mysql_error());
}
}
// 0 (적용안함), 1(적용)
if( $select_keyword != "" ) {
if ($select_keyword == "0")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'select_keyword','0','0')" , $connect) or die(mysql_error());
} else if ($select_keyword == "1")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'select_keyword','1','$doccontents_keyword')" , $connect) or die(mysql_error());
}
}
if( $checkbox_value != "" ) {
$strTok = explode('|' , $checkbox_value);
$cnt = count($strTok);
for($i = 0 ; $i < $cnt ; $i++){
if ($strTok[$i] == "scnt")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'detect_type','scnt','$scnt')" , $connect) or die(mysql_error());
}
if ($strTok[$i] == "lcnt")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'detect_type','lcnt','$lcnt')" , $connect) or die(mysql_error());
}
if ($strTok[$i] == "acnt")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'detect_type','acnt','$acnt')" , $connect) or die(mysql_error());
}
if ($strTok[$i] == "bcnt")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'detect_type','bcnt','$bcnt')" , $connect) or die(mysql_error());
}
if ($strTok[$i] == "pcnt")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'detect_type','pcnt','$pcnt')" , $connect) or die(mysql_error());
}
if ($strTok[$i] == "icnt")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'detect_type','icnt','$icnt')" , $connect) or die(mysql_error());
}
if ($strTok[$i] == "ecnt")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'detect_type','ecnt','$ecnt')" , $connect) or die(mysql_error());
}
if ($strTok[$i] == "hcnt")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'detect_type','hcnt','$hcnt')" , $connect) or die(mysql_error());
}
if ($strTok[$i] == "ucnt")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'detect_type','ucnt','$ucnt')" , $connect) or die(mysql_error());
}
}
}
// sing, pass
if( $mail_policy != "" ) {
if ($mail_policy == "sign")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'mail_policy','','sign')" , $connect) or die(mysql_error());
} else if ($mail_policy == "pass")
{
@mysql_query(" insert into MAIL_POLICY_CONDITION ( policy_id, condition_type, search_type, item ) values ( $policy_id,'select_keyword','','pass')" , $connect) or die(mysql_error());
}
}
}
/*
error_log ("policy_title=" . $policy_title, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("all_user=" . $all_user, 3, "/usr/local/imagefilter30/var/logs/php.log");
// include_all_user, include_selected_user, include_mail_user
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("doccontents_inc=" . $doccontents_inc, 3, "/usr/local/imagefilter30/var/logs/php.log");
// 4,개발 1팀,null,이사||
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("select_user=" . $select_user, 3, "/usr/local/imagefilter30/var/logs/php.log");
// exception_all_user, exception_selected_user, exception_mail_user
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("doccontents_ex=" . $doccontents_ex, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("bit_type=" . $bit_type, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("doc_size=" . $doc_size, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
// 0 (모두무시), 1(제외), 2(포함)
error_log ("ext_mode=" . $ext_mode, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("doccontents_ext_mode=" . $doccontents_ext_mode, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
// 0 (적용안함), 1(적용)
error_log ("image_check=" . $image_check, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
// 0 (적용안함), 1(적용)
error_log ("select_keyword=" . $select_keyword, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("doccontents_keyword=" . $doccontents_keyword, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("content_type=" . $content_type, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("###################", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("checkbox_value=" . $checkbox_value, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("###################", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("scnt=" . $scnt, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("lcnt=" . $lcnt, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("acnt=" . $acnt, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("bcnt=" . $bcnt, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("pcnt=" . $pcnt, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("icnt=" . $icnt, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("ecnt=" . $ecnt, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("hcnt=" . $hcnt, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("ucnt=" . $ucnt, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("mail_policy=" . $mail_policy, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("use_yn=" . $use_yn, 3, "/usr/local/imagefilter30/var/logs/php.log");
error_log ("\n", 3, "/usr/local/imagefilter30/var/logs/php.log");
*/
/*
echo '';
echo '';
*/
if($connect) mysql_close($connect);
?>