當前位置: 首頁>>代碼示例>>PHP>>正文


PHP module_controller::nosub方法代碼示例

本文整理匯總了PHP中module_controller::nosub方法的典型用法代碼示例。如果您正苦於以下問題:PHP module_controller::nosub方法的具體用法?PHP module_controller::nosub怎麽用?PHP module_controller::nosub使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在module_controller的用法示例。


在下文中一共展示了module_controller::nosub方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: CheckCreateForErrors

 static function CheckCreateForErrors($domain)
 {
     global $zdbh;
     // Check for spaces and remove if found...
     $domain = strtolower(str_replace(' ', '', $domain));
     // Check to make sure the domain is not blank before we go any further...
     if ($domain == '') {
         self::$blank = TRUE;
         return FALSE;
     }
     // Check for invalid characters in the domain...
     if (!self::IsValidDomainName($domain)) {
         self::$badname = TRUE;
         return FALSE;
     }
     // Check to make sure the domain is in the correct format before we go any further...
     if (strpos($domain, 'www.') === 0) {
         self::$error = TRUE;
         return FALSE;
     }
     // Check to see if the domain already exists in Sentora somewhere and redirect if it does....
     $sql = "SELECT COUNT(*) FROM x_vhosts WHERE vh_name_vc=:domain AND vh_deleted_ts IS NULL";
     $numrows = $zdbh->prepare($sql);
     $numrows->bindParam(':domain', $domain);
     if ($numrows->execute()) {
         if ($numrows->fetchColumn() > 0) {
             self::$alreadyexists = TRUE;
             return FALSE;
         }
     }
     // Check to make sure user not adding a subdomain and blocks stealing of subdomains....
     // Get shared domain list
     $SharedDomains = array();
     $a = explode(',', ctrl_options::GetSystemOption('shared_domains'));
     foreach ($a as $b) {
         $SharedDomains[] = $b;
     }
     if (substr_count($domain, ".") > 1) {
         $part = explode('.', $domain);
         foreach ($part as $check) {
             if (!in_array($check, $SharedDomains)) {
                 if (strlen($check) > 13) {
                     $sql = $zdbh->prepare("SELECT * FROM x_vhosts WHERE vh_name_vc LIKE :check AND vh_type_in !=2 AND vh_deleted_ts IS NULL");
                     $checkSql = '%' . $check . '%';
                     $sql->bindParam(':check', $checkSql);
                     $sql->execute();
                     while ($rowcheckdomains = $sql->fetch()) {
                         $subpart = explode('.', $rowcheckdomains['vh_name_vc']);
                         foreach ($subpart as $subcheck) {
                             if (strlen($subcheck) > 3) {
                                 if ($subcheck == $check) {
                                     if (substr($domain, -7) == substr($rowcheckdomains['vh_name_vc'], -7)) {
                                         self::$nosub = TRUE;
                                         return FALSE;
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return TRUE;
 }
開發者ID:bbspike,項目名稱:sentora-core,代碼行數:65,代碼來源:controller.ext.php


注:本文中的module_controller::nosub方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。