• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_numericint函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: isset

    $pconfig['tunnel-remote-addr'] = $a_gifs[$id]['tunnel-remote-addr'];
    $pconfig['link1'] = isset($a_gifs[$id]['link1']);
    $pconfig['link0'] = isset($a_gifs[$id]['link0']);
    $pconfig['descr'] = $a_gifs[$id]['descr'];
}
if ($_POST) {
    unset($input_errors);
    $pconfig = $_POST;
    /* input validation */
    $reqdfields = explode(" ", "if remote-addr tunnel-local-addr tunnel-remote-addr tunnel-remote-net");
    $reqdfieldsn = array(gettext("Parent interface"), gettext("gif remote address"), gettext("gif tunnel local address"), gettext("gif tunnel remote address"), gettext("gif tunnel remote netmask"));
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
    if (!is_ipaddr($_POST['tunnel-local-addr']) || !is_ipaddr($_POST['tunnel-remote-addr']) || !is_ipaddr($_POST['remote-addr'])) {
        $input_errors[] = gettext("The tunnel local and tunnel remote fields must have valid IP addresses.");
    }
    if (!is_numericint($_POST['tunnel-remote-net'])) {
        $input_errors[] = gettext("The gif tunnel subnet must be an integer.");
    }
    if (is_ipaddrv4($_POST['tunnel-local-addr'])) {
        if (!is_ipaddrv4($_POST['tunnel-remote-addr'])) {
            $input_errors[] = gettext("The gif tunnel remote address must be IPv4 where tunnel local address is IPv4.");
        }
        if ($_POST['tunnel-remote-net'] > 32 || $_POST['tunnel-remote-net'] < 1) {
            $input_errors[] = gettext("The gif tunnel subnet must be an integer between 1 and 32.");
        }
    }
    if (is_ipaddrv6($_POST['tunnel-local-addr'])) {
        if (!is_ipaddrv6($_POST['tunnel-remote-addr'])) {
            $input_errors[] = gettext("The gif tunnel remote address must be IPv6 where tunnel local address is IPv6.");
        }
        if ($_POST['tunnel-remote-net'] > 128 || $_POST['tunnel-remote-net'] < 1) {
开发者ID:nwholloway,项目名称:pfsense,代码行数:31,代码来源:interfaces_gif_edit.php


示例2: elseif

 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */
require_once "guiconfig.inc";
require_once "/usr/local/pkg/snort/snort.inc";
global $g;
$snortdir = SNORTDIR;
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
    $id = $_POST['id'];
} elseif (isset($_GET['id']) && is_numericint($_GET['id'])) {
    $id = htmlspecialchars($_GET['id']);
}
if (isset($_POST['eng_id']) && isset($_POST['eng_id'])) {
    $eng_id = $_POST['eng_id'];
} elseif (isset($_GET['eng_id']) && is_numericint($_GET['eng_id'])) {
    $eng_id = htmlspecialchars($_GET['eng_id']);
}
if (is_null($id)) {
    // Clear and close out any session variable we created
    session_start();
    unset($_SESSION['ftp_client_import']);
    session_write_close();
    header("Location: /snort/snort_interfaces.php");
    exit;
}
if (!is_array($config['installedpackages']['snortglobal']['rule'])) {
    $config['installedpackages']['snortglobal']['rule'] = array();
}
if (!is_array($config['installedpackages']['snortglobal']['rule'][$id]['ftp_client_engine']['item'])) {
    $config['installedpackages']['snortglobal']['rule'][$id]['ftp_client_engine']['item'] = array();
开发者ID:MarkVLK,项目名称:pfsense-packages,代码行数:31,代码来源:snort_ftp_client_engine.php


示例3: array

    $config['dhcpd'][$if]['staticmap'] = array();
}
if (!is_array($config['dhcpd'][$if]['pool'])) {
    $config['dhcpd'][$if]['pool'] = array();
}
$a_pools =& $config['dhcpd'][$if]['pool'];
$static_arp_enabled = isset($config['dhcpd'][$if]['staticarp']);
$netboot_enabled = isset($config['dhcpd'][$if]['netboot']);
$a_maps =& $config['dhcpd'][$if]['staticmap'];
$ifcfgip = get_interface_ip($if);
$ifcfgsn = get_interface_subnet($if);
$ifcfgdescr = convert_friendly_interface_to_friendly_descr($if);
if (is_numericint($_GET['id'])) {
    $id = $_GET['id'];
}
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
    $id = $_POST['id'];
}
if (isset($id) && $a_maps[$id]) {
    $pconfig['mac'] = $a_maps[$id]['mac'];
    $pconfig['cid'] = $a_maps[$id]['cid'];
    $pconfig['hostname'] = $a_maps[$id]['hostname'];
    $pconfig['ipaddr'] = $a_maps[$id]['ipaddr'];
    $pconfig['filename'] = $a_maps[$id]['filename'];
    $pconfig['rootpath'] = $a_maps[$id]['rootpath'];
    $pconfig['descr'] = $a_maps[$id]['descr'];
    $pconfig['arp_table_static_entry'] = isset($a_maps[$id]['arp_table_static_entry']);
    $pconfig['deftime'] = $a_maps[$id]['defaultleasetime'];
    $pconfig['maxtime'] = $a_maps[$id]['maxleasetime'];
    $pconfig['gateway'] = $a_maps[$id]['gateway'];
    $pconfig['domain'] = $a_maps[$id]['domain'];
开发者ID:sjourdois,项目名称:pfsense,代码行数:31,代码来源:services_dhcp_edit.php


示例4: gettext

     $input_errors[] = gettext("Timeout needs to be an integer.");
 }
 if ($_POST['fwdelay'] && !is_numericint($_POST['fwdelay'])) {
     $input_errors[] = gettext("Forward Delay needs to be an integer between 4 and 30.");
 }
 if ($_POST['hellotime'] && !is_numericint($_POST['hellotime'])) {
     $input_errors[] = gettext("Hello time for STP needs to be an integer between 1 and 2.");
 }
 if ($_POST['priority'] && !is_numericint($_POST['priority'])) {
     $input_errors[] = gettext("Priority for STP needs to be an integer between 0 and 61440.");
 }
 if ($_POST['holdcnt'] && !is_numericint($_POST['holdcnt'])) {
     $input_errors[] = gettext("Transmit Hold Count for STP needs to be an integer between 1 and 10.");
 }
 foreach ($ifacelist as $ifn => $ifdescr) {
     if ($_POST[$ifn] != "" && !is_numericint($_POST[$ifn])) {
         $input_errors[] = sprintf(gettext("%s interface priority for STP needs to be an integer between 0 and 240."), $ifdescr);
     }
 }
 $i = 0;
 foreach ($ifacelist as $ifn => $ifdescr) {
     if ($_POST["{$ifn}{$i}"] != "" && !is_numeric($_POST["{$ifn}{$i}"])) {
         $input_errors[] = sprintf(gettext("%s interface path cost for STP needs to be an integer between 1 and 200000000."), $ifdescr);
     }
     $i++;
 }
 if (!is_array($_POST['members']) || count($_POST['members']) < 1) {
     $input_errors[] = gettext("At least one member interface must be selected for a bridge.");
 }
 if (is_array($_POST['static'])) {
     foreach ($_POST['static'] as $ifstatic) {
开发者ID:LFCavalcanti,项目名称:pfsense,代码行数:31,代码来源:interfaces_bridge_edit.php


示例5: gettext

     if ($_POST['raminrtradvinterval'] < "3") {
         $input_errors[] = gettext("Minimum advertisement interval must be no less than 3.");
     }
     if ($_POST['ramaxrtradvinterval'] && $_POST['raminrtradvinterval'] > 0.75 * $_POST['ramaxrtradvinterval']) {
         $input_errors[] = gettext("Minimum advertisement interval must be no greater than 0.75 * Maximum advertisement interval");
     }
 }
 if ($_POST['ramaxrtradvinterval']) {
     if (!is_numericint($_POST['ramaxrtradvinterval'])) {
         $input_errors[] = gettext("Maximum advertisement interval must be an integer.");
     }
     if ($_POST['ramaxrtradvinterval'] < "4" || $_POST['ramaxrtradvinterval'] > "1800") {
         $input_errors[] = gettext("Maximum advertisement interval must be no less than 4 and no greater than 1800.");
     }
 }
 if ($_POST['raadvdefaultlifetime'] && !is_numericint($_POST['raadvdefaultlifetime'])) {
     $input_errors[] = gettext("Router lifetime must be an integer between 1 and 9000.");
 }
 if (!$input_errors) {
     if (!is_array($config['dhcpdv6'][$if])) {
         $config['dhcpdv6'][$if] = array();
     }
     $config['dhcpdv6'][$if]['ramode'] = $_POST['ramode'];
     $config['dhcpdv6'][$if]['rapriority'] = $_POST['rapriority'];
     $config['dhcpdv6'][$if]['rainterface'] = $_POST['rainterface'];
     $config['dhcpdv6'][$if]['ravalidlifetime'] = $_POST['ravalidlifetime'];
     $config['dhcpdv6'][$if]['rapreferredlifetime'] = $_POST['rapreferredlifetime'];
     $config['dhcpdv6'][$if]['raminrtradvinterval'] = $_POST['raminrtradvinterval'];
     $config['dhcpdv6'][$if]['ramaxrtradvinterval'] = $_POST['ramaxrtradvinterval'];
     $config['dhcpdv6'][$if]['raadvdefaultlifetime'] = $_POST['raadvdefaultlifetime'];
     $config['dhcpdv6'][$if]['radomainsearchlist'] = $_POST['radomainsearchlist'];
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:31,代码来源:services_router_advertisements.php


示例6: gettext

 if ($_POST['udpmultipletimeout'] && !is_numericint($_POST['udpmultipletimeout'])) {
     $input_errors[] = gettext("The UDP multiple timeout value must be an integer.");
 }
 if ($_POST['icmpfirsttimeout'] && !is_numericint($_POST['icmpfirsttimeout'])) {
     $input_errors[] = gettext("The ICMP first timeout value must be an integer.");
 }
 if ($_POST['icmperrortimeout'] && !is_numericint($_POST['icmperrortimeout'])) {
     $input_errors[] = gettext("The ICMP error timeout value must be an integer.");
 }
 if ($_POST['otherfirsttimeout'] && !is_numericint($_POST['otherfirsttimeout'])) {
     $input_errors[] = gettext("The Other first timeout value must be an integer.");
 }
 if ($_POST['othersingletimeout'] && !is_numericint($_POST['othersingletimeout'])) {
     $input_errors[] = gettext("The Other single timeout value must be an integer.");
 }
 if ($_POST['othermultipletimeout'] && !is_numericint($_POST['othermultipletimeout'])) {
     $input_errors[] = gettext("The Other multiple timeout value must be an integer.");
 }
 ob_flush();
 flush();
 if (!$input_errors) {
     if ($_POST['disablefilter'] == "yes") {
         $config['system']['disablefilter'] = "enabled";
     } else {
         unset($config['system']['disablefilter']);
     }
     if ($_POST['disablevpnrules'] == "yes") {
         $config['system']['disablevpnrules'] = true;
     } else {
         unset($config['system']['disablevpnrules']);
     }
开发者ID:curtiszimmerman,项目名称:pfsense,代码行数:31,代码来源:system_advanced_firewall.php


示例7: gettext

 if ($_POST['pppoe_resetminute'] != "" && !is_numericint($_POST['pppoe_resetminute']) && $_POST['pppoe_resetminute'] >= 0 && $_POST['pppoe_resetminute'] <= 59) {
     $input_errors[] = gettext("PPPoE yeniden başlatma dakikası (0-59) arasında olmalıdır.");
 }
 if ($_POST['pppoe_resetdate'] != "" && !is_numeric(str_replace("/", "", $_POST['pppoe_resetdate']))) {
     $input_errors[] = gettext("PPPoE yeniden başlatma tarih değeri (mm/dd/yyyy) bu şekilde tanımlanmalıdır.");
 }
 if ($_POST['pptp_local'] && !is_ipaddr($_POST['pptp_local'])) {
     $input_errors[] = "Geçerli bir PPTP yerel IP adresi tanımlanmalıdır.";
 }
 if ($_POST['pptp_subnet'] && !is_numeric($_POST['pptp_subnet'])) {
     $input_errors[] = "Geçerli bir PPTP subnet bit count tanımlanmalıdır.";
 }
 if ($_POST['pptp_remote'] && !is_ipaddr($_POST['pptp_remote'])) {
     $input_errors[] = "PPTP uzak IP için geçerli bir IP adresi tanımlanmaldır.";
 }
 if ($_POST['pptp_idletimeout'] != "" && !is_numericint($_POST['pptp_idletimeout'])) {
     $input_errors[] = "idle timeout bir tamsayı olmak zorundadır.";
 }
 if ($_POST['spoofmac'] && !is_macaddr($_POST['spoofmac'])) {
     $input_errors[] = "Geçerli bir MAC adresi tanımlanmalıdır.";
 }
 if ($_POST['mtu'] && ($_POST['mtu'] < 576 || $_POST['mtu'] > 1500)) {
     $input_errors[] = "MTU değeri 576 ile 1500 byte arasında olmalıdır.";
 }
 /* Wireless interface? */
 if (isset($wancfg['wireless'])) {
     $wi_input_errors = wireless_config_post();
     if ($wi_input_errors) {
         $input_errors = array_merge($input_errors, $wi_input_errors);
     }
 }
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:interfaces.php


示例8: unset

                unset($a_vip[$_GET['id']]);
                interface_proxyarp_configure($viface);
            } else {
                interface_vip_bring_down($a_vip[$_GET['id']]);
                unset($a_vip[$_GET['id']]);
            }
            if (count($config['virtualip']['vip']) == 0) {
                unset($config['virtualip']['vip']);
            }
            write_config();
            header("Location: firewall_virtual_ip.php");
            exit;
        }
    }
} else {
    if ($_GET['changes'] == "mods" && is_numericint($_GET['id'])) {
        $id = $_GET['id'];
    }
}
$pgtitle = array(gettext("Firewall"), gettext("Virtual IP Addresses"));
include "head.inc";
$main_buttons = array(array('href' => 'firewall_virtual_ip_edit.php', 'label' => 'Add'));
?>
<body>
<?php 
include "fbegin.inc";
?>

	<section class="page-content-main">
		<div class="container-fluid">
			<div class="row">
