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

PHP is_validaliasname函数代码示例

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

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



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

示例1: isset

    $pconfig['url'] = $a_checkip[$id]['url'];
    $pconfig['username'] = $a_checkip[$id]['username'];
    $pconfig['password'] = $a_checkip[$id]['password'];
    $pconfig['verifysslpeer'] = isset($a_checkip[$id]['verifysslpeer']);
    $pconfig['descr'] = $a_checkip[$id]['descr'];
}
if ($_POST) {
    unset($input_errors);
    $pconfig = $_POST;
    /* input validation */
    $reqdfields = array();
    $reqdfieldsn = array();
    $reqdfields = array_merge($reqdfields, explode(" ", "name url"));
    $reqdfieldsn = array_merge($reqdfieldsn, array(gettext("Name"), gettext("URL")));
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
    if ($_POST['name'] && !is_validaliasname($_POST['name'])) {
        $input_errors[] = gettext("The Check IP Service name contains invalid characters.");
    }
    if ($_POST['url'] && !is_URL($_POST['url'])) {
        $input_errors[] = gettext("The Check IP Service URL is not valid.");
    }
    if ($_POST['passwordfld'] != $_POST['passwordfld_confirm']) {
        $input_errors[] = gettext("Password and confirmed password must match.");
    }
    if (!$input_errors) {
        $checkip = array();
        $checkip['enable'] = $_POST['enable'] ? true : false;
        $checkip['name'] = $_POST['name'];
        $checkip['url'] = $_POST['url'];
        $checkip['username'] = $_POST['username'];
        if ($_POST['passwordfld'] != DMYPWD) {
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:31,代码来源:services_checkip_edit.php


示例2: unset

}
if ($_POST) {
    unset($input_errors);
    $vertical_bar_err_text = gettext("Vertical bars (|) at start or end, or double in the middle of descriptions not allowed. Descriptions have been cleaned. Check and save again.");
    /* input validation */
    $reqdfields = explode(" ", "name");
    $reqdfieldsn = array(gettext("Name"));
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
    $x = is_validaliasname($_POST['name']);
    if (!isset($x)) {
        $input_errors[] = gettext("Reserved word used for alias name.");
    } else {
        if ($_POST['type'] == "port" && (getservbyname($_POST['name'], "tcp") || getservbyname($_POST['name'], "udp"))) {
            $input_errors[] = gettext("Reserved word used for alias name.");
        } else {
            if (is_validaliasname($_POST['name']) == false) {
                $input_errors[] = gettext("The alias name must be less than 32 characters long, may not consist of only numbers, and may only contain the following characters") . " a-z, A-Z, 0-9, _.";
            }
        }
    }
    /* check for name conflicts */
    foreach ($a_aliases as $key => $alias) {
        if ($alias['name'] == $_POST['name'] && (empty($a_aliases[$id]) || $key != $id)) {
            $input_errors[] = gettext("An alias with this name already exists.");
            break;
        }
    }
    /* Check for reserved keyword names */
    foreach ($reserved_keywords as $rk) {
        if ($rk == $_POST['name']) {
            $input_errors[] = sprintf(gettext("Cannot use a reserved keyword as alias name %s"), $rk);
开发者ID:jefersonJim,项目名称:pfsense,代码行数:31,代码来源:firewall_aliases_edit.php


示例3: array

        $pconfig['item'] = array();
    }
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $pconfig = $_POST;
    if (isset($_POST['id']) && isset($a_gateway_groups[$_POST['id']])) {
        $id = $_POST['id'];
    }
    $input_errors = array();
    /* input validation */
    $reqdfields = explode(" ", "name");
    $reqdfieldsn = explode(",", "Name");
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
    if (empty($pconfig['name'])) {
        $input_errors[] = gettext("A valid gateway group name must be specified.");
    }
    if (!is_validaliasname($pconfig['name'])) {
        $input_errors[] = gettext("The gateway name must not contain invalid characters.");
    }
    if (!empty($pconfig['name'])) {
        /* check for overlaps */
        if (is_array($a_gateway_groups)) {
            foreach ($a_gateway_groups as $gateway_group) {
                if (isset($id) && $a_gateway_groups[$id] && $a_gateway_groups[$id] === $gateway_group) {
                    if ($gateway_group['name'] != $pconfig['name']) {
                        $input_errors[] = gettext("Changing name on a gateway group is not allowed.");
                    }
                    continue;
                }
                if ($gateway_group['name'] == $pconfig['name']) {
                    $input_errors[] = sprintf(gettext('A gateway group with this name "%s" already exists.'), $pconfig['name']);
                    break;
开发者ID:noikiy,项目名称:core-2,代码行数:31,代码来源:system_gateway_groups_edit.php


示例4: get_configured_interface_list

 }
 $reserved_ifs = get_configured_interface_list(false, true);
 $reserved_keywords = array_merge($reserved_keywords, $reserved_ifs, $reserved_table_names);
 foreach ($reserved_keywords as $rk) {
     if ($rk == $pconfig['name']) {
         $input_errors[] = sprintf(gettext("Cannot use a reserved keyword as alias name %s"), $rk);
     }
 }
 /* check for name interface description conflicts */
 foreach ($config['interfaces'] as $interface) {
     if ($interface['descr'] == $pconfig['name']) {
         $input_errors[] = gettext("An interface description with this name already exists.");
         break;
     }
 }
 if (is_validaliasname($pconfig['name']) !== true) {
     $input_errors[] = gettext("The alias name must be less than 32 characters long and may only consist of the characters") . " a-z, A-Z, 0-9, _.";
 }
 if (!empty($pconfig['updatefreq']) && !is_numericint($pconfig['updatefreq'])) {
     $input_errors[] = gettext("Update Frequency should be a number");
 }
 /* check for name conflicts */
 if (empty($a_aliases[$id])) {
     foreach ($a_aliases as $alias) {
         if ($alias['name'] == $_POST['name']) {
             $input_errors[] = gettext("An alias with this name already exists.");
             break;
         }
     }
 }
 /* user may not change type */
开发者ID:oparoz,项目名称:core-1,代码行数:31,代码来源:firewall_aliases_edit.php


示例5: array

}
if (!isset($config['aliases']['alias'])) {
    $config['aliases']['alias'] = array();
}
if ($_SERVER['REQUEST_METHOD'] === 'GET') {
    // initialize form vars
    $pconfig = array("name" => null, "descr" => null, "aliasimport" => null);
} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
    // save form data
    $input_errors = array();
    $pconfig = $_POST;
    // input validation
    $reqdfields = explode(" ", "name aliasimport");
    $reqdfieldsn = array(gettext("Name"), gettext("Aliases"));
    do_input_validation($pconfig, $reqdfields, $reqdfieldsn, $input_errors);
    if (is_validaliasname($pconfig['name']) == false) {
        $input_errors[] = gettext("The alias name may only consist of the characters") . " a-z, A-Z, 0-9, _.";
    }
    /* check for name duplicates */
    if (is_alias($pconfig['name'])) {
        $input_errors[] = gettext("An alias with this name already exists.");
    }
    // Add all Load balance names to reserved_keywords
    if (isset($config['load_balancer']['lbpool'])) {
        foreach ($config['load_balancer']['lbpool'] as $lbpool) {
            $reserved_keywords[] = $lbpool['name'];
        }
    }
    // Keywords not allowed in names
    $reserved_keywords = array("all", "pass", "block", "out", "queue", "max", "min", "pptp", "pppoe", "L2TP", "OpenVPN", "IPsec");
    $reserved_ifs = get_configured_interface_list(false, true);
开发者ID:alisamar,项目名称:core,代码行数:31,代码来源:firewall_aliases_import.php


示例6: elseif

} elseif ($_SERVER['REQUEST_METHOD'] === 'POST') {
    if (isset($_POST['id']) && isset($a_schedules[$_POST['id']])) {
        $id = $_POST['id'];
    }
    $pconfig = $_POST;
    // validate
    if (strtolower($pconfig['name']) == "lan") {
        $input_errors[] = gettext("Schedule may not be named LAN.");
    }
    if (strtolower($pconfig['name']) == "wan") {
        $input_errors[] = gettext("Schedule may not be named WAN.");
    }
    if (strtolower($pconfig['name']) == "") {
        $input_errors[] = gettext("Schedule name cannot be blank.");
    }
    $x = is_validaliasname($pconfig['name']);
    if (!isset($x)) {
        $input_errors[] = gettext("Reserved word used for schedule name.");
    } elseif ($x == false) {
        $input_errors[] = gettext("The schedule name may only consist of the characters a-z, A-Z, 0-9");
    }
    /* check for name conflicts */
    foreach ($a_schedules as $schedId => $schedule) {
        if ($schedId != $id && $schedule['name'] == $pconfig['name']) {
            $input_errors[] = gettext("A Schedule with this name already exists.");
            break;
        }
    }
    // parse time ranges
    $pconfig['timerange'] = array();
    $timerangeFound = false;
开发者ID:nasaa0528,项目名称:core,代码行数:31,代码来源:firewall_schedule_edit.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP is_viewing函数代码示例发布时间:2022-05-15
下一篇:
PHP is_valid_user_name函数代码示例发布时间: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