コード例 #1
0
ファイル: vpn_openvpn_client.php プロジェクト: Toudix/core
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;
}
コード例 #2
0
ファイル: core.php プロジェクト: rentalhost/core
 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;
 }
コード例 #3
0
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.");
    }
}
コード例 #4
0
ファイル: interfaces.php プロジェクト: simudream/pfsense
 }
 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'])) {
コード例 #5
0
ファイル: vpn_ipsec_mobile.php プロジェクト: nasaa0528/core
     $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'])) {
コード例 #6
0
    $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;
        }
    }
コード例 #7
0
 }
 /* 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'])) {
コード例 #8
0
     }
 }
 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 user@my.domain.com 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.");
 }
コード例 #9
0
ファイル: model_sites.php プロジェクト: GordonTees/masterdash
 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='******'&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;
 }
コード例 #10
0
         $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'];
コード例 #11
0
ファイル: seo.php プロジェクト: repodevs/web_admin_tools
<?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;
コード例 #12
0
ファイル: hook.php プロジェクト: HuangJi/SITCON-TelegramBot
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);
    }
}
コード例 #13
0
 }
 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;
コード例 #14
0
ファイル: friends.php プロジェクト: repodevs/web_admin_tools
<?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) {
コード例 #15
0
    </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']) . '"';
    }
コード例 #16
0
ファイル: interfaces.php プロジェクト: paudam/opnsense-core
         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).");
     }
コード例 #17
0
         $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 user@my.domain.com 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.");
 }
コード例 #18
0
ファイル: services_opendns.php プロジェクト: hlcherub/core
$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'];
コード例 #19
0
 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'];
コード例 #20
0
ファイル: seo.php プロジェクト: repodevs/web_admin_tools
<?php

error_reporting(0);
define('IN_SEO', TRUE);
header("Content-Type:text/html;charset=gb2312");
require 'function.php';
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');
$ROBOT['site_url'] = 'http://www.baidu.com/s?wd=site%3A';
$ROBOT['site_pattern'] = "/找到相关网页(.*)篇/";
@extract($_POST);
$domain = $domain ? $domain : '34ways.com';
@(require_once '../cache.php');
if (file_exists("../cache/baidu.php")) {
    @(require_once "../cache/baidu.php");
    $urls = filehave($urls, $domain);
} else {
    $urls = fileno($domain);
}
writeover("../cache/baidu.php", "<?php\r\n\$urls=" . vvar_export($urls) . ";\r\n?>");
isset($domain) or exit('非法操作!');
$domain = strtolower($domain);
is_domain($domain) or exit('请输入正确的域名!');
$result = get_seo_info($domain, $selects, $pn);
echo $result;
コード例 #21
0
ファイル: vpn_openvpn_client.php プロジェクト: Anasxrt/core
     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 || $pconfig['server_port'] > 65535) {
     $input_errors[] = "The field Server port must contain a valid port, ranging from 0 to 65535.";
 }
 if (!empty($pconfig['proxy_addr'])) {
     if (empty($pconfig['proxy_addr']) || !is_domain($pconfig['proxy_addr']) && !is_ipaddr($pconfig['proxy_addr'])) {
         $input_errors[] = gettext("The field Proxy host or address must contain a valid IP address or domain name.");
     }
     if (empty($pconfig['proxy_port']) || !is_numeric($pconfig['proxy_port']) || $pconfig['proxy_port'] < 0 || $pconfig['proxy_port'] > 65535) {
         $input_errors[] = "The field Proxy port must contain a valid port, ranging from 0 to 65535.";
     }
     if (isset($pconfig['proxy_authtype']) && $pconfig['proxy_authtype'] != "none") {
         if (empty($pconfig['proxy_user']) || empty($pconfig['proxy_passwd'])) {
             $input_errors[] = gettext("User name and password are required for proxy with authentication.");
         }
     }
 }
 if (!empty($pconfig['tunnel_network'])) {
     if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'IPv4 Tunnel Network', false, "ipv4")) {
         $input_errors[] = $result;
     }
コード例 #22
0
}
if ($_POST['submit']) {
    unset($input_errors);
    $pconfig = $_POST;
    /* input consolidation */
    /* 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 ($pconfig['pool_enable']) {
        if (!is_ipaddr($pconfig['pool_address'])) {
            $input_errors[] = gettext("A valid IP address for 'Virtual Address Pool Network' must be specified.");
        }
    }
    if ($pconfig['dns_domain_enable']) {
        if (!is_domain($pconfig['dns_domain'])) {
            $input_errors[] = gettext("A valid value for 'DNS Default Domain' must be specified.");
        }
    }
    if ($pconfig['dns_server_enable']) {
        if (!$pconfig['dns_server1'] && !$pconfig['dns_server2'] && !$pconfig['dns_server3'] && !$pconfig['dns_server4']) {
            $input_errors[] = gettext("At least one DNS server must be specified to enable the DNS Server option.");
        }
        if ($pconfig['dns_server1'] && !is_ipaddr($pconfig['dns_server1'])) {
            $input_errors[] = gettext("A valid IP address for 'DNS Server #1' must be specified.");
        }
        if ($pconfig['dns_server2'] && !is_ipaddr($pconfig['dns_server2'])) {
            $input_errors[] = gettext("A valid IP address for 'DNS Server #2' must be specified.");
        }
        if ($pconfig['dns_server3'] && !is_ipaddr($pconfig['dns_server3'])) {
            $input_errors[] = gettext("A valid IP address for 'DNS Server #3' must be specified.");
コード例 #23
0
if ($_POST) {
    unset($input_errors);
    $pconfig = $_POST;
    /* input validation */
    $reqdfields = array();
    $reqdfieldsn = array();
    $reqdfields = array_merge($reqdfields, explode(" ", "host ttl keyname keydata"));
    $reqdfieldsn = array_merge($reqdfieldsn, array(gettext("Hostname"), gettext("TTL"), gettext("Key name"), gettext("Key")));
    do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
    if ($_POST['host'] && !is_domain($_POST['host'])) {
        $input_errors[] = gettext("The DNS update host name contains invalid characters.");
    }
    if ($_POST['ttl'] && !is_numericint($_POST['ttl'])) {
        $input_errors[] = gettext("The DNS update TTL must be an integer.");
    }
    if ($_POST['keyname'] && !is_domain($_POST['keyname'])) {
        $input_errors[] = gettext("The DNS update key name contains invalid characters.");
    }
    if (!$input_errors) {
        $rfc2136 = array();
        $rfc2136['enable'] = $_POST['enable'] ? true : false;
        $rfc2136['host'] = $_POST['host'];
        $rfc2136['ttl'] = $_POST['ttl'];
        $rfc2136['keyname'] = $_POST['keyname'];
        $rfc2136['keytype'] = $_POST['keytype'];
        $rfc2136['keydata'] = $_POST['keydata'];
        $rfc2136['server'] = $_POST['server'];
        $rfc2136['usetcp'] = $_POST['usetcp'] ? true : false;
        $rfc2136['usepublicip'] = $_POST['usepublicip'] ? true : false;
        $rfc2136['recordtype'] = $_POST['recordtype'];
        $rfc2136['interface'] = $_POST['interface'];
コード例 #24
0
 $pconfig['aliases']['item'] = $aliases;
 /* validate aliases */
 foreach ($aliases as $idx => $alias) {
     $aliasreqdfields = array('aliasdomain' . $idx);
     $aliasreqdfieldsn = array(gettext("Alias Domain"));
     do_input_validation($_POST, $aliasreqdfields, $aliasreqdfieldsn, $input_errors);
     if ($alias['host']) {
         if (!is_hostname($alias['host'])) {
             $input_errors[] = gettext("Hostnames in an alias list can only contain the characters A-Z, 0-9 and '-'. They may not start or end with '-'.");
         } else {
             if (!is_unqualified_hostname($alias['host'])) {
                 $input_errors[] = gettext("A valid alias hostname is specified, but the domain name part should be omitted");
             }
         }
     }
     if ($alias['domain'] && !is_domain($alias['domain'])) {
         $input_errors[] = gettext("A valid domain must be specified in alias list.");
     }
 }
 /* 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;
     }
 }
 if (!$input_errors) {
     $hostent = array();
コード例 #25
0
ファイル: system.php プロジェクト: LFCavalcanti/pfsense
     $dnsgwitem = "dns{$dnscounter}gw";
     if ($_POST[$dnsgwitem]) {
         if (interface_has_gateway($_POST[$dnsgwitem])) {
             foreach ($direct_networks_list as $direct_network) {
                 if (ip_in_subnet($_POST[$dnsitem], $direct_network)) {
                     $input_errors[] = sprintf(gettext("A gateway can not be assigned to DNS '%s' server which is on a directly connected network."), $_POST[$dnsitem]);
                 }
             }
         }
     }
 }
 # it's easy to have a little too much whitespace in the field, clean it up for the user before processing.
 $_POST['timeservers'] = preg_replace('/[[:blank:]]+/', ' ', $_POST['timeservers']);
 $_POST['timeservers'] = trim($_POST['timeservers']);
 foreach (explode(' ', $_POST['timeservers']) as $ts) {
     if (!is_domain($ts)) {
         $input_errors[] = gettext("A NTP Time Server name may only contain the characters a-z, 0-9, '-' and '.'.");
     }
 }
 if (!$input_errors) {
     update_if_changed("hostname", $config['system']['hostname'], $_POST['hostname']);
     update_if_changed("domain", $config['system']['domain'], $_POST['domain']);
     update_if_changed("timezone", $config['system']['timezone'], $_POST['timezone']);
     update_if_changed("NTP servers", $config['system']['timeservers'], strtolower($_POST['timeservers']));
     if ($_POST['language'] && $_POST['language'] != $config['system']['language']) {
         $config['system']['language'] = $_POST['language'];
         set_language();
     }
     unset($config['system']['webgui']['webguileftcolumnhyper']);
     $config['system']['webgui']['webguileftcolumnhyper'] = $_POST['webguileftcolumnhyper'] ? true : false;
     unset($config['system']['webgui']['dashboardavailablewidgetspanel']);
コード例 #26
0
ファイル: json.php プロジェクト: GordonTees/masterdash
 function _get_dataset($sites = array(), &$all_site_ids, $client_tab_id = 0, $client_tab_columns = array(), $start_date = 0, $end_date = 0, &$total_stats = array(), $csv = false)
 {
     $result = array();
     $grid_method = get_grid_method_from_page();
     $user = $this->session->all_userdata();
     if (!empty($sites)) {
         $this->load->model('model_sites');
         $this->load->model('model_site_whois');
         if ($client_tab_id == '0') {
             $data_types = array();
             if (!empty($client_tab_columns)) {
                 foreach ($client_tab_columns as $client_tab_column) {
                     $data_types[$client_tab_column['attribute_array_index']] = $client_tab_column['attribute_value_type'];
                 }
             }
             foreach ($sites as $site) {
                 $this_site = array($site['site_id']);
                 $all_site_ids[] = $site['site_id'];
                 foreach ($site as $site_key => $value) {
                     // Taken care of
                     if ($site_key == 'site_id' || $site_key == 'site_notes' || $site_key == 'site_displayed_flag') {
                         continue;
                     }
                     if ($site_key == 'site_title') {
                         $classes = 'tooltip fg-button ui-state-default fg-button-icon-solo ui-corner-all';
                         if (!$csv) {
                             $actions = '<a href="javascript: void(0);" title="Popup Edit" class="' . $classes . ' popup_edit" id="' . $site['site_id'] . '">' . '<span class="ui-icon ui-icon-newwin"></span> </a>' . '<a href="javascript: void(0);" title="Inline Edit" class="' . $classes . ' edit" id="' . $site['site_id'] . '">' . '<span class="ui-icon ui-icon-arrow-1-e"></span> </a>' . '<a href="javascript: void(0);" title="Delete Site" class="' . $classes . ' delete" id="' . $site['site_id'] . '">' . '<span class="ui-icon ui-icon-close"></span> </a>';
                             $this_site[] = $actions;
                             if (!empty($site['site_notes'])) {
                                 $title = $site['site_notes'];
                             } else {
                                 $title = $site['site_title'];
                             }
                             if (is_domain($site['site_title'])) {
                                 $value = '<a href="http://' . $site['site_title'] . '" target="_blank" class="tooltip" title="' . $title . '">' . $site['site_title'] . '</a>';
                             } else {
                                 $value = '<span class="tooltip" title="' . $title . '">' . $site['site_title'] . '</span>';
                             }
                             $checked = '';
                             if ($site['site_displayed_flag'] == '1') {
                                 $checked = ' checked';
                             }
                             $disp_title = 'Display on Dashboard';
                             $disp_id = 'site_displayed_flag-' . $site['site_id'];
                             $this_site[] = '<input title="' . $disp_title . '" type="checkbox" class="site_displayed_flag tooltip" id="' . $disp_id . '" value="1"' . $checked . '>' . $value;
                         }
                     } else {
                         if ($data_types[$site_key] == 'PC') {
                             $contact_parts = explode("\t", $site[$site_key]);
                             if ($csv) {
                                 $this_site[] = isset($contact_parts[0]) ? $contact_parts[0] : '';
                                 $this_site[] = isset($contact_parts[1]) ? $contact_parts[1] : '';
                                 $this_site[] = isset($contact_parts[2]) ? $contact_parts[2] : '';
                                 $this_site[] = isset($contact_parts[3]) ? $contact_parts[3] : '';
                             } else {
                                 $value = $contact_parts[0];
                                 if (!empty($contact_parts[1])) {
                                     $value .= ', email: ' . $contact_parts[1];
                                 }
                                 if (!empty($contact_parts[2])) {
                                     $value .= ', phone: ' . $contact_parts[2];
                                 }
                                 if (!empty($contact_parts[3])) {
                                     $value .= ', mobile: ' . $contact_parts[3];
                                 }
                                 $this_site[] = $value;
                             }
                         } else {
                             $this_site[] = $csv ? csv_output($value) : $value;
                         }
                     }
                 }
                 $result[] = $this_site;
             }
         } else {
             $this->model_sites->get_site_stats($sites, $user, $start_date, $end_date, $total_stats);
             $sites_keys = array();
             $contact_keys = array();
             if (!empty($client_tab_columns)) {
                 foreach ($client_tab_columns['columns'] as $client_tab_column) {
                     if ($client_tab_column['attributeType'] == 'PC') {
                         $contact_keys[] = $client_tab_column['id'];
                     }
                 }
                 $contact_keys = array_intersect($contact_keys, array_keys($sites[0]));
                 foreach ($sites as $site) {
                     $site['id'] = $site['site_id'];
                     $all_site_ids[] = $site['site_id'];
                     $classes = 'tooltip fg-button ui-state-default fg-button-icon-solo ui-corner-all';
                     $actions = '<a href="javascript: void(0);" title="View/edit all details" class="' . $classes . ' popup_edit" id="' . $site['site_id'] . '">' . '<span class="ui-icon ui-icon-newwin"></span> </a>' . '<a href="javascript: void(0);" title="Report an issue with this site" class="' . $classes . ' popup_report" id="' . $site['site_id'] . '">' . '<span class="ui-icon ui-icon-flag"></span> </a>';
                     $site['actions'] = $actions;
                     if (!empty($site['site_notes'])) {
                         $title = $site['site_notes'];
                     } else {
                         $title = $site['site_title'];
                     }
                     if (is_domain($site['site_title'])) {
                         $value = '<a href="http://' . $site['site_title'] . '" target="_blank" class="tooltip" title="' . $title . '">' . $site['site_title'] . '</a>';
                     } else {
                         $value = '<span class="tooltip" title="' . $title . '">' . $site['site_title'] . '</span>';
                     }
                     $site['site_title'] = $value;
                     if (!empty($contact_keys)) {
                         foreach ($contact_keys as $contact_key) {
                             $contact_parts = explode("\t", $site[$contact_key]);
                             $value = $contact_parts[0];
                             if (!empty($contact_parts[1])) {
                                 $value .= ', email: ' . $contact_parts[1];
                             }
                             if (!empty($contact_parts[2])) {
                                 $value .= ', phone: ' . $contact_parts[2];
                             }
                             if (!empty($contact_parts[3])) {
                                 $value .= ', mobile: ' . $contact_parts[3];
                             }
                             $site[$contact_key] = $value;
                         }
                     }
                     // Don't need site_notes any more
                     unset($site['site_notes']);
                     $result[] = $site;
                 }
             }
         }
     }
     return $result;
 }
コード例 #27
0
 do_input_validation($_POST, $reqdfields, $reqdfieldsn, $input_errors);
 if (isset($_POST['host']) && in_array("host", $reqdfields)) {
     /* Namecheap can have a @. in hostname */
     if ($pconfig['type'] == "namecheap" && substr($_POST['host'], 0, 2) == '@.') {
         $host_to_check = substr($_POST['host'], 2);
     } else {
         $host_to_check = $_POST['host'];
     }
     if ($pconfig['type'] != "custom" && $pconfig['type'] != "custom-v6") {
         if (!is_domain($host_to_check)) {
             $input_errors[] = gettext("The hostname contains invalid characters.");
         }
     }
     unset($host_to_check);
 }
 if ($_POST['mx'] && !is_domain($_POST['mx'])) {
     $input_errors[] = gettext("The MX contains invalid characters.");
 }
 if (in_array("username", $reqdfields) && $_POST['username'] && !is_dyndns_username($_POST['username']) || in_array("username", $reqdfields) && $_POST['username'] == "") {
     $input_errors[] = gettext("The username contains invalid characters.");
 }
 if (!$input_errors) {
     $dyndns = array();
     $dyndns['type'] = $_POST['type'];
     $dyndns['username'] = $_POST['username'];
     $dyndns['password'] = $_POST['passwordfld'];
     $dyndns['host'] = $_POST['host'];
     $dyndns['mx'] = $_POST['mx'];
     $dyndns['wildcard'] = $_POST['wildcard'] ? true : false;
     $dyndns['verboselog'] = $_POST['verboselog'] ? true : false;
     $dyndns['curl_ipresolve_v4'] = $_POST['curl_ipresolve_v4'] ? true : false;
コード例 #28
0
ファイル: esearch.php プロジェクト: repodevs/web_admin_tools
<?php

error_reporting(0);
$hu = 'eseach';
eval('$__file__=__FILE__;');
define('ROOT_PATH', $__file__ ? dirname($__file__) . '/' : './');
require_once "global.php";
$domain = $_POST['domain'] ? $_POST['domain'] : $_GET['domain'];
if ($domain) {
    is_domain($domain) or exit("<script language=javascript>alert('请输入正确的域名!');location.href='esearch.php';</script>");
    $url = 'http://' . trim($domain);
    $content = @file_get_contents($url);
    $charset = "/charset=(.*)/";
    preg_match($charset, $content, $charsetarr);
    $charset2 = strtolower(substr($charsetarr[1], 0, 2));
    if ($charset2 != 'gb') {
        require_once 'require/chinese.php';
        $chs = new Chinese('utf-8', 'GB2312');
        $content = $chs->Convert($content);
    }
    $pat1 = "/<title>(.*)<\\/title>/si";
    preg_match_all($pat1, $content, $array);
    $pat2 = "/meta content=\"(.+)\" name=\"keywords\"/Ui";
    $pat9 = "/meta name=\"keywords\" content=\"(.+)\"/Ui";
    preg_match_all($pat2, $content, $array2);
    preg_match_all($pat9, $content, $array9);
    $pat3 = "/<meta content=\"(.+)\" name=\"description\"/Usi";
    $pat8 = "/<meta name=\"description\" content=\"(.+)\"/Usi";
    preg_match_all($pat3, $content, $array3);
    preg_match_all($pat8, $content, $array8);
    $bods = "/<body>(.*)<\\/body>/is";
コード例 #29
0
 if ($_POST['ddnsdomainkey'] && !$_POST['ddnsdomainkeyname'] || $_POST['ddnsdomainkeyname'] && !$_POST['ddnsdomainkey']) {
     $input_errors[] = gettext("You must specify both a valid domain key and key name.");
 }
 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']) && !is_URL($_POST['tftp'])) {
     $input_errors[] = gettext("A valid IP address or hostname 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'];
コード例 #30
0
                 $input_errors[] = sprintf(gettext("The captive portal cannot be used on interface %s since it is part of a bridge."), $cpbrif);
             }
             foreach ($a_cp as $cpkey => $cp) {
                 if ($cpkey != $cpzone || empty($cpzone)) {
                     if (in_array($cpbrif, explode(",", $cp['interface']))) {
                         $input_errors[] = sprintf(gettext("The captive portal cannot be used on interface %s since it is used already on %s instance."), $cpbrif, $cp['zone']);
                     }
                 }
             }
         }
     }
     if ($_POST['httpslogin_enable']) {
         if (!$_POST['certref']) {
             $input_errors[] = gettext("Certificate must be specified for HTTPS login.");
         }
         if (!$_POST['httpsname'] || !is_domain($_POST['httpsname'])) {
             $input_errors[] = gettext("The HTTPS server name must be specified for HTTPS login.");
         }
     }
 }
 if ($_POST['timeout']) {
     if (!is_numeric($_POST['timeout']) || $_POST['timeout'] < 1) {
         $input_errors[] = gettext("The timeout must be at least 1 minute.");
     } else {
         if (isset($config['dhcpd']) && is_array($config['dhcpd'])) {
             foreach ($config['dhcpd'] as $dhcpd_if => $dhcpd_data) {
                 if (!isset($dhcpd_data['enable'])) {
                     continue;
                 }
                 if (!is_array($_POST['cinterface']) || !in_array($dhcpd_if, $_POST['cinterface'])) {
                     continue;