开发者ID:hlcherub,项目名称:core,代码行数:31,代码来源:firewall_virtual_ip.php


示例9: array

 $reqdfieldsn = array(gettext("Server address"), gettext("Remote start address"));
 if ($_POST['radiusenable']) {
     $reqdfields = array_merge($reqdfields, explode(" ", "radiusserver radiussecret"));
     $reqdfieldsn = array_merge($reqdfieldsn, array(gettext("RADIUS server address"), gettext("RADIUS shared secret")));
 }
 do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
 if ($_POST['localip'] && !is_ipaddr($_POST['localip'])) {
     $input_errors[] = gettext("A valid server address must be specified.");
 }
 if ($_POST['remoteip'] && !is_ipaddr($_POST['remoteip'])) {
     $input_errors[] = gettext("A valid remote start address must be specified.");
 }
 if ($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver'])) {
     $input_errors[] = gettext("A valid RADIUS server address must be specified.");
 }
 if (!is_numericint($_POST['n_pppoe_units']) || $_POST['n_pppoe_units'] > 255) {
     $input_errors[] = gettext("Number of PPPoE users must be between 1 and 255");
 }
 if (!is_numeric($_POST['pppoe_subnet']) || $_POST['pppoe_subnet'] < 0 || $_POST['pppoe_subnet'] > 32) {
     $input_errors[] = gettext("Subnet mask must be an interger between 0 and 32");
 }
 $_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['pppoe_subnet']);
 $subnet_start = ip2ulong($_POST['remoteip']);
 $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['pppoe_subnet'] - 1;
 if (ip2ulong($_POST['localip']) >= $subnet_start && ip2ulong($_POST['localip']) <= $subnet_end) {
     $input_errors[] = gettext("The specified server address lies in the remote subnet.");
 }
 if ($_POST['localip'] == get_interface_ip($_POST['interface'])) {
     $input_errors[] = gettext("The specified server address is equal to an interface ip address.");
 }
 for ($x = 0; $x < 4999; $x++) {
开发者ID:z0x010,项目名称:pfsense,代码行数:31,代码来源:services_pppoe_edit.php


示例10: gettext

 if (!empty($_POST['adaptiveend']) && !is_numericint($_POST['adaptiveend'])) {
     $input_errors[] = gettext("The Firewall Adaptive End value must be an integer.");
 }
 if ($_POST['maximumstates'] && !is_numericint($_POST['maximumstates'])) {
     $input_errors[] = gettext("The Firewall Maximum States value must be an integer.");
 }
 if ($_POST['aliasesresolveinterval'] && !is_numericint($_POST['aliasesresolveinterval'])) {
     $input_errors[] = gettext("The Aliases Hostname Resolve Interval value must be an integer.");
 }
 if ($_POST['maximumtableentries'] && !is_numericint($_POST['maximumtableentries'])) {
     $input_errors[] = gettext("The Firewall Maximum Table Entries value must be an integer.");
 }
 if ($_POST['tcpidletimeout'] && !is_numericint($_POST['tcpidletimeout'])) {
     $input_errors[] = gettext("The TCP idle timeout must be an integer.");
 }
 if ($_POST['reflectiontimeout'] && !is_numericint($_POST['reflectiontimeout'])) {
     $input_errors[] = gettext("The Reflection timeout must be an integer.");
 }
 ob_flush();
 flush();
 if (!$input_errors) {
     if ($_POST['disablefilter'] == "yes") {
         $config['system']['disablefilter'] = "enabled";
     } else {
         unset($config['system']['disablefilter']);
     }
     if ($_POST['disablevpnrules'] == "yes") {
         $config['system']['disablevpnrules'] = true;
     } else {
         unset($config['system']['disablevpnrules']);
     }
开发者ID:noikiy,项目名称:core-2,代码行数:31,代码来源:system_advanced_firewall.php


示例11: array

 *
 */
##|+PRIV
##|*IDENT=page-system-usermanager
##|*NAME=System: User Manager
##|*DESCR=Allow access to the 'System: User Manager' page.
##|*MATCH=system_usermanager.php*
##|-PRIV
require "certs.inc";
require "guiconfig.inc";
// start admin user code
$pgtitle = array(gettext("System"), gettext("User Manager"), gettext("Users"));
if (isset($_POST['userid']) && is_numericint($_POST['userid'])) {
    $id = $_POST['userid'];
}
if (isset($_GET['userid']) && is_numericint($_GET['userid'])) {
    $id = $_GET['userid'];
}
if (!isset($config['system']['user']) || !is_array($config['system']['user'])) {
    $config['system']['user'] = array();
}
$a_user =& $config['system']['user'];
$act = $_GET['act'];
if (isset($_SERVER['HTTP_REFERER'])) {
    $referer = $_SERVER['HTTP_REFERER'];
} else {
    $referer = '/system_usermanager.php';
}
if (isset($id) && $a_user[$id]) {
    $pconfig['usernamefld'] = $a_user[$id]['name'];
    $pconfig['descr'] = $a_user[$id]['descr'];
开发者ID:sjourdois,项目名称:pfsense,代码行数:31,代码来源:system_usermanager.php


示例12: gettext

 if ($_POST['destination_subnet'] && !is_numericint($_POST['destination_subnet'])) {
     $input_errors[] = gettext("A valid destination bit count must be specified.");
 }
 if ($_POST['destination_type'] == "any") {
     if ($_POST['destination_not']) {
         $input_errors[] = gettext("Negating destination address of \"any\" is invalid.");
     }
 }
 if ($_POST['target'] && !is_ipaddr($_POST['target']) && !is_subnet($_POST['target']) && !is_alias($_POST['target']) && !isset($_POST['nonat']) && !($_POST['target'] == "other-subnet")) {
     $input_errors[] = gettext("A valid target IP address must be specified.");
 }
 if ($_POST['target'] == "other-subnet") {
     if (!is_ipaddr($_POST['targetip'])) {
         $input_errors[] = gettext("A valid target IP must be specified when using the 'Other Subnet' type.");
     }
     if (!is_numericint($_POST['targetip_subnet'])) {
         $input_errors[] = gettext("A valid target bit count must be specified when using the 'Other Subnet' type.");
     }
 }
 /* Verify Pool Options */
 $poolopts = "";
 if ($_POST['poolopts']) {
     if (is_subnet($_POST['target']) || $_POST['target'] == "other-subnet") {
         $poolopts = $_POST['poolopts'];
     } elseif (is_alias($_POST['target'])) {
         if (substr($_POST['poolopts'], 0, 11) == "round-robin") {
             $poolopts = $_POST['poolopts'];
         } else {
             $input_errors[] = gettext("Only Round Robin pool options may be chosen when selecting an alias.");
         }
     }
开发者ID:curtiszimmerman,项目名称:pfsense,代码行数:31,代码来源:firewall_nat_out_edit.php


示例13: gettext

 if ($_POST['localip'] && !is_ipaddr($_POST['localip'])) {
     $input_errors[] = gettext("A valid server address must be specified.");
 }
 if ($_POST['remoteip'] && !is_ipaddr($_POST['remoteip'])) {
     $input_errors[] = gettext("A valid remote start address must be specified.");
 }
 if ($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver'])) {
     $input_errors[] = gettext("A valid RADIUS server address must be specified.");
 }
 if (!is_numericint($_POST['n_pppoe_units']) || $_POST['n_pppoe_units'] > 255) {
     $input_errors[] = gettext("Number of PPPoE users must be between 1 and 255");
 }
 if (!is_numericint($_POST['n_pppoe_maxlogin']) || $_POST['n_pppoe_maxlogin'] > 255) {
     $input_errors[] = gettext("User Max Logins must be between 1 and 255");
 }
 if (!is_numericint($_POST['pppoe_subnet']) || $_POST['pppoe_subnet'] > 32) {
     $input_errors[] = gettext("Subnet mask must be an interger between 0 and 32");
 }
 $_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['pppoe_subnet']);
 if (is_inrange_v4($_POST['localip'], $_POST['remoteip'], ip_after($_POST['remoteip'], $_POST['pppoe_subnet'] - 1))) {
     $input_errors[] = gettext("The specified server address lies in the remote subnet.");
 }
 if ($_POST['localip'] == get_interface_ip($_POST['interface'])) {
     $input_errors[] = gettext("The specified server address is equal to an interface ip address.");
 }
 for ($x = 0; $x < 4999; $x++) {
     if ($_POST["username{$x}"]) {
         if (empty($_POST["password{$x}"])) {
             $input_errors[] = sprintf(gettext("No password specified for username %s"), $_POST["username{$x}"]);
         }
         if ($_POST["ip{$x}"] != "" && !is_ipaddr($_POST["ip{$x}"])) {
开发者ID:LFCavalcanti,项目名称:pfsense,代码行数:31,代码来源:services_pppoe_edit.php


示例14: list

if (is_numericint($_GET['id'])) {
    $id = $_GET['id'];
}
if (isset($_POST['id']) && is_numericint($_POST['id'])) {
    $id = $_POST['id'];
}
if (isset($_GET['dup']) && is_numericint($_GET['dup'])) {
    $id = $_GET['dup'];
}
if (isset($id) && $a_routes[$id]) {
    list($pconfig['network'], $pconfig['network_subnet']) = explode('/', $a_routes[$id]['network']);
    $pconfig['gateway'] = $a_routes[$id]['gateway'];
    $pconfig['descr'] = $a_routes[$id]['descr'];
    $pconfig['disabled'] = isset($a_routes[$id]['disabled']);
}
if (isset($_GET['dup']) && is_numericint($_GET['dup'])) {
    unset($id);
}
if ($_POST) {
    global $aliastable;
    unset($input_errors);
    $pconfig = $_POST;
    /* input validation */
    $reqdfields = explode(" ", "network network_subnet gateway");
    $reqdfieldsn = explode(",", gettext("Destination network") . "," . gettext("Destination network bit count") . "," . gettext("Gateway"));
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
    if ($_POST['network'] && !is_ipaddr($_POST['network']) && !is_alias($_POST['network'])) {
        $input_errors[] = gettext("A valid IPv4 or IPv6 destination network must be specified.");
    }
    if ($_POST['network_subnet'] && !is_numeric($_POST['network_subnet'])) {
        $input_errors[] = gettext("A valid destination network bit count must be specified.");
开发者ID:jefersonJim,项目名称:pfsense,代码行数:31,代码来源:system_routes_edit.php


示例15: gettext

 if (is_ipaddr_configured($_POST['localip'])) {
     $input_errors[] = gettext("'Server address' parameter should NOT be set to any IP address currently in use on this firewall.");
 }
 if ($_POST['l2tp_subnet'] && !is_ipaddr($_POST['remoteip'])) {
     $input_errors[] = gettext("A valid remote start address must be specified.");
 }
 if ($_POST['radiusserver'] && !is_ipaddr($_POST['radiusserver'])) {
     $input_errors[] = gettext("A valid RADIUS server address must be specified.");
 }
 if ($_POST['secret'] != $_POST['secret_confirm']) {
     $input_errors[] = gettext("Secret and confirmation must match");
 }
 if ($_POST['radiussecret'] != $_POST['radiussecret_confirm']) {
     $input_errors[] = gettext("Secret and confirmation must match");
 }
 if (!is_numericint($_POST['n_l2tp_units']) || $_POST['n_l2tp_units'] > 255) {
     $input_errors[] = gettext("Number of L2TP users must be between 1 and 255");
 }
 /* if this is an AJAX caller then handle via JSON */
 if (isAjax() && is_array($input_errors)) {
     input_errors2Ajax($input_errors);
     exit;
 }
 if (!$input_errors) {
     $_POST['remoteip'] = $pconfig['remoteip'] = gen_subnet($_POST['remoteip'], $_POST['l2tp_subnet']);
     $subnet_start = ip2ulong($_POST['remoteip']);
     $subnet_end = ip2ulong($_POST['remoteip']) + $_POST['n_l2tp_units'] - 1;
     if (ip2ulong($_POST['localip']) >= $subnet_start && ip2ulong($_POST['localip']) <= $subnet_end) {
         $input_errors[] = gettext("The specified server address lies in the remote subnet.");
     }
     if ($_POST['localip'] == get_interface_ip("lan")) {
开发者ID:z0x010,项目名称:pfsense,代码行数:31,代码来源:vpn_l2tp.php


示例16: header

     header("Location: /suricata/suricata_barnyard.php");
     exit;
 }
 // Check that at least one output plugin is enabled
 if ($_POST['barnyard_mysql_enable'] != 'on' && $_POST['barnyard_syslog_enable'] != 'on' && $_POST['barnyard_bro_ids_enable'] != 'on' && $_POST['barnyard_enable'] == "on") {
     $input_errors[] = gettext("You must enable at least one output option when using Barnyard2.");
 }
 // Validate Sensor Name contains no spaces
 if ($_POST['barnyard_enable'] == 'on') {
     if (!empty($_POST['barnyard_sensor_name']) && strpos($_POST['barnyard_sensor_name'], " ") !== FALSE) {
         $input_errors[] = gettext("The value for 'Sensor Name' cannot contain spaces.");
     }
 }
 // Validate Sensor ID is a valid integer
 if ($_POST['barnyard_enable'] == 'on') {
     if (!is_numericint($_POST['barnyard_sensor_id']) || $_POST['barnyard_sensor_id'] < 0) {
         $input_errors[] = gettext("The value for 'Sensor ID' must be a valid positive integer.");
     }
 }
 if (empty($_POST['barnyard_xff_header']) && $_POST['barnyard_xff_logging'] == "on") {
     $input_errors[] = gettext("The value for the X-Forwarded-For Header cannot be blank when X-Forwarded-For logging is enabled.");
 }
 // Validate inputs if MySQL database loggging enabled
 if ($_POST['barnyard_mysql_enable'] == 'on' && $_POST['barnyard_enable'] == "on") {
     if (empty($_POST['barnyard_dbhost'])) {
         $input_errors[] = gettext("Please provide a valid hostname or IP address for the MySQL database host.");
     }
     if (empty($_POST['barnyard_dbname'])) {
         $input_errors[] = gettext("You must provide a DB instance name when logging to a MySQL database.");
     }
     if (empty($_POST['barnyard_dbuser'])) {
开发者ID:LFCavalcanti,项目名称:pfsense-packages,代码行数:31,代码来源:suricata_barnyard.php


示例17: gettext

         $input_errors[] = gettext("A valid PPPoE reset day of month must be specified (1-31) in the Custom PPPoE Periodic reset fields. No checks are done on valid # of days per month");
     }
     if ($date_nums[2] < date("Y")) {
         $input_errors[] = gettext("A valid PPPoE reset year must be specified. Don't select a year in the past!");
     }
 }
 $port_data = array();
 if (is_array($_POST['interfaces'])) {
     foreach ($_POST['interfaces'] as $iface) {
         if ($_POST['localip'][$iface] && !is_ipaddr($_POST['localip'][$iface])) {
             $input_errors[] = sprintf(gettext("A valid local IP address must be specified for %s."), $iface);
         }
         if ($_POST['gateway'][$iface] && !is_ipaddr($_POST['gateway'][$iface]) && !is_hostname($_POST['gateway'][$iface])) {
             $input_errors[] = sprintf(gettext("A valid gateway IP address OR hostname must be specified for %s."), $iface);
         }
         if ($_POST['bandwidth'][$iface] && !is_numericint($_POST['bandwidth'][$iface])) {
             $input_errors[] = sprintf(gettext("The bandwidth value for %s must be an integer."), $iface);
         }
         if ($_POST['mtu'][$iface] && $_POST['mtu'][$iface] < 576) {
             $input_errors[] = sprintf(gettext("The MTU for %s must be greater than 576 bytes."), $iface);
         }
         if ($_POST['mru'][$iface] && $_POST['mru'][$iface] < 576) {
             $input_errors[] = sprintf(gettext("The MRU for %s must be greater than 576 bytes."), $iface);
         }
     }
     // Loop through fields associated with an individual link/port and make an array of the data
     $port_fields = array("localip", "gateway", "subnet", "bandwidth", "mtu", "mru", "mrru");
     foreach ($_POST['interfaces'] as $iface) {
         foreach ($port_fields as $field_label) {
             if (isset($_POST[$field_label . $iface]) && strlen($_POST[$field_label . $iface]) > 0) {
                 $port_data[$field_label][] = $_POST[$field_label . $iface];
开发者ID:LFCavalcanti,项目名称:pfsense,代码行数:31,代码来源:interfaces_ppps_edit.php


示例18: is_posnumericint

function is_posnumericint($arg)
{
    // Integer > 0? (Note that to be safe we do not allow any leading zero - "01", "007")
    return is_numericint($arg) && $arg[0] != '0';
}
开发者ID:NewEraCracker,项目名称:pfsense,代码行数:5,代码来源:firewall_rules_edit.php


示例19: write_config

            $a_config["shown"]["item"][] = $ifname;
        }
    }
    write_config(gettext("Updated traffic graph settings via dashboard."));
    header("Location: /");
    exit(0);
}
$shown = array();
foreach ($a_config["shown"]["item"] as $if) {
    $shown[$if] = true;
}
if ($first_time) {
    $keys = array_keys($ifdescrs);
    $shown[$keys[0]] = true;
}
if (isset($a_config["refreshinterval"]) && is_numericint($a_config["refreshinterval"])) {
    $refreshinterval = $a_config["refreshinterval"];
} else {
    $refreshinterval = 10;
}
if (isset($a_config["scale_type"])) {
    $scale_type = $a_config["scale_type"];
} else {
    $scale_type = "up";
}
$graphcounter = 0;
foreach ($ifdescrs as $ifname => $ifdescr) {
    $ifinfo = get_interface_info($ifname);
    if ($shown[$ifname]) {
        $mingraphbutton = "inline";
        $showgraphbutton = "none";
开发者ID:LFCavalcanti,项目名称:pfsense,代码行数:31,代码来源:traffic_graphs.widget.php


示例20: isset

$pconfig['compression'] = isset($config['ipsec']['compression']);
$pconfig['enableinterfacesuse'] = isset($config['ipsec']['enableinterfacesuse']);
$pconfig['acceptunencryptedmainmode'] = isset($config['ipsec']['acceptunencryptedmainmode']);
$pconfig['maxmss_enable'] = isset($config['system']['maxmss_enable']);
$pconfig['maxmss'] = $config['system']['maxmss'];
$pconfig['uniqueids'] = $config['ipsec']['uniqueids'];
if ($_POST) {
    unset($input_errors);
    $pconfig = $_POST;
    foreach ($ipsec_log_cats as $cat => $desc) {
        if (!in_array(intval($pconfig[$cat]), array_keys($ipsec_log_sevs), true)) {
            $input_errors[] = "A valid value must be specified for {$desc} debug.";
        }
    }
    if (isset($pconfig['maxmss'])) {
        if (!is_numericint($pconfig['maxmss']) && $pconfig['maxmss'] != '') {
            $input_errors[] = "An integer must be specified for Maximum MSS.";
        }
        if ($pconfig['maxmss'] != '' && $pconfig['maxmss'] < 576 || $pconfig['maxmss'] > 65535) {
            $input_errors[] = "An integer between 576 and 65535 must be specified for Maximum MSS";
        }
    }
    if (!$input_errors) {
        /* log levels aren't set initially and use default. They all
         * get set when we save, even if it's to the default level.
         */
        foreach (array_keys($ipsec_log_cats) as $cat) {
            if (!isset($pconfig[$cat])) {
                continue;
            }
            if ($pconfig[$cat] != $config['ipsec']['logging'][$cat]) {
开发者ID:michaeleino,项目名称:pfsense,代码行数:31,代码来源:vpn_ipsec_settings.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_nxt_error函数代码示例发布时间:2022-05-15
下一篇:
PHP is_numeric函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap