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


PHP domain_exists函数代码示例

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


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

示例1: get_blog_id

 public static function get_blog_id($activation_key)
 {
     global $wpdb;
     $blog_id = 0;
     $row = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->signups} WHERE activation_key = %d", $activation_key));
     if ($row && $row->activation_key == $activation_key) {
         $blog_id = domain_exists($row->domain, $row->path, $wpdb->siteid);
         // As a fallback, try the site domain
         if (empty($blog_id)) {
             $domain = $wpdb->get_var($wpdb->prepare("SELECT domain FROM {$wpdb->site} WHERE id = %d", $wpdb->siteid));
             $blog_id = domain_exists($domain, $row->path, $wpdb->siteid);
         }
     }
     return $blog_id;
 }
开发者ID:vilmark,项目名称:vilmark_main,代码行数:15,代码来源:ProSite.php

示例2: cfgp_install

function cfgp_install()
{
    /* Make domain a subdomain to example.com so there's
     * 	no possible way to navigate to it from admin or
     * 	front-end */
    $domain = CFGP_SITE_DOMAIN;
    $path = '/';
    if (!domain_exists($domain, $path, $site)) {
        $new_blog_id = create_empty_blog($domain, $path, 'CF Global Posts Blog', CFGP_SITE_ID);
        /* Make the blog private */
        update_blog_status($new_blog_id, 'public', 0);
    } else {
        error_log('Domain Already Exists');
    }
}
开发者ID:bigdawggi,项目名称:wp-cf-global-posts,代码行数:15,代码来源:cf-global-posts.php

示例3: do_hook

