function app_chk($arr_appRequest, $arr_appRow)
{
if ($arr_appRequest["alert"] != "ok") {
return $arr_appRow;
}
if ($arr_appRow["app_status"] != "enable") {
return array("alert" => "x050402");
}
$_str_ip = fn_getIp();
if ($arr_appRow["app_ip_allow"]) {
$_str_ipAllow = str_ireplace(PHP_EOL, "|", $arr_appRow["app_ip_allow"]);
if (!fn_regChk($_str_ip, $_str_ipAllow, true)) {
return array("alert" => "x050212");
}
} else {
if ($arr_appRow["app_ip_bad"]) {
$_str_ipBad = str_ireplace(PHP_EOL, "|", $arr_appRow["app_ip_bad"]);
if (fn_regChk($_str_ip, $_str_ipBad)) {
return array("alert" => "x050213");
}
}
}
if ($arr_appRow["app_key"] != $arr_appRequest["app_key"]) {
return array("alert" => "x050217");
}
return array("alert" => "ok");
}