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


PHP AJXP_Utils::likeToLike方法代码示例

本文整理汇总了PHP中AJXP_Utils::likeToLike方法的典型用法代码示例。如果您正苦于以下问题:PHP AJXP_Utils::likeToLike方法的具体用法?PHP AJXP_Utils::likeToLike怎么用?PHP AJXP_Utils::likeToLike使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AJXP_Utils的用法示例。


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

示例1: getUsersCount

 public function getUsersCount($baseGroup = "/", $regexp = "", $filterProperty = null, $filterValue = null, $recursive = true)
 {
     // WITH PARENT
     // SELECT COUNT(*) FROM ajxp_users AS u, ajxp_user_rights AS r WHERE u.groupPath LIKE '/%' AND r.login=u.login AND r.repo_uuid = 'ajxp.parent_user'
     // WITH SPECIFIC PARENT 'username'
     // SELECT COUNT(*) FROM ajxp_users AS u, ajxp_user_rights AS r WHERE u.groupPath LIKE '/%' AND r.login=u.login AND r.repo_uuid = 'ajxp.parent_user' AND r.rights = 'username'
     // WITHOUT PARENT
     // SELECT COUNT(*) FROM ajxp_users AS u WHERE NOT EXISTS (SELECT * FROM ajxp_user_rights AS c WHERE c.login=u.login AND c.repo_uuid='ajxp.parent_user')
     $ands = array();
     $select = "SELECT COUNT(*) FROM [ajxp_users] AS u WHERE %and";
     if (!empty($regexp)) {
         $ands[] = array("[u.login] " . AJXP_Utils::regexpToLike($regexp), AJXP_Utils::cleanRegexp($regexp));
     }
     if ($recursive) {
         $ands[] = array("[u.groupPath] LIKE %like~", $baseGroup);
     } else {
         $ands[] = array("[u.groupPath] = %s", $baseGroup);
     }
     $ands[] = array("NOT EXISTS (SELECT * FROM [ajxp_user_rights] AS c WHERE [c.login]=[u.login] AND [c.repo_uuid] = 'ajxp.hidden')");
     if ($filterProperty !== null && $filterValue !== null) {
         if ($filterProperty == "parent") {
             $filterProperty = "ajxp.parent_user";
         } else {
             if ($filterProperty == "admin") {
                 $filterProperty = "ajxp.admin";
             }
         }
         if ($filterValue == AJXP_FILTER_EMPTY) {
             $ands[] = array("NOT EXISTS (SELECT * FROM [ajxp_user_rights] AS c WHERE [c.login]=[u.login] AND [c.repo_uuid] = %s)", $filterProperty);
         } else {
             if ($filterValue == AJXP_FILTER_NOT_EMPTY) {
                 $select = "SELECT COUNT(*) FROM [ajxp_users] AS u, [ajxp_user_rights] AS r WHERE %and";
                 $ands[] = array("[r.login]=[u.login]");
                 $ands[] = array("[r.repo_uuid] = %s", $filterProperty);
             } else {
                 $select = "SELECT COUNT(*) FROM [ajxp_users] AS u, [ajxp_user_rights] AS r WHERE %and";
                 $ands[] = array("[r.login]=[u.login]");
                 $ands[] = array("[r.repo_uuid] = %s", $filterProperty);
                 $ands[] = array("[r.rights] " . AJXP_Utils::likeToLike($filterValue), AJXP_Utils::cleanLike($filterValue));
             }
         }
     }
     $res = dibi::query($select, $ands);
     return $res->fetchSingle();
 }
开发者ID:rcmarotz,项目名称:pydio-core,代码行数:45,代码来源:class.sqlAuthDriver.php


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