$master = "";
if (isset($_POST['slave_master'])) {
    $master = $_POST['slave_master'];
}
$type = "SLAVE";
/*
 Check permissions
*/
do_hook('verify_permission', 'zone_slave_add') ? $zone_slave_add = "1" : ($zone_slave_add = "0");
do_hook('verify_permission', 'user_view_others') ? $perm_view_others = "1" : ($perm_view_others = "0");
if (isset($_POST['submit']) && $zone_slave_add == "1") {
    if (!is_valid_hostname_fqdn($zone, 0)) {
        error(ERR_DNS_HOSTNAME);
    } elseif ($dns_third_level_check && get_domain_level($zone) > 2 && domain_exists(get_second_level_domain($zone))) {
        error(ERR_DOMAIN_EXISTS);
    } elseif (domain_exists($zone) || record_name_exists($zone)) {
        error(ERR_DOMAIN_EXISTS);
    } elseif (!is_valid_ipv4($master, false) && !is_valid_ipv6($master)) {
        error(ERR_DNS_IP);
    } else {
        if (add_domain($zone, $owner, $type, $master, 'none')) {
            success("<a href=\"edit.php?id=" . get_zone_id_from_name($zone) . "\">" . SUC_ZONE_ADD . '</a>');
            log_info(sprintf('client_ip:%s user:%s operation:add_zone zone:%s zone_type:SLAVE zone_master:%s', $_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"], $zone, $master, $zone_template));
            unset($zone, $owner, $webip, $mailip, $empty, $type, $master);
        }
    }
}
if ($zone_slave_add != "1") {
    error(ERR_PERM_ADD_ZONE_SLAVE);
} else {
    echo "     <h2>" . _('Add slave zone') . "</h2>\n";
开发者ID:eraserewind,项目名称:poweradmin,代码行数:31,代码来源:add_zone_slave.php

示例4: domain_exists

 /** RESTful endpoint for this multisite function.
  *
  * Get $_REQUEST options for this endpoint:
  *
  * u (optional) -- Username (if not logged in)
  * p (optional) -- Password (if not logged in)
  * domain (required) full domain of site we're checking on
  * path (required) path of the site we're checking on
  * site_id (optional) site id of the blog (defaults to 1)
  *
  */
 public function domain_exists()
 {
     global $json_api;
     $this->_verify_admin();
     extract($_REQUEST);
     if (!isset($domain)) {
         $json_api->error(__("You must send the 'domain' parameter."));
     }
     if (!isset($path)) {
         $json_api->error(__("You must send the 'path' parameter."));
     }
     if (!isset($site_id)) {
         $site_id = 1;
     }
     if (domain_exists($domain, $path, $site_id)) {
         return array("message" => __("The Domain Exists."));
     } else {
         return array("message" => __("The Domain Does Not Exist."));
     }
 }
开发者ID:vccabral,项目名称:wp-json-api,代码行数:31,代码来源:multisite.php

示例5: wpmu_create_blog

/**
 * Create a site.
 *
 * This function runs when a user self-registers a new site as well
 * as when a Super Admin creates a new site. Hook to 'wpmu_new_blog'
 * for events that should affect all new sites.
 *
 * On subdirectory installs, $domain is the same as the main site's
 * domain, and the path is the subdirectory name (eg 'example.com'
 * and '/blog1/'). On subdomain installs, $domain is the new subdomain +
 * root domain (eg 'blog1.example.com'), and $path is '/'.
 *
 * @since MU
 * @uses domain_exists()
 * @uses insert_blog()
 * @uses wp_install_defaults()
 * @uses add_user_to_blog()
 *
 * @param string $domain The new site's domain.
 * @param string $path The new site's path.
 * @param string $title The new site's title.
 * @param int $user_id The user ID of the new site's admin.
 * @param array $meta Optional. Used to set initial site options.
 * @param int $site_id Optional. Only relevant on multi-network installs.
 * @return mixed Returns WP_Error object on failure, int $blog_id on success
 */
function wpmu_create_blog($domain, $path, $title, $user_id, $meta = '', $site_id = 1)
{
    $domain = preg_replace('/\\s+/', '', sanitize_user($domain, true));
    if (is_subdomain_install()) {
        $domain = str_replace('@', '', $domain);
    }
    $title = strip_tags($title);
    $user_id = (int) $user_id;
    if (empty($path)) {
        $path = '/';
    }
    // Check if the domain has been used already. We should return an error message.
    if (domain_exists($domain, $path, $site_id)) {
        return new WP_Error('blog_taken', __('Site already exists.'));
    }
    if (!defined('WP_INSTALLING')) {
        define('WP_INSTALLING', true);
    }
    if (!($blog_id = insert_blog($domain, $path, $site_id))) {
        return new WP_Error('insert_blog', __('Could not create site.'));
    }
    switch_to_blog($blog_id);
    install_blog($blog_id, $title);
    wp_install_defaults($user_id);
    add_user_to_blog($blog_id, $user_id, 'administrator');
    if (is_array($meta)) {
        foreach ($meta as $key => $value) {
            if ($key == 'public' || $key == 'archived' || $key == 'mature' || $key == 'spam' || $key == 'deleted' || $key == 'lang_id') {
                update_blog_status($blog_id, $key, $value);
            } else {
                update_option($key, $value);
            }
        }
    }
    add_option('WPLANG', get_site_option('WPLANG'));
    update_option('blog_public', (int) $meta['public']);
    if (!is_super_admin() && !get_user_meta($user_id, 'primary_blog', true)) {
        update_user_meta($user_id, 'primary_blog', $blog_id);
    }
    restore_current_blog();
    do_action('wpmu_new_blog', $blog_id, $user_id, $domain, $path, $site_id, $meta);
    return $blog_id;
}
开发者ID:nhemsley,项目名称:wordpress,代码行数:69,代码来源:ms-functions.php

示例6: lti_parse_request_OLD


//.........这里部分代码省略.........
                    $msg .= "<p> {$erroMsg}</p>";
                }
                $msg .= "</p>";
            }
            wp_die($msg);
        }
        $uinfo = get_user_by('login', $userkey);
    }
    //Eliminem del blog Principal (si no es admin) http://jira.uoc.edu/jira/browse/BLOGA-218
    if (!$is_admin) {
        $user = new WP_User($uinfo->ID);
        $user->remove_all_caps();
    }
    $_SERVER['REMOTE_USER'] = $userkey;
    $password = md5($uinfo->user_pass);
    // User is now authorized; force WordPress to use the generated password
    //login, set cookies, and set current user
    wp_authenticate($userkey, $password);
    wp_set_auth_cookie($user->ID, false);
    wp_set_current_user($user->ID, $userkey);
    $siteUrl = substr(get_option("siteurl"), 7);
    // - "http://"
    $siteUrlArray = explode("/", $siteUrl);
    $domain = $siteUrlArray[0];
    unset($siteUrlArray[0]);
    //error_log("og LTI domain: ". $domain);
    $course = $blogType->getCoursePath($context, $siteUrlArray, $domain);
    if (isset($context->info[RESOURCE_LINK_ID]) && $context->info[RESOURCE_LINK_ID]) {
        $course .= '-' . $context->info[RESOURCE_LINK_ID];
    }
    $course = sanitize_user($course, true);
    //Bug wordpress doesn't get stye sheet if has a dot
    $course = str_replace('.', '_', $course);
    $path_base = "/" . implode("/", $siteUrlArray) . "/" . $course;
    $path_base = str_replace('//', '/', $path_base);
    $path = $path_base . "/";
    $path = str_replace('//', '/', $path);
    $blog_created = false;
    $overwrite_plugins_theme = isset($context->info[OVERWRITE_PLUGINS_THEME]) ? $context->info[OVERWRITE_PLUGINS_THEME] == 1 : false;
    $overwrite_roles = isset($context->info[OVERWRITE_ROLES]) ? $context->info[OVERWRITE_ROLES] == 1 : false;
    $blog_id = domain_exists($domain, $path);
    $blog_is_new = false;
    if (!isset($blog_id)) {
        $title = __("Blog ") . $blogType->getCourseName($context);
        $blog_is_new = true;
        $meta = $blogType->getMetaBlog($context);
        $old_site_language = get_site_option('WPLANG');
        $blogType->setLanguage($context);
        $blog_id = wpmu_create_blog($domain, $path, $title, $user_id, $meta);
        update_site_option('WPLANG', $old_site_language);
        $blogType->checkErrorCreatingBlog($blog_id, $path);
        $blog_created = true;
    }
    // Connect the user to the blog
    if (isset($blog_id)) {
        switch_to_blog($blog_id);
        ob_start();
        if ($overwrite_plugins_theme || $blog_created) {
            $blogType->loadPlugins();
            $blogType->changeTheme();
        }
        //Agafem el rol anterior
        $old_role = null;
        if (!$blog_created && !$overwrite_roles) {
            $old_role_array = get_usermeta($user->id, 'wp_' . $blog_id . '_capabilities');
            if (count($old_role_array) > 0) {
                foreach ($old_role_array as $key => $value) {
                    if ($value == true) {
                        $old_role = $key;
                    }
                }
            }
        }
        remove_user_from_blog($uinfo->ID, $blog_id);
        $obj = new stdClass();
        $obj->blog_id = $blog_id;
        $obj->userkey = $userkey;
        $obj->path_base = $path_base;
        $obj->domain = $domain;
        $obj->context = $context;
        $obj->uinfoID = $uinfo->ID;
        $obj->blog_is_new = $blog_is_new;
        if ($overwrite_roles || $old_role == null) {
            $obj->role = $blogType->roleMapping($context->info[FIELD_ROLE_UOC_CAMPUS], $context->info);
        } else {
            $obj->role = $old_role;
        }
        $blogType->postActions($obj);
        add_user_to_blog($blog_id, $uinfo->ID, $obj->role);
        //Si posem el restore_current_blog ens va al principi
        //    	restore_current_blog();
        ob_end_clean();
    }
    $redirecturl = get_option("siteurl");
    //error_log("og LTI redirect URL: ".$redirecturl);
    $redirecturl = str_replace("http://", "https://", $redirecturl);
    //error_log("og LTI new redirect URL: ".$redirecturl);
    wp_redirect($redirecturl);
    exit;
}
开发者ID:paulmedwal,项目名称:edxforumspublic,代码行数:101,代码来源:IMSBasicLTI.php

