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


PHP Access::getSqlAccessSite方法代碼示例

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


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

示例1: getSitesIdFromSiteUrl

    /**
     * Returns the list of websites ID associated with a URL.
     *
     * @param string $url
     * @return array list of websites ID
     */
    public function getSitesIdFromSiteUrl($url)
    {
        $url = $this->removeTrailingSlash($url);
        list($url, $urlBis) = $this->getNormalizedUrls($url);
        if (Piwik::hasUserSuperUserAccess()) {
            $ids = Db::get()->fetchAll('SELECT idsite
                FROM ' . Common::prefixTable('site') . '
					WHERE (main_url = ? OR main_url = ?) ' . 'UNION
                SELECT idsite
                FROM ' . Common::prefixTable('site_url') . '
					WHERE (url = ? OR url = ?) ', array($url, $urlBis, $url, $urlBis));
        } else {
            $login = Piwik::getCurrentUserLogin();
            $ids = Db::get()->fetchAll('SELECT idsite
                FROM ' . Common::prefixTable('site') . '
					WHERE (main_url = ? OR main_url = ?)' . 'AND idsite IN (' . Access::getSqlAccessSite('idsite') . ') ' . 'UNION
                SELECT idsite
                FROM ' . Common::prefixTable('site_url') . '
					WHERE (url = ? OR url = ?)' . 'AND idsite IN (' . Access::getSqlAccessSite('idsite') . ')', array($url, $urlBis, $login, $url, $urlBis, $login));
        }
        return $ids;
    }
開發者ID:a4tunado,項目名稱:piwik,代碼行數:28,代碼來源:API.php

示例2: getSitesIdFromSiteUrlHavingAccess

 /**
  * Returns the list of websites ID associated with a URL.
  *
  * @param string $login
  * @param array $urls
  * @return array list of websites ID
  */
 public function getSitesIdFromSiteUrlHavingAccess($login, $urls)
 {
     $siteUrlTable = Common::prefixTable('site_url');
     $sqlAccessSite = Access::getSqlAccessSite('idsite');
     $ids = $this->db->fetchAll('SELECT idsite
             FROM ' . $this->table . '
                 WHERE main_url IN ( ' . Common::getSqlStringFieldsArray($urls) . ')' . 'AND idsite IN (' . $sqlAccessSite . ') ' . 'UNION
             SELECT idsite
             FROM ' . $siteUrlTable . '
                 WHERE url IN ( ' . Common::getSqlStringFieldsArray($urls) . ')' . 'AND idsite IN (' . $sqlAccessSite . ')', array_merge($urls, array($login), $urls, array($login)));
     return $ids;
 }
開發者ID:FluentDevelopment,項目名稱:piwik,代碼行數:19,代碼來源:Model.php

示例3: getSitesIdFromSiteUrlHavingAccess

 /**
  * Returns the list of websites ID associated with a URL.
  *
  * @param string $url
  * @return array list of websites ID
  */
 public function getSitesIdFromSiteUrlHavingAccess($url, $urlBis, $login)
 {
     $siteUrlTable = Common::prefixTable('site_url');
     $sqlAccessSite = Access::getSqlAccessSite('idsite');
     $ids = $this->getDb()->fetchAll('SELECT idsite
             FROM ' . $this->table . '
                 WHERE (main_url = ? OR main_url = ?)' . 'AND idsite IN (' . $sqlAccessSite . ') ' . 'UNION
             SELECT idsite
             FROM ' . $siteUrlTable . '
                 WHERE (url = ? OR url = ?)' . 'AND idsite IN (' . $sqlAccessSite . ')', array($url, $urlBis, $login, $url, $urlBis, $login));
     return $ids;
 }
開發者ID:TensorWrenchOSS,項目名稱:piwik,代碼行數:18,代碼來源:Model.php


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