本文整理汇总了PHP中is_domain函数的典型用法代码示例。如果您正苦于以下问题:PHP is_domain函数的具体用法?PHP is_domain怎么用?PHP is_domain使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了is_domain函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: openvpn_validate_host
function openvpn_validate_host($value, $name)
{
$value = trim($value);
if (empty($value) || !is_domain($value) && !is_ipaddr($value)) {
return sprintf(gettext("The field '%s' must contain a valid IP address or domain name."), $name);
}
return false;
}
开发者ID:Toudix,项目名称:core,代码行数:8,代码来源:vpn_openvpn_client.php
示例2: test_server
public function test_server()
{
$server = $_SERVER;
$_SERVER['SERVER_NAME'] = 'domain.com';
$_SERVER['SERVER_PORT'] = '80';
$_SERVER['REQUEST_URI'] = '/core/test?fake';
unset($_SERVER['REDIRECT_URL']);
$this->set_prefix('is_domain');
$this->test(1, is_domain('domain.com'));
$this->test(2, is_domain('notdomain.com'));
$_SERVER['HTTPS'] = 'on';
$this->test(100, is_domain('domain.com'));
$this->test(101, is_domain('https://domain.com'));
unset($_SERVER['HTTPS']);
$this->test(3, is_domain('domain.com:80'));
$this->test(4, is_domain('domain.com:443'));
$this->test(5, is_domain('domain.com/core/test'));
$this->test(6, is_domain('domain.com/core/test/fake'));
$_SERVER['SERVER_NAME'] = 'www.domain.com';
$this->test(7, is_domain('*.domain.com'));
$this->test(8, is_domain('www?.domain.com'));
$this->test(9, is_domain('*?.domain.com'));
$_SERVER['SERVER_NAME'] = 'abc.www.domain.com';
$this->test(10, is_domain('*.domain.com'));
$this->test(11, is_domain('www?.domain.com'));
$this->test(12, is_domain('*?.domain.com'));
$this->test(19, is_domain('abc.*.domain.com'));
$this->test(20, is_domain('abc.www?.domain.com'));
$this->test(21, is_domain('*.*.domain.com'));
$this->test(22, is_domain('abc?.www?.domain.com'));
$_SERVER['SERVER_NAME'] = 'sub.domain.com';
$this->test(13, is_domain('*.domain.com'));
$this->test(14, is_domain('www?.domain.com'));
$this->test(15, is_domain('*?.domain.com'));
$_SERVER['SERVER_NAME'] = 'domain.com';
$this->test(16, is_domain('*.domain.com'));
$this->test(17, is_domain('www?.domain.com'));
$this->test(18, is_domain('*?.domain.com'));
$this->test(29, is_domain('domain.com.br?'));
$_SERVER['SERVER_NAME'] = 'domain.com.br';
$this->test(23, is_domain('domain.com'));
$this->test(24, is_domain('domain.com.br'));
$this->test(25, is_domain('domain.com.*'));
$this->test(26, is_domain('domain.com.*?'));
$this->test(27, is_domain('domain.com.br?'));
$this->test(28, is_domain('domain.com.us?'));
$_SERVER = $server;
}
开发者ID:rentalhost,项目名称:core,代码行数:48,代码来源:core.php
示例3: 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
示例4: gettext
}
if (isset($_POST['wpa_gmk_rekey']) && (!is_numericint($_POST['wpa_gmk_rekey']) || $_POST['wpa_gmk_rekey'] < 1 || $_POST['wpa_gmk_rekey'] > 9999)) {
$input_errors[] = gettext("Master Key Regeneration must be an integer between 1 and 9999.");
}
if (isset($_POST['wpa_group_rekey']) && isset($_POST['wpa_gmk_rekey'])) {
if ($_POST['wpa_group_rekey'] > $_POST['wpa_gmk_rekey']) {
$input_errors[] = gettext("Master Key Regeneration must be greater than Key Rotation.");
}
}
if (!empty($_POST['auth_server_addr'])) {
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'])) {
开发者ID:simudream,项目名称:pfsense,代码行数:31,代码来源:interfaces.php
示例5: implode
$pconfig['user_source'] = implode(",", $pconfig['user_source']);
}
/* input validation */
$reqdfields = explode(" ", "user_source group_source");
$reqdfieldsn = array(gettext("User Authentication Source"), gettext("Group Authentication Source"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if (!empty($pconfig['pool_address']) && !is_ipaddr($pconfig['pool_address'])) {
$input_errors[] = gettext("A valid IP address for 'Virtual Address Pool Network' must be specified.");
}
if (!empty($pconfig['dns_domain']) && !is_domain($pconfig['dns_domain'])) {
$input_errors[] = gettext("A valid value for 'DNS Default Domain' must be specified.");
}
if (!empty($pconfig['dns_split'])) {
$domain_array = preg_split("/[ ,]+/", $pconfig['dns_split']);
foreach ($domain_array as $curdomain) {
if (!is_domain($curdomain)) {
$input_errors[] = gettext("A valid split DNS domain list must be specified.");
break;
}
}
}
if (!empty($pconfig['dns_server1']) && !is_ipaddr($pconfig['dns_server1'])) {
$input_errors[] = gettext("A valid IP address for 'DNS Server #1' must be specified.");
}
if (!empty($pconfig['dns_server2']) && !is_ipaddr($pconfig['dns_server2'])) {
$input_errors[] = gettext("A valid IP address for 'DNS Server #2' must be specified.");
}
if (!empty($pconfig['dns_server3']) && !is_ipaddr($pconfig['dns_server3'])) {
$input_errors[] = gettext("A valid IP address for 'DNS Server #3' must be specified.");
}
if (!empty($pconfig['dns_server4']) && !is_ipaddr($pconfig['dns_server4'])) {
开发者ID:nasaa0528,项目名称:core,代码行数:31,代码来源:vpn_ipsec_mobile.php
示例6: unset
$pconfig['host'] = $a_hosts[$id]['host'];
$pconfig['domain'] = $a_hosts[$id]['domain'];
$pconfig['ip'] = $a_hosts[$id]['ip'];
$pconfig['descr'] = $a_hosts[$id]['descr'];
}
if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
/* input validation */
$reqdfields = explode(" ", "domain ip");
$reqdfieldsn = array(gettext("Domain"), gettext("IP address"));
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors);
if ($_POST['host'] && !is_hostname($_POST['host'])) {
$input_errors[] = gettext("The hostname can only contain the characters A-Z, 0-9 and '-'.");
}
if ($_POST['domain'] && !is_domain($_POST['domain'])) {
$input_errors[] = gettext("A valid domain must be specified.");
}
if ($_POST['ip'] && !is_ipaddr($_POST['ip'])) {
$input_errors[] = gettext("A valid IP address must be specified.");
}
/* check for overlaps */
foreach ($a_hosts as $hostent) {
if (isset($id) && $a_hosts[$id] && $a_hosts[$id] === $hostent) {
continue;
}
if ($hostent['host'] == $_POST['host'] && $hostent['domain'] == $_POST['domain'] && (is_ipaddrv4($hostent['ip']) && is_ipaddrv4($_POST['ip']) || is_ipaddrv6($hostent['ip']) && is_ipaddrv6($_POST['ip']))) {
$input_errors[] = gettext("This host/domain already exists.");
break;
}
}
开发者ID:rdmenezes,项目名称:pfsense,代码行数:31,代码来源:services_dnsmasq_edit.php
示例7: strtolower
}
/* normalize MAC addresses - lowercase and convert Windows-ized hyphenated MACs to colon delimited */
$_POST['spoofmac'] = strtolower(str_replace("-", ":", $_POST['spoofmac']));
if ($_POST['ipaddr'] && !is_ipaddr($_POST['ipaddr'])) {
$input_errors[] = "Geçerli bir IP adresi tanımlanmalıdır.";
}
if ($_POST['subnet'] && !is_numeric($_POST['subnet'])) {
$input_errors[] = "Geçerli bir subnet bit count tanımlanmalıdır.";
}
if ($_POST['gateway'] && !is_ipaddr($_POST['gateway'])) {
$input_errors[] = "Geçerli bir ağ geçidi tanımlanmalıdır.";
}
if ($_POST['pointtopoint'] && !is_ipaddr($_POST['pointtopoint'])) {
$input_errors[] = "Geçerli bir point-to-point IP adresi tanımlanmalıdır.";
}
if ($_POST['provider'] && !is_domain($_POST['provider'])) {
$input_errors[] = "Servis adı geçersiz karakterler içeriyor.";
}
if ($_POST['pppoe_idletimeout'] != "" && !is_numericint($_POST['pppoe_idletimeout'])) {
$input_errors[] = "idle timeout değeri bir tamsayı olmak zorundadır.";
}
if ($_POST['pppoe_resethour'] != "" && !is_numericint($_POST['pppoe_resethour']) && $_POST['pppoe_resethour'] >= 0 && $_POST['pppoe_resethour'] <= 23) {
$input_errors[] = gettext("PPPoE yeniden başlatma saati (0-23) arasında olmalıdır.");
}
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'])) {
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:interfaces.php
示例8: explode
}
}
if ($_POST['p1myidentt'] == "address" && !is_ipaddr($_POST['p1myident'])) {
$input_errors[] = "Tanımlayıcıya ait geçerli bir IP adresi tanımlanmalıdır.";
}
if ($_POST['p1myidentt'] == "fqdn" && !is_domain($_POST['p1myident'])) {
$input_errors[] = "Tanımlayıcıda geçerli bir alan adı olmalıdır.";
}
if ($_POST['p1myidentt'] == "user_fqdn") {
$ufqdn = explode("@", $_POST['p1myident']);
if (is_domain($ufqdn[1]) == false) {
$input_errors[] = "A valid User FQDN in the form of [email protected] for 'My identifier' must be specified.";
}
}
if ($_POST['p1myidentt'] == "dyn_dns") {
if (is_domain($_POST['p1myidentt']) == false) {
$input_errors[] = "A valid Dynamic DNS address for 'My identifier' must be specified.";
}
}
if ($_POST['p1myidentt'] == "fqdn" and $_POST['p1myident'] == "") {
$input_errors[] = gettext("Tanımlayıcıya geçerli bir alan adı yazınız.");
}
if ($_POST['p1myidentt'] == "dyn_dns" and $_POST['p1myident'] == "") {
$input_errors[] = gettext("Tanımlayıcıya geçerli bir alan adı yazınız.");
}
if ($_POST['p1myidentt'] == "address" and $_POST['p1myident'] == "") {
$input_errors[] = gettext("Tanımlayıcıya geçerli bir alan adı yazınız.");
}
if ($_POST['p1myidentt'] == "user_fqdn" and $_POST['p1myident'] == "") {
$input_errors[] = gettext("Tanımlayıcıya geçerli bir alan adı yazınız.");
}
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:vpn_ipsec_edit.php
示例9: update_whois
function update_whois($client_id = 0, $second_level_domain = '')
{
$result = '';
if (!empty($client_id) && !empty($second_level_domain)) {
$CI =& get_instance();
$CI->load->model('model_site_whois');
if (is_domain($second_level_domain) && (empty($stat_date) || (mktime() - $stat_date) / (24 * 60 * 60) > get_app_var('DEFAULT_WHOIS_UPDATE_DAYS'))) {
$whois_api = get_app_var('WHOIS_API');
$whois_username = get_app_var('WHOIS_USERNAME');
$whois_password = get_app_var('WHOIS_PASSWORD');
$tries = 0;
$contents = '';
while ($tries < 3 && !$contents) {
$contents = @file_get_contents($whois_api . '?domainName=' . $second_level_domain . '&username=' . $whois_username . '&password=' . $whois_password . '&outputFormat=JSON');
if ($contents) {
$whois = json_decode($contents, true);
if (isset($whois['WhoisRecord']) && !empty($whois['WhoisRecord'])) {
// Pick up all sites for this client with this second level domain
$sites = $this->get_records(array('client_id' => $client_id, 'second_level_domain' => $second_level_domain));
if (!empty($sites)) {
foreach ($sites as $site) {
$site_whois = array();
$site_whois['site_id'] = $site['site_id'];
$site_whois['client_id'] = $client_id;
$site_whois['stat_date'] = mktime();
$CI->model_site_whois->delete($site_whois);
if (isset($whois['WhoisRecord']['registrarName'])) {
$site_whois['registrar'] = trim($whois['WhoisRecord']['registrarName']);
}
if (isset($whois['WhoisRecord']['registryData']['expiresDate'])) {
if (!empty($whois['WhoisRecord']['registryData']['expiresDate'])) {
$site_whois['expiry_date'] = date('d/m/Y', strtotime($whois['WhoisRecord']['registryData']['expiresDate']));
}
}
if (isset($whois['WhoisRecord']['registrant']['name'])) {
$site_whois['registrant_name'] = $whois['WhoisRecord']['registrant']['name'];
} elseif (isset($whois['WhoisRecord']['registryData']['registrant']['name'])) {
$site_whois['registrant_name'] = $whois['WhoisRecord']['registryData']['registrant']['name'];
}
if (isset($whois['WhoisRecord']['registrant']['email'])) {
$site_whois['registrant_email'] = $whois['WhoisRecord']['registrant']['email'];
} elseif (isset($whois['WhoisRecord']['registryData']['registrant']['email'])) {
$site_whois['registrant_email'] = $whois['WhoisRecord']['registryData']['registrant']['email'];
}
if (isset($whois['WhoisRecord']['registryData']['nameServers']['hostNames'])) {
$site_whois['name_servers'] = implode(', ', $whois['WhoisRecord']['registryData']['nameServers']['hostNames']);
}
if (isset($whois['WhoisRecord']['domainNameExt'])) {
$site_whois['tld'] = $whois['WhoisRecord']['domainNameExt'];
}
$CI->model_site_whois->save($site_whois);
}
}
} elseif (isset($whois['ErrorMessage'])) {
$result = $whois['ErrorMessage']['msg'];
break;
}
}
$tries++;
}
}
}
return $result;
}
开发者ID:GordonTees,项目名称:masterdash,代码行数:64,代码来源:model_sites.php
示例10:
$input_errors[] = "Hostname geçersiz karakterler içeriyor.";
}
}
if ($_POST['mx'] && !is_domain($_POST['mx'])) {
$input_errors[] = "MX geçersiz karakterler içeriyor.";
}
if ($_POST['username'] && !is_dyndns_username($_POST['username'])) {
$input_errors[] = "Kullanıcı adı geçersiz karakterler içeriyor.";
}
if ($_POST['dnsupdate_host'] && !is_domain($_POST['dnsupdate_host'])) {
$input_errors[] = "DNS güncelleme hostname geçersiz karakterler içeriyor.";
}
if ($_POST['dnsupdate_ttl'] && !is_numericint($_POST['dnsupdate_ttl'])) {
$input_errors[] = "DNS güncelleme TTL değeri tam sayı olmak zorundadır.";
}
if ($_POST['dnsupdate_keyname'] && !is_domain($_POST['dnsupdate_keyname'])) {
$input_errors[] = "DNS güncelleme anahtar adı geçersiz karakterler içeriyor.";
}
if (!$input_errors) {
$config['dyndns']['type'] = $_POST['type'];
$config['dyndns']['username'] = $_POST['username'];
$config['dyndns']['password'] = $_POST['password'];
$config['dyndns']['host'] = $_POST['host'];
$config['dyndns']['mx'] = $_POST['mx'];
$config['dyndns']['wildcard'] = $_POST['wildcard'] ? true : false;
$config['dyndns']['enable'] = $_POST['enable'] ? true : false;
$config['dnsupdate']['enable'] = $_POST['dnsupdate_enable'] ? true : false;
$config['dnsupdate']['host'] = $_POST['dnsupdate_host'];
$config['dnsupdate']['server'] = $_POST['dnsupdate_server'];
$config['dnsupdate']['ttl'] = $_POST['dnsupdate_ttl'];
$config['dnsupdate']['keyname'] = $_POST['dnsupdate_keyname'];
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:services_dyndns.php
示例11: error_reporting
<?php
error_reporting(0);
define('IN_SEO', TRUE);
set_time_limit(0);
isset($_SERVER['HTTP_REFERER']) or exit('Invalid Request');
preg_match("/" . $_SERVER['HTTP_HOST'] . "/i", $_SERVER['HTTP_REFERER']) or exit('Access Denied');
header("Content-Type:text/html;charset=gb2312");
include '../robot.php';
require 'function.php';
@extract($_POST);
$domain = $domain ? $domain : '34ways.com';
$domain = strtolower($domain);
is_domain($domain) or exit;
$result = '';
if ($che) {
$result = get_seo_info($domain, $che);
}
if ($domain) {
@(require_once '../cache.php');
if (file_exists("../cache/ssyqsl.php")) {
@(require_once "../cache/ssyqsl.php");
$urls = filehave($urls, $domain);
} else {
$urls = fileno($domain);
}
writeover("../cache/ssyqsl.php", "<?php\r\n\$urls=" . vvar_export($urls) . ";\r\n?>");
}
echo $result;
开发者ID:repodevs,项目名称:web_admin_tools,代码行数:29,代码来源:seo.php
示例12: whois
function whois($host)
{
if (filter_var($host, FILTER_VALIDATE_IP) || filter_var(gethostbyname($host), FILTER_VALIDATE_IP) || is_domain($host)) {
run_shell_cmd('timeout 30 /usr/bin/whois %s', $host . ' ' . $server);
} else {
error(4);
}
}
开发者ID:HuangJi,项目名称:SITCON-TelegramBot,代码行数:8,代码来源:hook.php
示例13: explode
}
if ($_POST['p1lifetime'] && !is_numeric($_POST['p1lifetime'])) {
$input_errors[] = "P1 yaşam zamanı sayılabilir bir sayısal değer olmalıdır.";
}
if ($_POST['p2lifetime'] && !is_numeric($_POST['p2lifetime'])) {
$input_errors[] = "P2 yaşam zamanı sayılabilir bir değer olmalıdır.";
}
if ($_POST['p1myidentt'] == "address" && !is_ipaddr($_POST['p1myident'])) {
$input_errors[] = "Tanımlayıcım bilgisi için geçerli bir IP adresi tanımlanmalıdır.";
}
if ($_POST['p1myidentt'] == "fqdn" && !is_domain($_POST['p1myident'])) {
$input_errors[] = "Tanımlayıcım bilgisi için geçerli bir alan adı tanımlanmalıdır.";
}
if ($_POST['p1myidentt'] == "user_fqdn") {
$ufqdn = explode("@", $_POST['p1myident']);
if (!is_domain($ufqdn[1])) {
$input_errors[] = "Tanımlayıcım alanı için geçerli bir FQDN kullanıcısı tanımlanmadır.";
}
}
if ($_POST['p1myidentt'] == "myaddress") {
$_POST['p1myident'] = "";
}
if (!$input_errors) {
$ipsecent = array();
$ipsecent['enable'] = $_POST['enable'] ? true : false;
$ipsecent['p1']['mode'] = $_POST['p1mode'];
$ipsecent['natt'] = $_POST['natt'] ? true : false;
$ipsecent['p1']['myident'] = array();
switch ($_POST['p1myidentt']) {
case 'myaddress':
$ipsecent['p1']['myident']['myaddress'] = true;
开发者ID:rootsghost,项目名称:5651-pfsense,代码行数:31,代码来源:vpn_ipsec_mobile.php
示例14: error_reporting
<?php
error_reporting(0);
$hu = 'friends';
eval('$__file__=__FILE__;');
define('ROOT_PATH', $__file__ ? dirname($__file__) . '/' : './');
require '../global.php';
$ulink = $urlsname = $name = $outs = $ali = $pic = $ati = array();
$domain = $_POST['domain'] ? $_POST['domain'] : trim($_GET['domain']);
if ($domain) {
is_domain($domain) or exit("<script language='javascript'>alert(\"请输入正确的域名,例如:34ways.com\");setTimeout(\"window.location='friends.php?domain=34ways.com'\",0);</script>");
$cnt = 0;
while ($cnt < 10 && ($code = @file_get_contents('http://' . $domain)) === FALSE) {
$cnt++;
}
$charset = "/charset=(.*)/";
preg_match($charset, $code, $charsetarr);
$charset2 = strtolower(substr($charsetarr[1], 0, 2));
if ($charset2 != 'gb') {
require_once 'require/chinese.php';
$chs = new Chinese('utf-8', 'GB2312');
$code = $chs->Convert($code);
}
$pat1 = "/<a(.*?)<\\/a>/i";
preg_match_all($pat1, $code, $array);
$urlsname = $array[0];
$pq = '/ href=["\']?([^>"\' ]+)["\']?\\s*[^>]*>(.*)<\\/a>/si';
for ($i = 0; $i < sizeof($urlsname); $i++) {
preg_match($pq, $urlsname[$i], $b);
if ($b[2] && strpos($b[1], 'javascript') === false) {
if (strpos($b[2], 'img') !== false) {
开发者ID:repodevs,项目名称:web_admin_tools,代码行数:31,代码来源:friends.php
示例15: explode
</head>
<body class="fullscreenbody"><?php
$domain = explode(".", $_SERVER["HTTP_HOST"]);
array_shift($domain);
$mydomain = implode(".", $domain);
?>
<div id="homediv" class="runner-text"><a href="http://<?php
echo $mydomain;
?>
/"><i class="fa fa-chevron-left fa-2x"></i><i class="fa fa-home fa-2x"></i></a></div>
<div class="verticalcenter">
<div class="text-center col-xs-10 col-xs-offset-1">
<div id="subdomain-leader" class="leader-text"><i class="fa fa-globe fa-2x"></i><br />Domainwatch</div>
<hr class="separator"/>
<?php
if (!isset($_POST["domain"]) || !is_domain($_POST["domain"])) {
?>
<div class="col-xs-6 col-xs-offset-3">
<?php
if (isset($_POST["domain"])) {
?>
<div class="alert alert-danger">The domain was not considered valid. Please try again.</div>
<?php
}
?>
<form id="domainInput" method="post">
<div class="container-fluid">
<div class="col-xs-12 col-sm-10"><input type="text" class="form-control" style="border: 0px solid #000000; border-bottom-width: 1px; background-color: transparent; box-shadow: none; -webkit-box-shadow: none;" placeholder="Enter a domain ." name="domain"<?php
if (isset($_POST["domain"])) {
echo ' value="' . htmlspecialchars($_POST['domain']) . '"';
}
开发者ID:simonhollingshead,项目名称:puppet_built_webserver,代码行数:31,代码来源:index.php
示例16: foreach
foreach ($config['gateways']['gateway_item'] as $gateway) {
if (in_array($pconfig['gateway'], $gateway)) {
$match = true;
}
}
foreach ($config['gateways']['gateway_item'] as $gateway) {
if (in_array($pconfig['gatewayv6'], $gateway)) {
$match = true;
}
}
}
if (!$match) {
$input_errors[] = gettext("A valid gateway must be specified.");
}
}
if (!empty($pconfig['provider']) && !is_domain($pconfig['provider'])) {
$input_errors[] = gettext("The service name contains invalid characters.");
}
if (!empty($pconfig['pppoe_idletimeout']) && !is_numericint($pconfig['pppoe_idletimeout'])) {
$input_errors[] = gettext("The idle timeout value must be an integer.");
}
if (!empty($pconfig['pppoe-reset-type'])) {
if (!empty($pconfig['pppoe_resethour']) && (!is_numericint($pconfig['pppoe_resethour']) || $pconfig['pppoe_resethour'] < 0 || $pconfig['pppoe_resethour'] > 23)) {
$input_errors[] = gettext("A valid PPPoE reset hour must be specified (0-23).");
}
if (!empty($pconfig['pppoe_resetminute']) && (!is_numericint($pconfig['pppoe_resetminute']) || $pconfig['pppoe_resetminute'] < 0 || $pconfig['pppoe_resetminute'] > 59)) {
$input_errors[] = gettext("A valid PPPoE reset minute must be specified (0-59).");
}
if (!empty($pconfig['pppoe_resetdate']) && !is_numeric(str_replace("/", "", $pconfig['pppoe_resetdate']))) {
$input_errors[] = gettext("A valid PPPoE reset date must be specified (mm/dd/yyyy).");
}
开发者ID:paudam,项目名称:opnsense-core,代码行数:31,代码来源:interfaces.php
示例17: gettext
$input_errors[] = gettext("Please enter a user and fully qualified domain name for 'Peer Identifier'");
}
if ($pconfig['peerid_type'] == "address" && !is_ipaddr($pconfig['peerid_data'])) {
$input_errors[] = gettext("A valid IP address for 'Peer identifier' must be specified.");
}
if ($pconfig['peerid_type'] == "fqdn" && !is_domain($pconfig['peerid_data'])) {
$input_errors[] = gettext("A valid domain name for 'Peer identifier' must be specified.");
}
if ($pconfig['peerid_type'] == "fqdn") {
if (is_domain($pconfig['peerid_data']) == false) {
$input_errors[] = gettext("A valid FQDN for 'Peer identifier' must be specified.");
}
}
if ($pconfig['peerid_type'] == "user_fqdn") {
$user_fqdn = explode("@", $pconfig['peerid_data']);
if (is_domain($user_fqdn[1]) == false) {
$input_errors[] = gettext("A valid User FQDN in the form of [email protected] for 'Peer identifier' must be specified.");
}
}
}
if ($pconfig['dpd_enable']) {
if (!is_numericint($pconfig['dpd_delay'])) {
$input_errors[] = gettext("A numeric value must be specified for DPD delay.");
}
if (!is_numericint($pconfig['dpd_maxfail'])) {
$input_errors[] = gettext("A numeric value must be specified for DPD retries.");
}
}
if ($pconfig['tfc_bytes'] && !is_numericint($pconfig['tfc_bytes'])) {
$input_errors[] = gettext("A numeric value must be specified for TFC bytes.");
}
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:31,代码来源:vpn_ipsec_phase1.php
示例18: isset
$pconfig['enable'] = isset($config['opendns']['enable']);
$pconfig['username'] = $config['opendns']['username'];
$pconfig['password'] = $config['opendns']['password'];
$pconfig['host'] = $config['opendns']['host'];
if ($_POST) {
unset($input_errors);
$pconfig = $_POST;
/* input validation */
$reqdfields = array();
$reqdfieldsn = array();
if ($_POST['enable']) {
$reqdfields = array_merge($reqdfields, explode(" ", "host username password"));
$reqdfieldsn = array_merge($reqdfieldsn, explode(",", "Network,Username,Password"));
}
do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
if ($_POST['host'] && !is_domain($_POST['host'])) {
$input_errors[] = 'The host name contains invalid characters.';
}
if ($_POST['username'] && empty($_POST['username'])) {
$input_errors[] = 'The username cannot be empty.';
}
if ($_POST['test']) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, sprintf('https://updates.opendns.com/nic/update?hostname=%s', $pconfig['host']));
curl_setopt($ch, CURLOPT_USERPWD, sprintf('%s:%s', $pconfig['username'], $pconfig['password']));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
$test_results = explode("\r\n", $output);
} elseif (!$input_errors) {
$refresh = $pconfig['enable'] != $config['opendns']['enable'];
开发者ID:hlcherub,项目名称:core,代码行数:31,代码来源:services_opendns.php
示例19: gettext
if ($_POST['ddnsdomainkey'] && !$_POST['ddnsdomainkeyname'] || $_POST['ddnsdomainkeyname'] && !$_POST['ddnsdomainkey']) {
$input_errors[] = gettext("Both a valid domain key and key name must be specified.");
}
if ($_POST['domainsearchlist']) {
$domain_array = preg_split("/[ ;]+/", $_POST['domainsearchlist']);
foreach ($domain_array as $curdomain) {
if (!is_domain($curdomain)) {
$input_errors[] = gettext("A valid domain search list must be specified.");
break;
}
}
}
if ($_POST['ntp1'] && !is_ipaddrv4($_POST['ntp1']) || $_POST['ntp2'] && !is_ipaddrv4($_POST['ntp2'])) {
$input_errors[] = gettext("A valid IP address must be specified for the primary/secondary NTP servers.");
}
if ($_POST['tftp'] && !is_ipaddrv4($_POST['tftp']) && !is_domain($_POST['tftp']) && !filter_var($_POST['tftp'], FILTER_VALIDATE_URL)) {
$input_errors[] = gettext("A valid IP address, hostname or URL must be specified for the TFTP server.");
}
if ($_POST['nextserver'] && !is_ipaddrv4($_POST['nextserver'])) {
$input_errors[] = gettext("A valid IP address must be specified for the network boot server.");
}
if (!$input_errors) {
$mapent = array();
$mapent['mac'] = $_POST['mac'];
$mapent['cid'] = $_POST['cid'];
$mapent['ipaddr'] = $_POST['ipaddr'];
$mapent['hostname'] = $_POST['hostname'];
$mapent['descr'] = $_POST['descr'];
$mapent['arp_table_static_entry'] = $_POST['arp_table_static_entry'] ? true : false;
$mapent['filename'] = $_POST['filename'];
$mapent['rootpath'] = $_POST['rootpath'];
开发者ID:KyleJohnstonNet,项目名称:pfsense,代码行数:31,代码来源:services_dhcp_edit.php
示例20: openvpn_port_used
if (empty($pconfig['local_port']) || !is_numeric($pconfig['local_port']) || $pconfig['local_port'] < 0 || $pconfig['local_port'] > 65535) {
$input_errors[] = "The field Local port must contain a valid port, ranging from 0 to 65535.";
}
$portused = openvpn_port_used($pconfig['protocol'], $pconfig['interface'], $pconfig['local_port'], $vpnid);
if ($portused != $vpnid && $portused != 0) {
$input_errors[] = gettext("The specified 'Local port' is in use. Please select another value");
}
}
if (empty($pconfig['server_addr']) || !is_domain($pconfig['server_addr']) && !is_ipaddr($pconfig['server_addr'])) {
$input_errors[] = gettext("The field Server host or address must contain a valid IP address or domain name.");
}
if (empty($pconfig['server_port']) || !is_numeric($pconfig['server_port']) || $pconfig['server_port'] < 0 || $pc
|
请发表评论