示例7: ssw_check_domain_exists

 public function ssw_check_domain_exists()
 {
     if (wp_verify_nonce($_POST['ssw_ajax_nonce'], 'ssw_ajax_action')) {
         global $current_blog;
         global $current_site;
         global $wpdb;
         $options = $this->ssw_fetch_config_options();
         $site_address_bucket_none_value = $options['site_address_bucket_none_value'];
         $banned_root_site_address = $options['banned_root_site_address'];
         $banned_site_address = $options['banned_site_address'];
         $is_debug_mode = $options['debug_mode'];
         $site_address_bucket = sanitize_key($_POST['site_address_bucket']);
         /**
          *	Replace '-' from site address since it is being used to separate a site name from site category/bucket 
          */
         $site_address = str_replace('-', '', sanitize_key($_POST['site_address']));
         $is_banned_site = 0;
         if (in_array($site_address_bucket, $site_address_bucket_none_value) != true && $site_address_bucket != '') {
             /* Check for banned site addresses */
             if (in_array($site_address, $banned_site_address) != true) {
                 $site_exists = domain_exists($current_blog->domain, $current_site->path . sanitize_key($_POST['site_complete_path']));
             } else {
                 $is_banned_site = 1;
             }
         } else {
             /* Check for banned root site addresses and banned site addresses */
             if (in_array($site_address, $banned_root_site_address) != true && in_array($site_address, $banned_site_address) != true) {
                 $site_exists = domain_exists($current_blog->domain, $current_site->path . sanitize_key($_POST['site_complete_path']));
             } else {
                 $is_banned_site = 1;
             }
         }
         if ($is_banned_site == 1) {
             echo '2';
         } else {
             if ($site_exists) {
                 echo '1';
             } else {
                 echo '0';
             }
         }
         /* Extra wp_die is to stop ajax call from appending extra 0 to the resposne */
         wp_die();
     } else {
         wp_die("Please use valid forms to send data.");
     }
 }
