当前位置: 首页>>代码示例>>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;未经允许,请勿转载。