当前位置: 首页>>代码示例>>PHP>>正文


PHP is_port函数代码示例

本文整理汇总了PHP中is_port函数的典型用法代码示例。如果您正苦于以下问题:PHP is_port函数的具体用法?PHP is_port怎么用?PHP is_port使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了is_port函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

     $_POST['srcendport'] = 0;
 }
 if (!$_POST['dstbeginport']) {
     $_POST['dstbeginport'] = 0;
     $_POST['dstendport'] = 0;
 }
 if ($_POST['srcbeginport'] && !alias_expand($_POST['srcbeginport']) && !is_port($_POST['srcbeginport'])) {
     $input_errors[] = "The start source port must be an alias or integer between 1 and 65535.";
 }
 if ($_POST['srcendport'] && !alias_expand($_POST['srcendport']) && !is_port($_POST['srcendport'])) {
     $input_errors[] = "The end source port must be an alias or integer between 1 and 65535.";
 }
 if ($_POST['dstbeginport'] && !alias_expand($_POST['dstbeginport']) && !is_port($_POST['dstbeginport'])) {
     $input_errors[] = "The start destination port must be an alias or integer between 1 and 65535.";
 }
 if ($_POST['dstendport'] && !alias_expand($_POST['dstbeginport']) && !is_port($_POST['dstendport'])) {
     $input_errors[] = "The end destination port must be an alias or integer between 1 and 65535.";
 }
 if (!is_specialnet($_POST['srctype'])) {
     if ($_POST['src'] && !is_ipaddroranyalias($_POST['src'])) {
         $input_errors[] = "A valid source IP address or alias must be specified.";
     }
     if ($_POST['srcmask'] && !is_numericint($_POST['srcmask'])) {
         $input_errors[] = "A valid source bit count must be specified.";
     }
 }
 if (!is_specialnet($_POST['dsttype'])) {
     if ($_POST['dst'] && !is_ipaddroranyalias($_POST['dst'])) {
         $input_errors[] = "A valid destination IP address or alias must be specified.";
     }
     if ($_POST['dstmask'] && !is_numericint($_POST['dstmask'])) {
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:firewall_shaper_edit.php

示例2: gettext

 }
 if ($_POST['max_procs']) {
     if (!is_numericint($_POST['max_procs']) || $_POST['max_procs'] < 1 || $_POST['max_procs'] > 500) {
         $input_errors[] = gettext("Max Processes must be a number 1 or greater");
     }
 }
 if ($_POST['althostnames']) {
     $althosts = explode(" ", $_POST['althostnames']);
     foreach ($althosts as $ah) {
         if (!is_hostname($ah)) {
             $input_errors[] = sprintf(gettext("Alternate hostname %s is not a valid hostname."), htmlspecialchars($ah));
         }
     }
 }
 if ($_POST['sshport']) {
     if (!is_port($_POST['sshport'])) {
         $input_errors[] = gettext("You must specify a valid port number");
     }
 }
 if ($_POST['sshdkeyonly'] == "yes") {
     $config['system']['ssh']['sshdkeyonly'] = "enabled";
 } else {
     if (isset($config['system']['ssh']['sshdkeyonly'])) {
         unset($config['system']['ssh']['sshdkeyonly']);
     }
 }
 ob_flush();
 flush();
 if (!$input_errors) {
     if (update_if_changed("webgui protocol", $config['system']['webgui']['protocol'], $_POST['webguiproto'])) {
         $restart_webgui = true;
开发者ID:calvinbui,项目名称:pfsense,代码行数:31,代码来源:system_advanced_admin.php

示例3: gettext

     if (!is_domain($_POST['auth_server_addr']) && !is_ipaddr($_POST['auth_server_addr'])) {
         $input_errors[] = gettext("802.1X Authentication Server must be an IP or hostname.");
     }
 }
 if (!empty($_POST['auth_server_addr2'])) {
     if (!is_domain($_POST['auth_server_addr2']) && !is_ipaddr($_POST['auth_server_addr2'])) {
         $input_errors[] = gettext("Secondary 802.1X Authentication Server must be an IP or hostname.");
     }
 }
 if (!empty($_POST['auth_server_port'])) {
     if (!is_port($_POST['auth_server_port'])) {
         $input_errors[] = gettext("802.1X Authentication Server Port must be a valid port number (1-65535).");
     }
 }
 if (!empty($_POST['auth_server_port2'])) {
     if (!is_port($_POST['auth_server_port2'])) {
         $input_errors[] = gettext("Secondary 802.1X Authentication Server Port must be a valid port number (1-65535).");
     }
 }
 if (isset($_POST['channel']) && !is_numericint($_POST['channel'])) {
     if (!is_numericint($_POST['channel'])) {
         $input_errors[] = gettext("Invalid channel specified.");
     } else {
         if ($_POST['channel'] > 255 || $_POST['channel'] < 0) {
             $input_errors[] = gettext("Channel must be between 0-255.");
         }
     }
 }
 if (!empty($_POST['distance']) && !is_numericint($_POST['distance'])) {
     $input_errors[] = gettext("Distance must be an integer.");
 }
开发者ID:simudream,项目名称:pfsense,代码行数:31,代码来源:interfaces.php

示例4: trim

 /* item is a normal alias type */
 $wrongaliases = "";
 $desc_fmt_err_found = false;
 for ($x = 0; $x < 4999; $x++) {
     if ($_POST["address{$x}"] != "") {
         $_POST["address{$x}"] = trim($_POST["address{$x}"]);
         if (is_alias($_POST["address{$x}"])) {
             if (!alias_same_type($_POST["address{$x}"], $_POST['type'])) {
                 // But alias type network can include alias type urltable. Feature#1603.
                 if (!($_POST['type'] == 'network' && preg_match("/urltable/i", alias_get_type($_POST["address{$x}"])))) {
                     $wrongaliases .= " " . $_POST["address{$x}"];
                 }
             }
         } else {
             if ($_POST['type'] == "port") {
                 if (!is_port($_POST["address{$x}"]) && !is_portrange($_POST["address{$x}"])) {
                     $input_errors[] = $_POST["address{$x}"] . " " . gettext("is not a valid port or alias.");
                 }
             } else {
                 if ($_POST['type'] == "host" || $_POST['type'] == "network") {
                     if (is_subnet($_POST["address{$x}"]) || !is_ipaddr($_POST["address{$x}"]) && !is_hostname($_POST["address{$x}"]) && !is_iprange($_POST["address{$x}"])) {
                         $input_errors[] = sprintf(gettext('%1$s is not a valid %2$s alias.'), $_POST["address{$x}"], $_POST['type']);
                     }
                 }
             }
         }
         if (is_iprange($_POST["address{$x}"])) {
             list($startip, $endip) = explode('-', $_POST["address{$x}"]);
             $rangesubnets = ip_range_to_subnet_array($startip, $endip);
             $address = array_merge($address, $rangesubnets);
         } else {
开发者ID:wcchandler,项目名称:pfsense,代码行数:31,代码来源:firewall_aliases_edit.php

示例5: foreach

             }
         }
     }
 }
 // Validate the input data expanded above.
 foreach ($input_addresses as $idx => $input_address) {
     if (is_alias($input_address)) {
         if (!alias_same_type($input_address, $_POST['type'])) {
             // But alias type network can include alias type urltable. Feature#1603.
             if (!($_POST['type'] == 'network' && preg_match("/urltable/i", alias_get_type($input_address)))) {
                 $wrongaliases .= " " . $input_address;
             }
         }
     } else {
         if ($_POST['type'] == "port") {
             if (!is_port($input_address) && !is_portrange($input_address)) {
                 $input_errors[] = $input_address . " " . gettext("is not a valid port or alias.");
             }
         } else {
             if ($_POST['type'] == "host" || $_POST['type'] == "network") {
                 if (is_subnet($input_address) || !is_ipaddr($input_address) && !is_hostname($input_address)) {
                     $input_errors[] = sprintf(gettext('%1$s is not a valid %2$s address, FQDN or alias.'), $input_address, $_POST['type']);
                 }
             }
         }
     }
     $tmpaddress = $input_address;
     if ($_POST['type'] != "host" && is_ipaddr($input_address) && $input_address_subnet[$idx] != "") {
         if (!is_subnet($input_address . "/" . $input_address_subnet[$idx])) {
             $input_errors[] = sprintf(gettext('%s/%s is not a valid subnet.'), $input_address, $input_address_subnet[$idx]);
         } else {
开发者ID:jefersonJim,项目名称:pfsense,代码行数:31,代码来源:firewall_aliases_edit.php

示例6: sprintf

     if ($newpost != $temp) {
         $input_errors[] = sprintf(gettext("Invalid characters detected (%s).  Please remove invalid characters and save again."), $temp);
     }
 }
 /* input validation */
 $reqdfields = explode(" ", "interface protocol source source_subnet destination destination_subnet");
 $reqdfieldsn = array(gettext("Interface"), gettext("Protocol"), gettext("Source"), gettext("Source bit count"), gettext("Destination"), gettext("Destination bit count"));
 do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
 $protocol_uses_ports = in_array($_POST['protocol'], explode(" ", "any tcp udp tcp/udp"));
 if ($protocol_uses_ports && $_POST['sourceport'] != "" && !is_portoralias($_POST['sourceport'])) {
     $input_errors[] = gettext("You must supply either a valid port or port alias for the source port entry.");
 }
 if ($protocol_uses_ports and $_POST['dstport'] != "" and !is_portoralias($_POST['dstport'])) {
     $input_errors[] = gettext("You must supply either a valid port or port alias for the destination port entry.");
 }
 if ($protocol_uses_ports and $_POST['natport'] != "" and !is_port($_POST['natport']) and !isset($_POST['nonat'])) {
     $input_errors[] = gettext("You must supply a valid port for the nat port entry.");
 }
 if ($_POST['source_type'] != "any") {
     if ($_POST['source'] && !is_ipaddroralias($_POST['source']) && $_POST['source'] != "any") {
         $input_errors[] = gettext("A valid source must be specified.");
     }
 }
 if ($_POST['source_subnet'] && !is_numericint($_POST['source_subnet'])) {
     $input_errors[] = gettext("A valid source bit count must be specified.");
 }
 if ($_POST['destination_type'] != "any") {
     if ($_POST['destination'] && !is_ipaddroralias($_POST['destination'])) {
         $input_errors[] = gettext("A valid destination must be specified.");
     }
 }
开发者ID:rdmenezes,项目名称:pfsense,代码行数:31,代码来源:firewall_nat_out_edit.php

示例7: str_replace

 }
 if ($host != "") {
     $host_string = str_replace(array(" ", "|", ","), array("", "#|", "#+"), $host);
     if (strpos($host_string, '#') === false) {
         $hosts = array($host);
     } else {
         $hosts = explode('#', $host_string);
     }
     foreach ($hosts as $h) {
         if (!is_subnet(strip_host_logic($h)) && !is_ipaddr(strip_host_logic($h))) {
             $input_errors[] = sprintf(gettext("A valid IP address or CIDR block must be specified. [%s]"), $h);
         }
     }
 }
 if ($port != "") {
     if (!is_port(strip_not($port))) {
         $input_errors[] = gettext("Invalid value specified for port.");
     }
 }
 if ($snaplen == "") {
     $snaplen = 0;
 } else {
     if (!is_numeric($snaplen) || $snaplen < 0) {
         $input_errors[] = gettext("Invalid value specified for packet length.");
     }
 }
 if ($count == "") {
     $count = 0;
 } else {
     if (!is_numeric($count) || $count < 0) {
         $input_errors[] = gettext("Invalid value specified for packet count.");
开发者ID:calvinbui,项目名称:pfsense,代码行数:31,代码来源:diag_packet_capture.php

示例8: gettext

     }
     if ($pconfig['fam'] !== "" && $pconfig['fam'] !== "ip" && $pconfig['fam'] !== "ip6") {
         $input_errors[] = gettext("Invalid address family.");
     }
     $protos = array('icmp', 'icmp6', 'tcp', 'udp', 'arp', 'carp', 'esp', '!icmp', '!icmp6', '!tcp', '!udp', '!arp', '!carp', '!esp');
     if ($pconfig['proto'] !== "" && !in_array(ltrim(trim($pconfig['proto']), '!'), $protos)) {
         $input_errors[] = gettext("Invalid protocol.");
     }
     if (!empty($pconfig['host'])) {
         foreach (explode(' ', $pconfig['host']) as $token) {
             if (!in_array(trim($token), array('and', 'or', 'not')) && !is_ipaddr($token) && !is_subnet($token)) {
                 $input_errors[] = sprintf(gettext("A valid IP address or CIDR block must be specified. [%s]"), $token);
             }
         }
     }
     if (!empty($pconfig['port']) && !is_port(ltrim(trim($pconfig['port']), 'not'))) {
         $input_errors[] = gettext("Invalid value specified for port.");
     }
     if (!empty($pconfig['snaplen']) && (!is_numeric($pconfig['snaplen']) || $snaplen < 0)) {
         $input_errors[] = gettext("Invalid value specified for packet length.");
     }
     if (!empty($pconfig['count']) && (!is_numeric($pconfig['count']) || $count < 0)) {
         $input_errors[] = gettext("Invalid value specified for packet count.");
     }
     if (count($input_errors) == 0) {
         start_capture($pconfig);
     }
 } elseif (!empty($pconfig['stop'])) {
     stop_capture();
 } elseif (!empty($pconfig['remove'])) {
     if (file_exists('/root/packetcapture.cap')) {
开发者ID:8191,项目名称:opnsense-core,代码行数:31,代码来源:diag_packet_capture.php

示例9: elseif

    $pconfig['showtext'] = null;
    $pconfig['sourceip'] = null;
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $pconfig = $_POST;
    $input_errors = array();
    /* input validation */
    $reqdfields = explode(" ", "host port");
    $reqdfieldsn = array(gettext("Host"), gettext("Port"));
    do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
    if (!is_ipaddr($pconfig['host']) && !is_hostname($pconfig['host'])) {
        $input_errors[] = gettext("Please enter a valid IP or hostname.");
    }
    if (!is_port($pconfig['port'])) {
        $input_errors[] = gettext("Please enter a valid port number.");
    }
    if ($pconfig['srcport'] != "" && (!is_numeric($pconfig['srcport']) || !is_port($pconfig['srcport']))) {
        $input_errors[] = gettext("Please enter a valid source port number, or leave the field blank.");
    }
    if (is_ipaddrv4($pconfig['host']) && $pconfig['ipprotocol'] == "ipv6") {
        $input_errors[] = gettext("You cannot connect to an IPv4 address using IPv6.");
    }
    if (is_ipaddrv6($pconfig['host']) && $pconfig['ipprotocol'] == "ipv4") {
        $input_errors[] = gettext("You cannot connect to an IPv6 address using IPv4.");
    }
    if (count($input_errors) == 0) {
        $nc_args = "-w 10";
        if (empty($pconfig['showtext'])) {
            $nc_args .= " -z ";
        }
        if (!empty($pconfig['srcport'])) {
            $nc_args .= " -p " . escapeshellarg($pconfig['srcport']) . " ";
开发者ID:paudam,项目名称:opnsense-core,代码行数:31,代码来源:diag_testport.php

示例10: gettext

     }
 } else {
     /* item is a normal alias type */
     $wrongaliases = "";
     for ($x = 0; $x < 4999; $x++) {
         if ($_POST["address{$x}"] != "") {
             if (is_alias($_POST["address{$x}"])) {
                 if (!alias_same_type($_POST["address{$x}"], $_POST['type'])) {
                     // But alias type network can include alias type urltable. Feature#1603.
                     if (!($_POST['type'] == 'network' && alias_get_type($_POST["address{$x}"]) == 'urltable')) {
                         $wrongaliases .= " " . $_POST["address{$x}"];
                     }
                 }
             } else {
                 if ($_POST['type'] == "port") {
                     if (!is_port($_POST["address{$x}"])) {
                         $input_errors[] = $_POST["address{$x}"] . " " . gettext("is not a valid port or alias.");
                     }
                 } else {
                     if ($_POST['type'] == "host" || $_POST['type'] == "network") {
                         if (!is_ipaddr($_POST["address{$x}"]) && !is_hostname($_POST["address{$x}"]) && !is_iprange($_POST["address{$x}"])) {
                             $input_errors[] = sprintf(gettext('%1$s is not a valid %2$s alias.'), $_POST["address{$x}"], $_POST['type']);
                         }
                     }
                 }
             }
             if (is_iprange($_POST["address{$x}"])) {
                 list($startip, $endip) = explode('-', $_POST["address{$x}"]);
                 $rangesubnets = ip_range_to_subnet_array($startip, $endip);
                 $address = array_merge($address, $rangesubnets);
             } else {
开发者ID:rdmenezes,项目名称:pfsense,代码行数:31,代码来源:firewall_aliases_edit.php

示例11: array

         }
     }
 }
 /* DSPAM Daemon Settings (Client) */
 if ($_POST['enabledsclient'] == "yes") {
     if (!$_POST['dsclhost'] != "") {
         $error_bucket[] = array("error" => "You must specify a valid server name value for the DSPAM client host.", "field" => "dsclhost");
     } else {
         foreach (explode(' ', $_POST['dsclhost']) as $ts) {
             if (!is_domain($ts)) {
                 $error_bucket[] = array("error" => "A DSPAM client host name may only contain the characters a-z, 0-9, '-' and '.'.", "field" => "dsclhost");
                 break;
             }
         }
     }
     if (!is_port($_POST['dsclport'])) {
         $error_bucket[] = array("error" => "You must specify a valid port value for the DSPAM client host.", "field" => "dsclport");
     }
     if (!$_POST['dsclident'] != "") {
         $error_bucket[] = array("error" => "You must specify a valid value as identification string for the DSPAM client.", "field" => "dsclident");
     }
 }
 if (is_array($error_bucket)) {
     foreach ($error_bucket as $elem) {
         $input_errors[] =& $elem["error"];
     }
 }
 /* if this is an AJAX caller then handle via JSON */
 if (isAjax() && is_array($input_errors)) {
     input_errors2Ajax($input_errors);
     exit;
开发者ID:MarkVLK,项目名称:pfsense-packages,代码行数:31,代码来源:dspam-settings.php

示例12: get_remote_log

function get_remote_log()
{
    global $config, $g, $postfix_dir;
    $curr_time = time();
    $log_time = date('YmdHis', $curr_time);
    if (is_array($config['installedpackages']['postfixsync'])) {
        $synctimeout = $config['installedpackages']['postfixsync']['config'][0]['synctimeout'] ?: '250';
        foreach ($config['installedpackages']['postfixsync']['config'][0]['row'] as $sh) {
            // Get remote data for enabled fetch hosts
            if ($sh['enabless'] && $sh['sync_type'] == 'fetch') {
                $sync_to_ip = $sh['ipaddress'];
                $port = $sh['syncport'];
                $username = $sh['username'] ?: 'admin';
                $password = $sh['password'];
                $protocol = $sh['syncprotocol'];
                $file = '/var/db/postfix/' . $server . '.sql';
                $error = '';
                $valid = TRUE;
                if ($password == "") {
                    $error = "Password parameter is empty. ";
                    $valid = FALSE;
                }
                if ($protocol == "") {
                    $error = "Protocol parameter is empty. ";
                    $valid = FALSE;
                }
                if (!is_ipaddr($sync_to_ip) && !is_hostname($sync_to_ip) && !is_domain($sync_to_ip)) {
                    $error .= "Misconfigured Replication Target IP Address or Hostname. ";
                    $valid = FALSE;
                }
                if (!is_port($port)) {
                    $error .= "Misconfigured Replication Target Port. ";
                    $valid = FALSE;
                }
                if ($valid) {
                    // Take care of IPv6 literal address
                    if (is_ipaddrv6($sync_to_ip)) {
                        $sync_to_ip = "[{$sync_to_ip}]";
                    }
                    $url = "{$protocol}://{$sync_to_ip}";
                    print "{$sync_to_ip} {$url}, {$port}\n";
                    $method = 'pfsense.exec_php';
                    $execcmd = "require_once('/usr/local/www/postfix.php');\n";
                    $execcmd .= '$toreturn = get_sql(' . $log_time . ');';
                    /* Assemble XMLRPC payload. */
                    $params = array(XML_RPC_encode($password), XML_RPC_encode($execcmd));
                    log_error("[postfix] Fetching sql data from {$sync_to_ip}.");
                    $msg = new XML_RPC_Message($method, $params);
                    $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
                    $cli->setCredentials($username, $password);
                    //$cli->setDebug(1);
                    $resp = $cli->send($msg, $synctimeout);
                    $a = $resp->value();
                    $errors = 0;
                    //var_dump($sql);
                    foreach ($a as $b) {
                        foreach ($b as $c) {
                            foreach ($c as $d) {
                                foreach ($d as $e) {
                                    $update = unserialize($e['string']);
                                    print $update['day'] . "\n";
                                    if ($update['day'] != "") {
                                        create_db($update['day'] . ".db");
                                        if ($debug) {
                                            print $update['day'] . " writing from remote system to db...";
                                        }
                                        $dbhandle = sqlite_open($postfix_dir . '/' . $update['day'] . ".db", 0666, $error);
                                        //file_put_contents("/tmp/" . $key . '-' . $update['day'] . ".sql", gzuncompress(base64_decode($update['sql'])), LOCK_EX);
                                        $ok = sqlite_exec($dbhandle, gzuncompress(base64_decode($update['sql'])), $error);
                                        if (!$ok) {
                                            $errors++;
                                            die("Cannot execute query. {$error}\n" . $update['sql'] . "\n");
                                        } elseif ($debug) {
                                            print "ok\n";
                                        }
                                        sqlite_close($dbhandle);
                                    }
                                }
                            }
                        }
                    }
                    if ($errors == 0) {
                        $method = 'pfsense.exec_php';
                        $execcmd = "require_once('/usr/local/www/postfix.php');\n";
                        $execcmd .= 'flush_sql(' . $log_time . ');';
                        /* Assemble XMLRPC payload. */
                        $params = array(XML_RPC_encode($password), XML_RPC_encode($execcmd));
                        log_error("[postfix] Flushing sql buffer file from {$sync_to_ip}.");
                        $msg = new XML_RPC_Message($method, $params);
                        $cli = new XML_RPC_Client('/xmlrpc.php', $url, $port);
                        $cli->setCredentials($username, $password);
                        //$cli->setDebug(1);
                        $resp = $cli->send($msg, $synctimeout);
                    }
                } else {
                    log_error("[postfix] Fetch sql database from '{$sync_to_ip}' aborted due to the following error(s): {$error}");
                }
            }
        }
        log_error("[postfix] Fetch sql database completed.");
//.........这里部分代码省略.........
开发者ID:LFCavalcanti,项目名称:pfsense-packages,代码行数:101,代码来源:postfix.php

示例13: foreach

 }
 if ($_POST['type'] == "network") {
     if (!is_ipaddr($_POST['address'])) {
         $input_errors[] = "Geçerli bir adres tanımlanmaldır.";
     }
     if (!is_numeric($_POST['address_subnet'])) {
         $input_errors[] = "Geçerli bir subnet bit count tanımlanmalıdır.";
     }
 }
 if ($_POST['type'] == "url") {
     if (stristr($_POST['address'], "http") == false) {
         $input_errors[] = "Bu kaynak için geçerli bir URL sağlamanız gerekir.";
     }
 }
 if ($_POST['type'] == "port") {
     if (!is_port($_POST['address']) && !is_portrange($_POST['address'])) {
         $input_errors[] = "Lütfen port aralığı içinde geçerlibir port tanımlayınız.";
     }
 }
 /* check for name conflicts */
 foreach ($a_aliases as $alias) {
     if (isset($id) && $a_aliases[$id] && $a_aliases[$id] === $alias) {
         continue;
     }
     if ($alias['name'] == $_POST['name']) {
         $input_errors[] = "Bu takma isimle bir tanımlama mevcuttur.";
         break;
     }
 }
 /* check for name interface description conflicts */
 foreach ($config['interfaces'] as $interface) {
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:firewall_aliases_edit.php

示例14: explode

     $reqdfields = explode(" ", "interface proto localip");
     $reqdfieldsn = explode(",", "Interface,Protocol,NAT IP");
 }
 do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
 if ($_POST['localip'] && !is_ipaddroralias($_POST['localip'])) {
     $input_errors[] = "\"{$_POST['localip']}\" geçerli bir NAT IP adresi vey ahost alias değildir.";
 }
 /* only validate the ports if the protocol is TCP, UDP or TCP/UDP */
 if (strtoupper($_POST['proto']) == "TCP" or strtoupper($_POST['proto']) == "UDP" or strtoupper($_POST['proto']) == "TCP/UDP") {
     if ($_POST['beginport'] && !is_ipaddroralias($_POST['beginport']) && !is_port($_POST['beginport'])) {
         $input_errors[] = "Başlangıç portu 1 ile 65535 arasında bir tamsayı olmalıdır.";
     }
     if ($_POST['endport'] && !is_ipaddroralias($_POST['endport']) && !is_port($_POST['endport'])) {
         $input_errors[] = "Bitiş portu 1 ile 65535 arasında bir değer olmalıdır.";
     }
     if ($_POST['localbeginport'] && !is_ipaddroralias($_POST['localbeginport']) && !is_port($_POST['localbeginport'])) {
         $input_errors[] = "Yerel port tamsayı ve 1 ile 65535 arasında bir değer olmalıdır.";
     }
     if ($_POST['beginport'] > $_POST['endport']) {
         /* swap */
         $tmp = $_POST['endport'];
         $_POST['endport'] = $_POST['beginport'];
         $_POST['beginport'] = $tmp;
     }
     if (!$input_errors) {
         if ($_POST['endport'] - $_POST['beginport'] + $_POST['localbeginport'] > 65535) {
             $input_errors[] = "Hedef port 1 ile 65535 arasında bir değer olmalıdır.";
         }
     }
 }
 /* check for overlaps */
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:firewall_nat_edit.php

示例15: gettext

 /* input validation */
 if (!empty($pconfig['webguiport'])) {
     if (!is_port($pconfig['webguiport'])) {
         $input_errors[] = gettext("You must specify a valid webConfigurator port number");
     }
 }
 if (!empty($pconfig['althostnames'])) {
     $althosts = explode(" ", $pconfig['althostnames']);
     foreach ($althosts as $ah) {
         if (!is_hostname($ah)) {
             $input_errors[] = sprintf(gettext("Alternate hostname %s is not a valid hostname."), htmlspecialchars($ah));
         }
     }
 }
 if (!empty($pconfig['sshport'])) {
     if (!is_port($pconfig['sshport'])) {
         $input_errors[] = gettext("You must specify a valid port number");
     }
 }
 if (count($input_errors) == 0) {
     // flag web ui for restart
     if ($config['system']['webgui']['protocol'] != $pconfig['webguiproto'] || $config['system']['webgui']['port'] != $pconfig['webguiport'] || $config['system']['webgui']['ssl-certref'] != $pconfig['ssl-certref'] || ($pconfig['disablehttpredirect'] == "yes") != !empty($config['system']['webgui']['disablehttpredirect'])) {
         $restart_webgui = true;
     } else {
         $restart_webgui = false;
     }
     $config['system']['webgui']['protocol'] = $pconfig['webguiproto'];
     $config['system']['webgui']['port'] = $pconfig['webguiport'];
     $config['system']['webgui']['ssl-certref'] = $pconfig['ssl-certref'];
     if ($pconfig['disablehttpredirect'] == "yes") {
         $config['system']['webgui']['disablehttpredirect'] = true;
开发者ID:siloportem,项目名称:core,代码行数:31,代码来源:system_advanced_admin.php


注:本文中的is_port函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。