开发者ID:boonebgorges,项目名称:nsd-site-setup-wizard,代码行数:47,代码来源:ssw.php

示例8: esc_url

<form method="post" action="<?php 
    echo esc_url($form_url);
    ?>
">
<?php 
    wp_nonce_field('bbms-migration', 'pb_bbms_migrate');
    ?>

<p><?php 
    esc_html_e('Please verify that you are sure you would like to import the backed up site into the just-created blank site. This import cannot be undone.', 'it-l10n-backupbuddy');
    ?>
</p>
<p>
<?php 
    if (is_subdomain_install()) {
        if (domain_exists($blog_domain, '/', $current_blog->blog_id)) {
            //$newdomain = $blog_domain;
            $newdomain = $domain;
            $path = $blog_domain . '/';
        } else {
            $path = $domain . '.' . preg_replace('|^www\\.|', '', $current_blog->domain);
        }
        ?>
	<?php 
        echo '<strong>http://' . $path . '</strong>';
    } else {
        echo 'http://' . $current_blog->domain . '<strong>' . $path . '</strong>';
    }
    ?>
</p>
<input type="hidden" name="backup_file" value="<?php 
开发者ID:verbazend,项目名称:AWFA,代码行数:31,代码来源:_step2.php

示例9: test_slashed_path_in_domain_exists

 /**
  * When a path is passed to domain_exists, it is immediately trailing slashed. A path
  * value with or without the slash should result in the same return value.
  */
 function test_slashed_path_in_domain_exists()
 {
     add_filter('domain_exists', array($this, '_domain_exists_cb'), 10, 4);
     $exists1 = domain_exists('foo', 'bar');
     $exists2 = domain_exists('foo', 'bar/');
     remove_filter('domain_exists', array($this, '_domain_exists_cb'), 10, 4);
     // Make sure the same result is returned with or without a trailing slash
     $this->assertEquals($exists1, $exists2);
 }
开发者ID:ntwb,项目名称:wordpress-travis,代码行数:13,代码来源:site.php

