- fixed translateable strings in template

- added explaination about ldap filter and display name
- bugfix: keys in ldap response are lower case => lower display name filed before searching
remotes/origin/stable
Markus Kalkbrenner 14 years ago committed by Robin Appelman
parent bf84aa23f4
commit 48ae18a733
  1. 7
      apps/user_ldap/templates/settings.php
  2. 6
      apps/user_ldap/user_ldap.php

@ -5,10 +5,11 @@
<label for="ldap_port"><?php echo $l->t('Port');?></label><input type="text" id="ldap_port" name="ldap_port" value="<?php echo $_['ldap_port']; ?>" /></p> <label for="ldap_port"><?php echo $l->t('Port');?></label><input type="text" id="ldap_port" name="ldap_port" value="<?php echo $_['ldap_port']; ?>" /></p>
<p><label for="ldap_dn"><?php echo $l->t('Name');?></label><input type="text" id="ldap_dn" name="ldap_dn" value="<?php echo $_['ldap_dn']; ?>" /> <p><label for="ldap_dn"><?php echo $l->t('Name');?></label><input type="text" id="ldap_dn" name="ldap_dn" value="<?php echo $_['ldap_dn']; ?>" />
<label for="ldap_password"><?php echo $l->t('Password');?></label><input type="password" id="ldap_password" name="ldap_password" value="<?php echo $_['ldap_password']; ?>" /> <label for="ldap_password"><?php echo $l->t('Password');?></label><input type="password" id="ldap_password" name="ldap_password" value="<?php echo $_['ldap_password']; ?>" />
<?php echo $l->t('Leave both empty for anonymous bind for search, then bind with users credentials.');?></p> <small><?php echo $l->t('Leave both empty for anonymous bind for search, then bind with users credentials.');?></small></p>
<p><label for="ldap_base"><?php echo $l->t('Base');?></label><input type="text" id="ldap_base" name="ldap_base" value="<?php echo $_['ldap_base']; ?>" /> <p><label for="ldap_base"><?php echo $l->t('Base');?></label><input type="text" id="ldap_base" name="ldap_base" value="<?php echo $_['ldap_base']; ?>" />
<label for="ldap_filter"><?php echo $l->t('Filter (use %uid placeholder)');?></label><input type="text" id="ldap_filter" name="ldap_filter" value="<?php echo $_['ldap_filter']; ?>" /></p> <label for="ldap_filter"><?php echo $l->t('Filter (use %%uid placeholder)');?></label><input type="text" id="ldap_filter" name="ldap_filter" value="<?php echo $_['ldap_filter']; ?>" /></p>
<p><label for="ldap_display_name"><?php echo $l->t('Display Name Field');?></label><input type="text" id="ldap_display_name" name="ldap_display_name" value="<?php echo $_['ldap_display_name']; ?>" /></p> <p><label for="ldap_display_name"><?php echo $l->t('Display Name Field');?></label><input type="text" id="ldap_display_name" name="ldap_display_name" value="<?php echo $_['ldap_display_name']; ?>" />
<small><?php echo $l->t('Currently the display name field needs to be the same you matched %%uid against in the filter above, because ownCloud doesn\'t distinguish between user id and user name.');?></small></p>
<p><input type="checkbox" id="ldap_tls" name="ldap_tls" value="1"<?php if ($_['ldap_tls']) echo ' checked'; ?>><label for="ldap_tls"><?php echo $l->t('Use TLS');?></label></p> <p><input type="checkbox" id="ldap_tls" name="ldap_tls" value="1"<?php if ($_['ldap_tls']) echo ' checked'; ?>><label for="ldap_tls"><?php echo $l->t('Use TLS');?></label></p>
<input type="submit" value="Save" /> <input type="submit" value="Save" />
</fieldset> </fieldset>

@ -143,8 +143,10 @@ class OC_USER_LDAP extends OC_User_Backend {
else { else {
$users = array(); $users = array();
foreach($entries as $row) { foreach($entries as $row) {
if(isset($row[$this->ldap_display_name])) { // TODO ldap_get_entries() seems to lower all keys => needs review
$users[] = $row[$this->ldap_display_name][0]; $ldap_display_name = strtolower($this->ldap_display_name);
if(isset($row[$ldap_display_name])) {
$users[] = $row[$ldap_display_name][0];
} }
} }
// TODO language specific sorting of user names // TODO language specific sorting of user names

Loading…
Cancel
Save