{$lgsl_config['text']['asd']}
";
return;
}
//-----------------------------------------------------------------------------------------------------------+
$lgsl_type_list = lgsl_type_list();
unset($lgsl_type_list['test']);
asort($lgsl_type_list);
$type = empty($_POST['form_type']) ? "source" : trim($_POST['form_type']);
$ip = empty($_POST['form_ip']) ? "" : trim($_POST['form_ip']);
$c_port = empty($_POST['form_c_port']) ? 0 : intval(trim($_POST['form_c_port']));
$q_port = empty($_POST['form_q_port']) ? 0 : intval(trim($_POST['form_q_port']));
$s_port = 0;
if (preg_match("/(\[[0-9a-z\:]+\])/iU", $ip, $match)) { $ip = $match[1]; }
elseif (preg_match("/([0-9a-z\.\-]+)/i", $ip, $match)) { $ip = $match[1]; }
else { $ip = ""; }
if ($c_port > 99999 || $q_port < 1024) { $c_port = 0; }
if ($q_port > 99999 || $q_port < 1024) { $q_port = 0; }
list($c_port, $q_port, $s_port) = lgsl_port_conversion($type, $c_port, $q_port, $s_port);
//-----------------------------------------------------------------------------------------------------------+
$output .= "
";
//-----------------------------------------------------------------------------------------------------------+
if (empty($_POST['lgsl_submit_test']) && empty($_POST['lgsl_submit_add'])) { return; }
if (!isset($lgsl_type_list[$type]) || !$ip || !$c_port || !$q_port) { return; }
//-----------------------------------------------------------------------------------------------------------+
global $lgsl_database;
lgsl_database();
$ip = mysqli_real_escape_string($lgsl_database, $ip);
$q_port = mysqli_real_escape_string($lgsl_database, $q_port);
$c_port = mysqli_real_escape_string($lgsl_database, $c_port);
$s_port = mysqli_real_escape_string($lgsl_database, $s_port);
$type = mysqli_real_escape_string($lgsl_database, $type);
//-----------------------------------------------------------------------------------------------------------+
$ip_check = gethostbyname($ip);
$mysql_result = mysqli_query($lgsl_database, "SELECT `ip`,`disabled` FROM `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` WHERE `type`='{$type}' AND `q_port`='{$q_port}'");
while ($mysql_row = mysqli_fetch_array($mysql_result, MYSQL_ASSOC))
{
if ($ip_check == gethostbyname($mysql_row['ip']))
{
$output .= "
";
if ($mysql_row['disabled'])
{
$output .= $lgsl_config['text']['aaa'];
}
else
{
$output .= $lgsl_config['text']['aan'];
}
$output .="
";
return;
}
}
//-----------------------------------------------------------------------------------------------------------+
$server = lgsl_query_live($type, $ip, $c_port, $q_port, $s_port, "s");
$server = lgsl_server_html($server);
if (!$server['b']['status'])
{
$output .= "
{$lgsl_config['text']['anr']}
";
return;
}
//-----------------------------------------------------------------------------------------------------------+
if (!empty($_POST['lgsl_submit_add']))
{
$disabled = ($lgsl_config['public_add'] == "2") ? "0" : "1";
$mysql_query = "INSERT INTO `{$lgsl_config['db']['prefix']}{$lgsl_config['db']['table']}` (`type`,`ip`,`c_port`,`q_port`,`s_port`,`disabled`,`cache`,`cache_time`) VALUES ('{$type}','{$ip}','{$c_port}','{$q_port}','{$s_port}','{$disabled}','','')";
$mysql_result = mysqli_query($lgsl_database, $mysql_query) or die(mysqli_error($lgsl_database));
$output .= "
";
if ($disabled)
{
$output .= $lgsl_config['text']['ada'];
}
else
{
$output .= $lgsl_config['text']['adn'];
}
$output .="
";
return;
}
//-----------------------------------------------------------------------------------------------------------+
$output .= "
";
//------------------------------------------------------------------------------------------------------------+