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


PHP Result::validate_email方法代码示例

本文整理汇总了PHP中Result::validate_email方法的典型用法代码示例。如果您正苦于以下问题:PHP Result::validate_email方法的具体用法?PHP Result::validate_email怎么用?PHP Result::validate_email使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Result的用法示例。


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

示例1: exist

    //checks
    if ($_POST['password1'] != $_POST['password2']) {
        $Result->show("danger", _("Passwords do not match"), true);
    }
    if (strlen($_POST['password1']) < 8) {
        $Result->show("danger", _("Password must be at least 8 characters long!"), true);
    }
    //hash passowrd
    $_POST['password1'] = $User->crypt_user_pass($_POST['password1']);
}
# general checks
if (strlen(@$_POST['real_name']) == 0) {
    $Result->show("danger", _("Real name field is mandatory!"), true);
}
# email format must be valid
if (!$Result->validate_email(@$_POST['email'])) {
    $Result->show("danger", _("Invalid email address!"), true);
}
# username must not already exist (if action is add)
if ($_POST['action'] == "add") {
    //username > 8 chars
    if ($auth_method->type == "local") {
        if (strlen($_POST['username']) < 6) {
            $Result->show("danger", _("Username must be at least 6 characters long!"), true);
        }
    } else {
        if (strlen($_POST['username']) == 0) {
            $Result->show("danger", _("Username must be at least 1 character long!"), true);
        }
    }
    //check duplicate
开发者ID:routenull0,项目名称:phpipam,代码行数:31,代码来源:edit-result.php

示例2: server

             }
         }
     } else {
         if (!filter_var($_POST['master'], FILTER_VALIDATE_IP)) {
             $Result->show("danger", "Master must be an IP address" . " - " . $_POST['master'], true);
         }
     }
 }
 // type
 if (!in_array($_POST['type'], (array) $PowerDNS->domain_types)) {
     $Result->show("danger", "Invalid domain type", true);
 }
 # new domain
 if ($_POST['action'] == "add" && !isset($_POST['manual'])) {
     // admin
     if ($Result->validate_email($_POST['hostmaster']) === false) {
         $Result->show("danger", "Invalid domain hostmaster", true);
     }
 }
 // if slave master must be present
 if ($_POST['type'] == "SLAVE") {
     if (strlen($_POST['master']) == 0) {
         $Result->show("danger", "Please set master server(s) if domain type is SLAVE", true);
     } else {
         if (strpos($_POST['master'], ",") !== false) {
             // to array and trim, check each
             $masters = array_filter(explode(",", $_POST['master']));
             foreach ($masters as $m) {
                 if (!filter_var($m, FILTER_VALIDATE_IP)) {
                     $Result->show("danger", "Master must be an IP address" . " - " . $m, true);
                 }
开发者ID:routenull0,项目名称:phpipam,代码行数:31,代码来源:domain-edit-result.php

示例3: dirname

/* functions */
require dirname(__FILE__) . '/../../functions/functions.php';
/* @mail functions ------------------- */
require dirname(__FILE__) . '/../../functions/classes/class.Mail.php';
# initialize user object
$Database = new Database_PDO();
$Subnets = new Subnets($Database);
$Tools = new Tools($Database);
$Admin = new Admin($Database, false);
$Result = new Result();
# fetch settings, user is not authenticated !
$settings = $Tools->fetch_settings();
# requests must be enabled!
if ($settings['enableIPrequests'] == 1) {
    # verify email
    if (!$Result->validate_email($_POST['requester'])) {
        $Result->show("danger", _('Please provide valid email address') . '! (' . _('requester') . ': ' . $_POST['requester'] . ')', true);
    }
    # formulate insert values
    $values = array("subnetId" => $_POST['subnetId'], "ip_addr" => @$_POST['ip_addr'], "description" => @$_POST['description'], "dns_name" => @$_POST['dns_name'], "owner" => $_POST['owner'], "requester" => $_POST['requester'], "comment" => @$_POST['comment'], "processed" => 0);
    if (!$Admin->object_modify("requests", "add", "id", $values)) {
        $Result->show("danger", _('Error submitting new IP address request'), true);
    } else {
        $Result->show("success", _('Request submitted successfully'));
        # send mail
        //if(!sendIPReqEmail($_POST))									{ $Result->show("danger",  _('Sending mail for new IP request failed'), true); }
        //else														{ $Result->show("success", _('Sending mail for IP request succeeded'), true); }
    }
} else {
    $Result->show("danger", _('IP requests disabled'), true);
}
开发者ID:Benchwork,项目名称:phpipam,代码行数:31,代码来源:request_ip_result.php


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