示例10: wp_validate_site_url

 /**
  * Is a site URL okay to save?
  *
  * @since 1.8.0
  *
  * @global wpdb $wpdb
  *
  * @param string $domain
  * @param string $path
  * @param string $slug
  *
  * @return boolean
  */
 function wp_validate_site_url($domain, $path, $site_id = 0)
 {
     global $wpdb;
     // Does domain exist on this network
     $exists = domain_exists($domain, $path, get_current_site()->id);
     // Bail if domain is current site ID
     if ($exists == $site_id) {
         return true;
     }
     // Bail if domain exists and it's not this site
     if (true === $exists) {
         return false;
     }
     // Bail if site is in signups table
     $signup = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->signups} WHERE domain = %s AND path = %s", $domain, $path));
     if (!empty($signup)) {
         return false;
     }
     // Bail if user is a super admin
     if (is_super_admin()) {
         return true;
     }
     // Get pieces of domain & path
     $paths = explode('/', $path);
     $domains = substr_count($domain, '.') > 1 ? (array) substr($domain, 0, strpos($domain, '.')) : array();
     $pieces = array_filter(array_merge($domains, $paths));
     // Loop through pieces
     foreach ($pieces as $slug) {
         // Bail if empty
         if (empty($slug)) {
             return false;
         }
         // Bail if not lowercase or numbers
         if (preg_match('/[^a-z0-9]+/', $slug)) {
             return false;
         }
         // All numeric?
         if (preg_match('/^[0-9]*$/', $slug)) {
             return false;
         }
         // Bail if less than 4 chars
         if (strlen($slug) < 3) {
             return false;
         }
         // Get illegal names
         $illegal_names = get_site_option('illegal_names');
         // Maybe merge reserved names
         if (!is_subdomain_install()) {
             $illegal_names = array_merge($illegal_names, get_subdirectory_reserved_names());
         }
         // Bail if contains illegal names
         if (in_array($slug, $illegal_names, true)) {
             return false;
         }
         // Bail if username exists
         if (username_exists($slug)) {
             return false;
         }
         // Bail if subdirectory install and page exists on primary site of network
         if (!is_subdomain_install()) {
             switch_to_blog(get_current_site()->blog_id);
             $page = get_page_by_path($slug);
             restore_current_blog();
             if (!empty($page)) {
                 return false;
             }
         }
     }
     // Okay, s'all good
     return true;
 }
开发者ID:stuttter,项目名称:wp-multi-network,代码行数:84,代码来源:compat.php

示例11: pmpron_checkSiteName

function pmpron_checkSiteName($sitename)
{
    global $pmpro_msg, $pmpro_msgt, $current_site;
    //they entered something. is it available
    $site_domain = preg_replace('|^www\\.|', '', $current_site->domain);
    if (!is_subdomain_install()) {
        $site = $current_site->domain;
        $path = $current_site->path . "/" . $sitename;
    } else {
        $site = $sitename . '.' . $site_domain;
        $path = $current_site->path;
    }
    $domain = preg_replace('/\\s+/', '', sanitize_user($site, true));
    if (is_subdomain_install()) {
        $domain = str_replace('@', '', $domain);
    }
    if (empty($path)) {
        $path = '/';
    }
    // Check if the domain has been used already. We should return an error message.
    if (domain_exists($domain, $path)) {
        //dupe
        $pmpro_msg = "That site name is already in use.";
        $pmpro_msgt = "pmpro_error";
        return false;
    } else {
        //looks good
        return true;
    }
}
开发者ID:rakesh-mohanta,项目名称:pmpro-network,代码行数:30,代码来源:pmpro-network.php

