summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib_ldap.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/lib_ldap.php')
-rw-r--r--apps/user_ldap/lib_ldap.php46
1 files changed, 45 insertions, 1 deletions
diff --git a/apps/user_ldap/lib_ldap.php b/apps/user_ldap/lib_ldap.php
index 62e478597bd..afb442e05f3 100644
--- a/apps/user_ldap/lib_ldap.php
+++ b/apps/user_ldap/lib_ldap.php
@@ -21,7 +21,9 @@
*
*/
- class OC_LDAP {
+define(LDAP_GROUP_MEMBER_ASSOC_ATTR,'memberUid');
+
+class OC_LDAP {
static protected $ldapConnectionRes = false;
static protected $configured = false;
@@ -65,6 +67,48 @@
}
/**
+ * @brief combines the input filters with AND
+ * @param $filters array, the filters to connect
+ * @returns the combined filter
+ *
+ * Combines Filter arguments with AND
+ */
+ static public function combineFilterWithAnd($filters) {
+ return self::combineFilter($filters,'&');
+ }
+
+ /**
+ * @brief combines the input filters with AND
+ * @param $filters array, the filters to connect
+ * @returns the combined filter
+ *
+ * Combines Filter arguments with AND
+ */
+ static public function combineFilterWithOr($filters) {
+ return self::combineFilter($filters,'|');
+ }
+
+ /**
+ * @brief combines the input filters with given operator
+ * @param $filters array, the filters to connect
+ * @param $operator either & or |
+ * @returns the combined filter
+ *
+ * Combines Filter arguments with AND
+ */
+ static private function combineFilter($filters, $operator) {
+ $combinedFilter = '('.$operator;
+ foreach($filters as $filter) {
+ if(substr($filter,0,1) != '(') {
+ $filter = '('.$filter.')';
+ }
+ $combinedFilter.=$filter;
+ }
+ $combinedFilter.=')';
+ return $combinedFilter;
+ }
+
+ /**
* Returns the LDAP handler
*/
static private function getConnectionResource() {