summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap')
-rw-r--r--apps/user_ldap/group_ldap.php4
-rw-r--r--apps/user_ldap/l10n/da.php1
-rw-r--r--apps/user_ldap/l10n/de.php2
-rw-r--r--apps/user_ldap/l10n/el.php11
-rw-r--r--apps/user_ldap/l10n/es_AR.php37
-rw-r--r--apps/user_ldap/l10n/et_EE.php22
-rw-r--r--apps/user_ldap/l10n/pt_BR.php37
-rw-r--r--apps/user_ldap/l10n/ru_RU.php22
-rw-r--r--apps/user_ldap/l10n/uk.php4
-rw-r--r--apps/user_ldap/l10n/vi.php13
-rw-r--r--apps/user_ldap/l10n/zh_CN.GB2312.php37
-rw-r--r--apps/user_ldap/l10n/zh_CN.php9
-rw-r--r--apps/user_ldap/lib/access.php59
-rw-r--r--apps/user_ldap/lib/connection.php4
-rw-r--r--apps/user_ldap/lib/jobs.php2
-rw-r--r--apps/user_ldap/user_ldap.php2
16 files changed, 239 insertions, 27 deletions
diff --git a/apps/user_ldap/group_ldap.php b/apps/user_ldap/group_ldap.php
index 5ec259f6c47..389679b80bd 100644
--- a/apps/user_ldap/group_ldap.php
+++ b/apps/user_ldap/group_ldap.php
@@ -143,7 +143,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
if(!empty($this->groupSearch)) {
$groupUsers = array_filter($groupUsers, array($this, 'groupMatchesFilter'));
}
- if($limit = -1) {
+ if($limit == -1) {
$limit = null;
}
return array_slice($groupUsers, $offset, $limit);
@@ -187,7 +187,7 @@ class GROUP_LDAP extends lib\Access implements \OCP\GroupInterface {
if(!empty($this->groupSearch)) {
$groupUsers = array_filter($groupUsers, array($this, 'groupMatchesFilter'));
}
- if($limit = -1) {
+ if($limit == -1) {
$limit = null;
}
return array_slice($groupUsers, $offset, $limit);
diff --git a/apps/user_ldap/l10n/da.php b/apps/user_ldap/l10n/da.php
index f01c7b71108..f0589b33a93 100644
--- a/apps/user_ldap/l10n/da.php
+++ b/apps/user_ldap/l10n/da.php
@@ -1,5 +1,6 @@
<?php $TRANSLATIONS = array(
"Host" => "Host",
+"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Du kan udelade protokollen, medmindre du skal bruge SSL. Start i så fald med ldaps://",
"Base DN" => "Base DN",
"Password" => "Kodeord",
"Port" => "Port",
diff --git a/apps/user_ldap/l10n/de.php b/apps/user_ldap/l10n/de.php
index 2c178d0b4fd..df676711792 100644
--- a/apps/user_ldap/l10n/de.php
+++ b/apps/user_ldap/l10n/de.php
@@ -24,7 +24,7 @@
"Do not use it for SSL connections, it will fail." => "Verwenden Sie es nicht für SSL-Verbindungen, es wird fehlschlagen.",
"Case insensitve LDAP server (Windows)" => "LDAP-Server (Windows: Groß- und Kleinschreibung bleibt unbeachtet)",
"Turn off SSL certificate validation." => "Schalte die SSL-Zertifikatsprüfung aus.",
-"If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Falls die Verbindung es erfordert, wird das SSL-Zertifikat des LDAP-Server importiert werden.",
+"If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Falls die Verbindung es erfordert, muss das SSL-Zertifikat des LDAP-Server importiert werden.",
"Not recommended, use for testing only." => "Nicht empfohlen, nur zu Testzwecken.",
"User Display Name Field" => "Feld für den Anzeigenamen des Benutzers",
"The LDAP attribute to use to generate the user`s ownCloud name." => "Das LDAP-Attribut für die Generierung des Benutzernamens in ownCloud. ",
diff --git a/apps/user_ldap/l10n/el.php b/apps/user_ldap/l10n/el.php
index 2f3c747a672..1bb72f163a7 100644
--- a/apps/user_ldap/l10n/el.php
+++ b/apps/user_ldap/l10n/el.php
@@ -1,6 +1,17 @@
<?php $TRANSLATIONS = array(
+"Base DN" => "Base DN",
+"User DN" => "User DN",
"Password" => "Συνθηματικό",
+"User Login Filter" => "User Login Filter",
+"User List Filter" => "User List Filter",
+"Group Filter" => "Group Filter",
"Port" => "Θύρα",
+"Base User Tree" => "Base User Tree",
+"Base Group Tree" => "Base Group Tree",
+"Group-Member association" => "Group-Member association",
+"Use TLS" => "Χρήση TLS",
+"User Display Name Field" => "User Display Name Field",
+"Group Display Name Field" => "Group Display Name Field",
"in bytes" => "σε bytes",
"Help" => "Βοήθεια"
);
diff --git a/apps/user_ldap/l10n/es_AR.php b/apps/user_ldap/l10n/es_AR.php
new file mode 100644
index 00000000000..6bd452e9d90
--- /dev/null
+++ b/apps/user_ldap/l10n/es_AR.php
@@ -0,0 +1,37 @@
+<?php $TRANSLATIONS = array(
+"Host" => "Servidor",
+"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Podés omitir el protocolo, excepto si SSL es requerido. En ese caso, empezá con ldaps://",
+"Base DN" => "DN base",
+"You can specify Base DN for users and groups in the Advanced tab" => "Podés especificar el DN base para usuarios y grupos en la pestaña \"Avanzado\"",
+"User DN" => "DN usuario",
+"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "El DN del usuario cliente con el que se hará la asociación, p.ej. uid=agente,dc=ejemplo,dc=com. Para acceso anónimo, dejá DN y contraseña vacíos.",
+"Password" => "Contraseña",
+"For anonymous access, leave DN and Password empty." => "Para acceso anónimo, dejá DN y contraseña vacíos.",
+"User Login Filter" => "Filtro de inicio de sesión de usuario",
+"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action." => "Define el filtro a aplicar cuando se ha realizado un login. %%uid remplazará el nombre de usuario en el proceso de inicio de sesión.",
+"use %%uid placeholder, e.g. \"uid=%%uid\"" => "usar %%uid como plantilla, p. ej.: \"uid=%%uid\"",
+"User List Filter" => "Lista de filtros de usuario",
+"Defines the filter to apply, when retrieving users." => "Define el filtro a aplicar, cuando se obtienen usuarios.",
+"without any placeholder, e.g. \"objectClass=person\"." => "Sin plantilla, p. ej.: \"objectClass=person\".",
+"Group Filter" => "Filtro de grupo",
+"Defines the filter to apply, when retrieving groups." => "Define el filtro a aplicar cuando se obtienen grupos.",
+"without any placeholder, e.g. \"objectClass=posixGroup\"." => "Sin ninguna plantilla, p. ej.: \"objectClass=posixGroup\".",
+"Port" => "Puerto",
+"Base User Tree" => "Árbol base de usuario",
+"Base Group Tree" => "Árbol base de grupo",
+"Group-Member association" => "Asociación Grupo-Miembro",
+"Use TLS" => "Usar TLS",
+"Do not use it for SSL connections, it will fail." => "No usarlo para SSL, dará error.",
+"Case insensitve LDAP server (Windows)" => "Servidor de LDAP sensible a mayúsculas/minúsculas (Windows)",
+"Turn off SSL certificate validation." => "Desactivar la validación por certificado SSL.",
+"If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Si la conexión sólo funciona con esta opción, importá el certificado SSL del servidor LDAP en tu servidor ownCloud.",
+"Not recommended, use for testing only." => "No recomendado, sólo para pruebas.",
+"User Display Name Field" => "Campo de nombre de usuario a mostrar",
+"The LDAP attribute to use to generate the user`s ownCloud name." => "El atributo LDAP a usar para generar el nombre de usuario de ownCloud.",
+"Group Display Name Field" => "Campo de nombre de grupo a mostrar",
+"The LDAP attribute to use to generate the groups`s ownCloud name." => "El atributo LDAP a usar para generar el nombre de los grupos de ownCloud.",
+"in bytes" => "en bytes",
+"in seconds. A change empties the cache." => "en segundos. Cambiarlo vacía la cache.",
+"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Vacío para el nombre de usuario (por defecto). En otro caso, especificá un atributo LDAP/AD.",
+"Help" => "Ayuda"
+);
diff --git a/apps/user_ldap/l10n/et_EE.php b/apps/user_ldap/l10n/et_EE.php
index d62e1212dc7..f83142225e2 100644
--- a/apps/user_ldap/l10n/et_EE.php
+++ b/apps/user_ldap/l10n/et_EE.php
@@ -1,9 +1,31 @@
<?php $TRANSLATIONS = array(
"Host" => "Host",
+"Base DN" => "Baas DN",
+"User DN" => "Kasutaja DN",
"Password" => "Parool",
+"User Login Filter" => "Kasutajanime filter",
+"use %%uid placeholder, e.g. \"uid=%%uid\"" => "kasuta %%uid kohatäitjat, nt. \"uid=%%uid\"",
+"User List Filter" => "Kasutajate nimekirja filter",
+"Defines the filter to apply, when retrieving users." => "Määrab kasutajaid hankides filtri, mida rakendatakse.",
+"without any placeholder, e.g. \"objectClass=person\"." => "ilma ühegi kohatäitjata, nt. \"objectClass=person\".",
"Group Filter" => "Grupi filter",
+"Defines the filter to apply, when retrieving groups." => "Määrab gruppe hankides filtri, mida rakendatakse.",
+"without any placeholder, e.g. \"objectClass=posixGroup\"." => "ilma ühegi kohatäitjata, nt. \"objectClass=posixGroup\".",
"Port" => "Port",
+"Base User Tree" => "Baaskasutaja puu",
+"Base Group Tree" => "Baasgrupi puu",
+"Group-Member association" => "Grupiliikme seotus",
"Use TLS" => "Kasutaja TLS",
+"Do not use it for SSL connections, it will fail." => "Ära kasuta seda SSL ühenduse jaoks, see ei toimi.",
+"Case insensitve LDAP server (Windows)" => "Mittetõstutundlik LDAP server (Windows)",
+"Turn off SSL certificate validation." => "Lülita SSL sertifikaadi kontrollimine välja.",
+"Not recommended, use for testing only." => "Pole soovitatav, kasuta ainult testimiseks.",
+"User Display Name Field" => "Kasutaja näidatava nime väli",
+"The LDAP attribute to use to generate the user`s ownCloud name." => "LDAP omadus, mida kasutatakse kasutaja ownCloudi nime loomiseks.",
+"Group Display Name Field" => "Grupi näidatava nime väli",
+"The LDAP attribute to use to generate the groups`s ownCloud name." => "LDAP omadus, mida kasutatakse ownCloudi grupi nime loomiseks.",
"in bytes" => "baitides",
+"in seconds. A change empties the cache." => "sekundites. Muudatus tühjendab vahemälu.",
+"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Kasutajanime (vaikeväärtus) kasutamiseks jäta tühjaks. Vastasel juhul määra LDAP/AD omadus.",
"Help" => "Abiinfo"
);
diff --git a/apps/user_ldap/l10n/pt_BR.php b/apps/user_ldap/l10n/pt_BR.php
new file mode 100644
index 00000000000..18eed6d0142
--- /dev/null
+++ b/apps/user_ldap/l10n/pt_BR.php
@@ -0,0 +1,37 @@
+<?php $TRANSLATIONS = array(
+"Host" => "Host",
+"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Você pode omitir o protocolo, exceto quando requerer SSL. Então inicie com ldaps://",
+"Base DN" => "DN Base",
+"You can specify Base DN for users and groups in the Advanced tab" => "Você pode especificar DN Base para usuários e grupos na guia Avançada",
+"User DN" => "DN Usuário",
+"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "O DN do cliente usuário com qual a ligação deverá ser feita, ex. uid=agent,dc=example,dc=com. Para acesso anônimo, deixe DN e Senha vazios.",
+"Password" => "Senha",
+"For anonymous access, leave DN and Password empty." => "Para acesso anônimo, deixe DN e Senha vazios.",
+"User Login Filter" => "Filtro de Login de Usuário",
+"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action." => "Define o filtro pra aplicar ao efetuar uma tentativa de login. %%uuid substitui o nome de usuário na ação de login.",
+"use %%uid placeholder, e.g. \"uid=%%uid\"" => "use %%uid placeholder, ex. \"uid=%%uid\"",
+"User List Filter" => "Filtro de Lista de Usuário",
+"Defines the filter to apply, when retrieving users." => "Define filtro a aplicar ao obter usuários.",
+"without any placeholder, e.g. \"objectClass=person\"." => "sem nenhum espaço reservado, ex. \"objectClass=person\".",
+"Group Filter" => "Filtro de Grupo",
+"Defines the filter to apply, when retrieving groups." => "Define o filtro a aplicar ao obter grupos.",
+"without any placeholder, e.g. \"objectClass=posixGroup\"." => "sem nenhum espaço reservado, ex. \"objectClass=posixGroup\"",
+"Port" => "Porta",
+"Base User Tree" => "Árvore de Usuário Base",
+"Base Group Tree" => "Árvore de Grupo Base",
+"Group-Member association" => "Associação Grupo-Membro",
+"Use TLS" => "Usar TLS",
+"Do not use it for SSL connections, it will fail." => "Não use-o para conexões SSL, pois falhará.",
+"Case insensitve LDAP server (Windows)" => "Servidor LDAP sensível à caixa alta (Windows)",
+"Turn off SSL certificate validation." => "Desligar validação de certificado SSL.",
+"If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "Se a conexão só funciona com essa opção, importe o certificado SSL do servidor LDAP no seu servidor ownCloud.",
+"Not recommended, use for testing only." => "Não recomendado, use somente para testes.",
+"User Display Name Field" => "Campo Nome de Exibição de Usuário",
+"The LDAP attribute to use to generate the user`s ownCloud name." => "O atributo LDAP para usar para gerar nome ownCloud do usuário.",
+"Group Display Name Field" => "Campo Nome de Exibição de Grupo",
+"The LDAP attribute to use to generate the groups`s ownCloud name." => "O atributo LDAP para usar para gerar nome ownCloud do grupo.",
+"in bytes" => "em bytes",
+"in seconds. A change empties the cache." => "em segundos. Uma mudança esvaziará o cache.",
+"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Deixe vazio para nome de usuário (padrão). Caso contrário, especifique um atributo LDAP/AD.",
+"Help" => "Ajuda"
+);
diff --git a/apps/user_ldap/l10n/ru_RU.php b/apps/user_ldap/l10n/ru_RU.php
new file mode 100644
index 00000000000..68f385358d9
--- /dev/null
+++ b/apps/user_ldap/l10n/ru_RU.php
@@ -0,0 +1,22 @@
+<?php $TRANSLATIONS = array(
+"Host" => "Хост",
+"You can omit the protocol, except you require SSL. Then start with ldaps://" => "Вы можете пропустить протокол, если Вам не требуется SSL. Затем начните с ldaps://",
+"Base DN" => "База DN",
+"User DN" => "DN пользователя",
+"Password" => "Пароль",
+"For anonymous access, leave DN and Password empty." => "Для анонимного доступа оставьте поля DN и пароль пустыми.",
+"use %%uid placeholder, e.g. \"uid=%%uid\"" => "используйте %%uid заполнитель, например, \"uid=%%uid\"",
+"without any placeholder, e.g. \"objectClass=person\"." => "без каких-либо заполнителей, например, \"objectClass=person\".",
+"Group Filter" => "Групповой фильтр",
+"without any placeholder, e.g. \"objectClass=posixGroup\"." => "без каких-либо заполнителей, например, \"objectClass=posixGroup\".",
+"Port" => "Порт",
+"Use TLS" => "Использовать TLS",
+"Do not use it for SSL connections, it will fail." => "Не используйте это SSL-соединений, это не будет выполнено.",
+"Turn off SSL certificate validation." => "Выключить проверку сертификата SSL.",
+"Not recommended, use for testing only." => "Не рекомендовано, используйте только для тестирования.",
+"The LDAP attribute to use to generate the user`s ownCloud name." => "Атрибут LDAP, используемый для создания имени пользователя в ownCloud.",
+"The LDAP attribute to use to generate the groups`s ownCloud name." => "Атрибут LDAP, используемый для создания группового имени в ownCloud.",
+"in bytes" => "в байтах",
+"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Оставьте пустым под имя пользователя (по умолчанию). В противном случае задайте LDAP/AD атрибут.",
+"Help" => "Помощь"
+);
diff --git a/apps/user_ldap/l10n/uk.php b/apps/user_ldap/l10n/uk.php
new file mode 100644
index 00000000000..fd6a88d2372
--- /dev/null
+++ b/apps/user_ldap/l10n/uk.php
@@ -0,0 +1,4 @@
+<?php $TRANSLATIONS = array(
+"Password" => "Пароль",
+"Help" => "Допомога"
+);
diff --git a/apps/user_ldap/l10n/vi.php b/apps/user_ldap/l10n/vi.php
new file mode 100644
index 00000000000..7a6ac2665c6
--- /dev/null
+++ b/apps/user_ldap/l10n/vi.php
@@ -0,0 +1,13 @@
+<?php $TRANSLATIONS = array(
+"Host" => "Máy chủ",
+"Password" => "Mật khẩu",
+"Port" => "Cổng",
+"Use TLS" => "Sử dụng TLS",
+"Turn off SSL certificate validation." => "Tắt xác thực chứng nhận SSL",
+"Not recommended, use for testing only." => "Không khuyến khích, Chỉ sử dụng để thử nghiệm.",
+"User Display Name Field" => "Hiển thị tên người sử dụng",
+"Group Display Name Field" => "Hiển thị tên nhóm",
+"in bytes" => "Theo Byte",
+"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "Để trống tên người dùng (mặc định). Nếu không chỉ định thuộc tính LDAP/AD",
+"Help" => "Giúp đỡ"
+);
diff --git a/apps/user_ldap/l10n/zh_CN.GB2312.php b/apps/user_ldap/l10n/zh_CN.GB2312.php
new file mode 100644
index 00000000000..8b906aea5ce
--- /dev/null
+++ b/apps/user_ldap/l10n/zh_CN.GB2312.php
@@ -0,0 +1,37 @@
+<?php $TRANSLATIONS = array(
+"Host" => "主机",
+"You can omit the protocol, except you require SSL. Then start with ldaps://" => "您可以忽略协议,除非您需要 SSL。然后用 ldaps:// 开头",
+"Base DN" => "基本判别名",
+"You can specify Base DN for users and groups in the Advanced tab" => "您可以在高级选项卡中为用户和群组指定基本判别名",
+"User DN" => "用户判别名",
+"The DN of the client user with which the bind shall be done, e.g. uid=agent,dc=example,dc=com. For anonymous access, leave DN and Password empty." => "客户机用户的判别名,将用于绑定,例如 uid=agent, dc=example, dc=com。匿名访问请留空判别名和密码。",
+"Password" => "密码",
+"For anonymous access, leave DN and Password empty." => "匿名访问请留空判别名和密码。",
+"User Login Filter" => "用户登录过滤器",
+"Defines the filter to apply, when login is attempted. %%uid replaces the username in the login action." => "定义尝试登录时要应用的过滤器。用 %%uid 替换登录操作中使用的用户名。",
+"use %%uid placeholder, e.g. \"uid=%%uid\"" => "使用 %%uid 占位符,例如 \"uid=%%uid\"",
+"User List Filter" => "用户列表过滤器",
+"Defines the filter to apply, when retrieving users." => "定义撷取用户时要应用的过滤器。",
+"without any placeholder, e.g. \"objectClass=person\"." => "不能使用占位符,例如 \"objectClass=person\"。",
+"Group Filter" => "群组过滤器",
+"Defines the filter to apply, when retrieving groups." => "定义撷取群组时要应用的过滤器",
+"without any placeholder, e.g. \"objectClass=posixGroup\"." => "不能使用占位符,例如 \"objectClass=posixGroup\"。",
+"Port" => "端口",
+"Base User Tree" => "基本用户树",
+"Base Group Tree" => "基本群组树",
+"Group-Member association" => "群组-成员组合",
+"Use TLS" => "使用 TLS",
+"Do not use it for SSL connections, it will fail." => "不要使用它进行 SSL 连接,会失败的。",
+"Case insensitve LDAP server (Windows)" => "大小写不敏感的 LDAP 服务器 (Windows)",
+"Turn off SSL certificate validation." => "关闭 SSL 证书校验。",
+"If connection only works with this option, import the LDAP server's SSL certificate in your ownCloud server." => "如果只有使用此选项才能连接,请导入 LDAP 服务器的 SSL 证书到您的 ownCloud 服务器。",
+"Not recommended, use for testing only." => "不推荐,仅供测试",
+"User Display Name Field" => "用户显示名称字段",
+"The LDAP attribute to use to generate the user`s ownCloud name." => "用于生成用户的 ownCloud 名称的 LDAP 属性。",
+"Group Display Name Field" => "群组显示名称字段",
+"The LDAP attribute to use to generate the groups`s ownCloud name." => "用于生成群组的 ownCloud 名称的 LDAP 属性。",
+"in bytes" => "以字节计",
+"in seconds. A change empties the cache." => "以秒计。修改会清空缓存。",
+"Leave empty for user name (default). Otherwise, specify an LDAP/AD attribute." => "用户名请留空 (默认)。否则,请指定一个 LDAP/AD 属性。",
+"Help" => "帮助"
+);
diff --git a/apps/user_ldap/l10n/zh_CN.php b/apps/user_ldap/l10n/zh_CN.php
new file mode 100644
index 00000000000..5f6200db404
--- /dev/null
+++ b/apps/user_ldap/l10n/zh_CN.php
@@ -0,0 +1,9 @@
+<?php $TRANSLATIONS = array(
+"Host" => "主机",
+"Base DN" => "Base DN",
+"You can specify Base DN for users and groups in the Advanced tab" => "您可以在高级选项卡里为用户和组指定Base DN",
+"User DN" => "User DN",
+"Password" => "密码",
+"Port" => "端口",
+"Help" => "帮助"
+);
diff --git a/apps/user_ldap/lib/access.php b/apps/user_ldap/lib/access.php
index 089548a69ba..d855ae2a163 100644
--- a/apps/user_ldap/lib/access.php
+++ b/apps/user_ldap/lib/access.php
@@ -206,21 +206,17 @@ abstract class Access {
$dn = $this->sanitizeDN($dn);
$table = $this->getMapTable($isUser);
if($isUser) {
+ $fncFindMappedName = 'findMappedUser';
$nameAttribute = $this->connection->ldapUserDisplayName;
} else {
+ $fncFindMappedName = 'findMappedGroup';
$nameAttribute = $this->connection->ldapGroupDisplayName;
}
- $query = \OCP\DB::prepare('
- SELECT `owncloud_name`
- FROM `'.$table.'`
- WHERE `ldap_dn` = ?
- ');
-
//let's try to retrieve the ownCloud name from the mappings table
- $component = $query->execute(array($dn))->fetchOne();
- if($component) {
- return $component;
+ $ocname = $this->$fncFindMappedName($dn);
+ if($ocname) {
+ return $ocname;
}
//second try: get the UUID and check if it is known. Then, update the DN and return the name.
@@ -295,25 +291,48 @@ abstract class Access {
return $this->ldap2ownCloudNames($ldapGroups, false);
}
+ private function findMappedUser($dn) {
+ static $query = null;
+ if(is_null($query)) {
+ $query = \OCP\DB::prepare('
+ SELECT `owncloud_name`
+ FROM `'.$this->getMapTable(true).'`
+ WHERE `ldap_dn` = ?'
+ );
+ }
+ $res = $query->execute(array($dn))->fetchOne();
+ if($res) {
+ return $res;
+ }
+ return false;
+ }
+
+ private function findMappedGroup($dn) {
+ static $query = null;
+ if(is_null($query)) {
+ $query = \OCP\DB::prepare('
+ SELECT `owncloud_name`
+ FROM `'.$this->getMapTable(false).'`
+ WHERE `ldap_dn` = ?'
+ );
+ }
+ $res = $query->execute(array($dn))->fetchOne();
+ if($res) {
+ return $res;
+ }
+ return false;
+ }
+
+
private function ldap2ownCloudNames($ldapObjects, $isUsers) {
if($isUsers) {
- $knownObjects = $this->mappedUsers();
$nameAttribute = $this->connection->ldapUserDisplayName;
} else {
- $knownObjects = $this->mappedGroups();
$nameAttribute = $this->connection->ldapGroupDisplayName;
}
$ownCloudNames = array();
foreach($ldapObjects as $ldapObject) {
- $key = \OCP\Util::recursiveArraySearch($knownObjects, $ldapObject['dn']);
-
- //everything is fine when we know the group
- if($key !== false) {
- $ownCloudNames[] = $knownObjects[$key]['owncloud_name'];
- continue;
- }
-
$ocname = $this->dn2ocname($ldapObject['dn'], $ldapObject[$nameAttribute], $isUsers);
if($ocname) {
$ownCloudNames[] = $ocname;
@@ -385,7 +404,7 @@ abstract class Access {
$sqlAdjustment = '';
$dbtype = \OCP\Config::getSystemValue('dbtype');
if($dbtype == 'mysql') {
- $sqlAdjustment = 'FROM `dual`';
+ $sqlAdjustment = 'FROM DUAL';
}
$insert = \OCP\DB::prepare('
diff --git a/apps/user_ldap/lib/connection.php b/apps/user_ldap/lib/connection.php
index 1922e7ff1f2..bf65d9ad91c 100644
--- a/apps/user_ldap/lib/connection.php
+++ b/apps/user_ldap/lib/connection.php
@@ -258,7 +258,7 @@ class Connection {
if(empty($this->config['ldapGroupFilter']) && empty($this->config['ldapGroupMemberAssocAttr'])) {
\OCP\Util::writeLog('user_ldap', 'No group filter is specified, LDAP group feature will not be used.', \OCP\Util::INFO);
}
- if(!in_array($this->config['ldapUuidAttribute'], array('auto','entryuuid', 'nsuniqueid', 'objectguid'))) {
+ if(!in_array($this->config['ldapUuidAttribute'], array('auto','entryuuid', 'nsuniqueid', 'objectguid')) && (!is_null($this->configID))) {
\OCP\Config::setAppValue($this->configID, 'ldap_uuid_attribute', 'auto');
\OCP\Util::writeLog('user_ldap', 'Illegal value for the UUID Attribute, reset to autodetect.', \OCP\Util::INFO);
}
@@ -357,4 +357,4 @@ class Connection {
return true;
}
-} \ No newline at end of file
+}
diff --git a/apps/user_ldap/lib/jobs.php b/apps/user_ldap/lib/jobs.php
index aff519226c8..b265a8339ef 100644
--- a/apps/user_ldap/lib/jobs.php
+++ b/apps/user_ldap/lib/jobs.php
@@ -43,7 +43,7 @@ class Jobs {
if(empty($actualGroups) && empty($knownGroups)) {
\OCP\Util::writeLog('user_ldap', 'bgJ "updateGroups" – groups do not seem to be configured properly, aborting.', \OCP\Util::INFO);
- \OCP\setAppValue('user_ldap', 'bgjUpdateGroupsLastRun', time());
+ \OCP\Config::setAppValue('user_ldap', 'bgjUpdateGroupsLastRun', time());
return;
}
diff --git a/apps/user_ldap/user_ldap.php b/apps/user_ldap/user_ldap.php
index bacdb8b9ae1..53a65129108 100644
--- a/apps/user_ldap/user_ldap.php
+++ b/apps/user_ldap/user_ldap.php
@@ -111,7 +111,7 @@ class USER_LDAP extends lib\Access implements \OCP\UserInterface {
if(!empty($this->userSearch)) {
$ldap_users = array_filter($ldap_users, array($this, 'userMatchesFilter'));
}
- if($limit = -1) {
+ if($limit == -1) {
$limit = null;
}
return array_slice($ldap_users, $offset, $limit);