示例12: CheckTextBox

 public function CheckTextBox($surname, $name, $NameOfFather, $NameOfMother, $Address, $Phone, $DateOfBorn, $Age, $PoliceID, $AMKA, $NumberIdentificationIKA, $AFM, $Situation, $RelationshipOfWork, $DateOfUptake, $Service, $Section, $Node, $Specialty, $GradeSelection, $NumsFor0To6, $Email, $NumberIdentificationEmployee)
 {
     //                        echo "Άδεια οδήγησης οχήματος(After): ".$DriveLicense."<br>";
     //                        echo "Κάρτα POL(After): ".$CardPOL."<br>";
     //                        echo "Ημερομηνία πρόσληψης: ".$DateOfUptake."<br>";
     //                        $FieldArray = array(0=>$name, 1=>$surname, 2=>$PoliceID, 3=>$NameOfFather,
     //                                            4=>$NameOfMother, 5=>$DateOfBorn, 6=>$Situation, 7=>$RelationshipOfWork,
     //                                            8=>$DateOfUptake, 9=>$Specialty, 10=>$Phone, 11=>$AFM, 12=>$Service,
     //                                            13=>$AMKA, 14=>$Age, 15=>$NumsFor0To6, 16=>$GradeSelection, 17=>$Address,
     //                                            18=>$Section, 19=>$Email, 20=>$Node);
     //                        $LengthOfFieldArray = count($FieldArray);
     if (!is_numeric($NumberIdentificationEmployee) || strlen($NumberIdentificationEmployee) != 6) {
         $this->failed = true;
         $this->NumberIdentificationEmployeeFailed = true;
     }
     if (!is_numeric($NumberIdentificationIKA) || strlen($NumberIdentificationIKA) != 7) {
         $this->failed = true;
         $this->NumberIdentificationIKAFailed = true;
     }
     if (is_numeric($Age) == false || ($Age < 18 || $Age > 80)) {
         $this->failed = true;
         $this->AgeFailed = true;
     }
     if (is_numeric($AFM) == false || strlen($AFM) != 9) {
         $this->failed = true;
         $this->AFMfailed = true;
     }
     if ((is_numeric($AMKA) == false || strlen($AMKA) != 11) && $AMKA != null) {
         $this->failed = true;
         $this->AMKAfailed = true;
     }
     $PoliceIDLenght = mb_strlen($PoliceID, 'utf-8');
     //                            echo  "<br> PoliceId: ".$PoliceID." PoliceIdLength: ".$PoliceIDLenght;
     if ($PoliceIDLenght == 7 || $PoliceIDLenght == 8) {
         if ($PoliceIDLenght == 7) {
             $Firstletter = mb_substr($PoliceID, 0, 1, "utf-8");
             //Put on variable '$Firstletter' first letter of PoliceId field
             $RestLetters = mb_substr($PoliceID, 1, $PoliceIDLenght, "utf-8");
             //Put on variable '$RestLetters' restt letters of PoliceId field
             if (!is_string($Firstletter) || !is_numeric($RestLetters)) {
                 $this->failed = true;
                 $this->PoliceIdfailed = true;
             }
         }
         if ($PoliceIDLenght == 8) {
             $First2letters = mb_substr($PoliceID, 0, 2, "utf-8");
             //Put on variable '$First2letters' first 2 letters of PoliceId field
             $RestLetters = mb_substr($PoliceID, 2, $PoliceIDLenght, "utf-8");
             //Put on variable '$RestLetters' restt letters of PoliceId field
             if (!is_string($First2letters) || !is_numeric($RestLetters)) {
                 $this->failed = true;
                 $this->PoliceIdfailed = true;
             }
         }
     } else {
         $this->failed = true;
         $this->PoliceIdLengthFailed = true;
     }
     if (strlen($Phone) != 10 && $Phone != null) {
         $this->failed = true;
         $this->PhoneFailed = true;
     } else {
         if (!is_numeric($Phone) && $Phone != null) {
             $this->failed = true;
             $this->PhoneStirngFailed = true;
         } else {
             if ($Phone == null) {
             }
         }
     }
     if (check_email_address($Email) == true && $Email != null) {
         if (domain_exists($Email)) {
         } else {
             $this->failed = true;
             $this->EmailFailed = true;
         }
     } else {
         if ($Email == null || ($Email = " ")) {
         } else {
             $this->failed = true;
             $this->EmailFormFailed = true;
         }
     }
 }
开发者ID:GeorgeKaraxalios,项目名称:Management-of-Employees,代码行数:84,代码来源:CheckTextBoxes.php

示例13:

    } else {
        echo $avaible . $lang['Pstrong'];
    }
    exit;
}
if (isset($_POST["checkRepass"])) {
    if ($_POST["checkRepass"] === $_POST["checkpassO"]) {
        echo $avaible . $lang["PGood"];
    } else {
        echo $notAvaible . $lang['PdoesnotMatch'];
    }
    exit;
}
if (isset($_POST["checkMail"])) {
    if (filter_var($_POST["checkMail"], FILTER_VALIDATE_EMAIL)) {
        if (domain_exists($_POST["checkMail"])) {
            echo $avaible . $lang["PGood"];
        } else {
            echo $notAvaible . $lang["PDomainNotExist"];
        }
    } else {
        echo $notAvaible . $lang["PBadSyntax"];
    }
    exit;
}
//check we have username post var
if (isset($_POST["checkUsername"])) {
    //check if its an ajax request, exit if not
    if (!isset($_SERVER['HTTP_X_REQUESTED_WITH']) and strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') {
        die;
    }
开发者ID:doio,项目名称:Bittytorrent,代码行数:31,代码来源:registration.php

示例14: domain_exists

<?php

// ------------------------------------------------------------
// VALIDATE E-MAIL
// ------------------------------------------------------------
if (!filter_var($txbEmail, FILTER_VALIDATE_EMAIL)) {
    $emailNotValid = $email_error;
    $emailValidate_error = 1;
}
// ------------------------------------------------------------
// WARNING! THE BELOW CODE REQUIRES PHP 5.3 OR LATER on windows
// ------------------------------------------------------------
if (filter_var($txbEmail, FILTER_VALIDATE_EMAIL)) {
    if (domain_exists($txbEmail)) {
        $emailValidate_error = 0;
    } else {
        $emailNotValid = $emailMx_error;
        $emailValidate_error = 1;
    }
}
// check if mx records exist
function domain_exists($emailtocheck, $record = 'MX')
{
    list($user, $domain) = preg_split('/@/', $emailtocheck);
    //return checkdnsrr($domain,$record);
    return 1;
}
开发者ID:amitjoy,项目名称:other-php,代码行数:27,代码来源:validate_email.php

示例15: generate_new_blogid

 private function generate_new_blogid()
 {
     $blog_title = __('Migrated site (from UpdraftPlus)', 'updraftplus');
     if (empty($_POST['updraftplus_migrate_blogname'])) {
         $this->getinfo_form();
         return false;
     }
     // Verify value given
     $result = wpmu_validate_blog_signup($_POST['updraftplus_migrate_blogname'], $blog_title);
     if (count($result['errors']) > 0 && $result['errors']->get_error_code()) {
         if (is_wp_error($result['errors'])) {
             $err_msg = '<ul style="list-style: disc inside;">';
             foreach ($result['errors']->get_error_messages() as $key => $msg) {
                 $err_msg .= '<li><strong>' . __('Error:', 'updraftplus') . '</strong> ' . htmlspecialchars($msg) . '</li>';
             }
             $err_msg .= '</ul>';
         }
         if (isset($err_msg)) {
             $this->getinfo_form($err_msg, $_POST['updraftplus_migrate_blogname']);
             return false;
         }
     }
     $blogname = $_POST['updraftplus_migrate_blogname'];
     global $wpdb;
     if (domain_exists($result['domain'], $result['path'], $wpdb->siteid)) {
         // A WordPress-native string
         $this->getinfo_form(__('<strong>ERROR</strong>: Site URL already taken.'), $_POST['updraftplus_migrate_blogname']);
         return false;
     }
     $create = create_empty_blog($result['domain'], $result['path'], $blog_title, $wpdb->siteid);
     if (is_integer($create)) {
         $url = untrailingslashit($result['domain'] . $result['path']);
         echo '<strong>' . __('New site:', 'updraftplus') . '</strong> ' . $url . '<br>';
         // Update record of what we want to rewrite the URLs to in the search/replace operation
         // TODO: How to detect whether http or https???
         $this->siteurl = 'http://' . $url;
         // ???
         $this->home = 'http://' . $url;
         return $create;
     } else {
         $this->getinfo_form(print_r($create, true), $_POST['updraftplus_migrate_blogname']);
         return false;
     }
 }
开发者ID:beyond-z,项目名称:braven,代码行数:44,代码来源:migrator.php


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