mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 01:13:25 +01:00
* AD/LDAP: added a DN filter to the periodic import to e.g. use 2 OU with a shared base
This commit is contained in:
parent
293657a48b
commit
e14fa4340b
@ -276,6 +276,12 @@ class Import
|
||||
$contact = $reconnected = null;
|
||||
foreach ($this->contacts->search('', false, '', 'account_lid', '', '', 'AND', $start, $filter) as $contact)
|
||||
{
|
||||
// if we have a regexp to filter the DN, continue on non-match
|
||||
if (!empty($GLOBALS['egw_info']['server']['account_import_dn_regexp']) &&
|
||||
!preg_match($GLOBALS['egw_info']['server']['account_import_dn_regexp'], $contact['dn']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
$new = null;
|
||||
if (!isset($last_modified) || (int)$last_modified < (int)$contact['modified'])
|
||||
{
|
||||
@ -679,6 +685,12 @@ class Import
|
||||
$created = $updated = $uptodate = $errors = $deleted = $num = 0;
|
||||
foreach($this->accounts->search($filter) as $account_id => $group)
|
||||
{
|
||||
// if we have a regexp to filter the DN, continue on non-match
|
||||
if (!empty($GLOBALS['egw_info']['server']['account_import_dn_regexp']) &&
|
||||
!preg_match($GLOBALS['egw_info']['server']['account_import_dn_regexp'], $group['account_dn']))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
// for local-groups, we always have to read all groups (to be able to determine which ones are local and preserve their memberships)
|
||||
if ($modified && $local_groups && $group['account_modified'] < $modified &&
|
||||
($sql_id = $this->accounts_sql->name2id($group['account_lid'])))
|
||||
|
@ -1302,6 +1302,7 @@ class Ldap
|
||||
|
||||
$contact = array(
|
||||
'id' => $entry['uid'][0] ?? $entry['entryuuid'][0],
|
||||
'dn' => $entry['dn'],
|
||||
'tid' => 'n', // the type id for the addressbook
|
||||
);
|
||||
if (!empty($this->schema2egw[self::CF_OBJECTCLASS]))
|
||||
|
@ -469,7 +469,7 @@
|
||||
<td colspan="2"><b>{lang_Periodic_import_from_ADS_or_LDAP_into_EGroupware_database}:</b></td>
|
||||
</tr>
|
||||
|
||||
<tr class="row_on">
|
||||
<tr class="row_off">
|
||||
<td>{lang_Source_(must_be_configured_above)}:</td>
|
||||
<td>
|
||||
<select name="newsettings[account_import_source]">
|
||||
@ -479,6 +479,10 @@
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="row_on">
|
||||
<td>{lang_Regular_expression_to_filter_by_DN}</td>
|
||||
<td><input name="newsettings[account_import_dn_regexp]" value="{value_account_import_dn_regexp}" placeholder="/OU=(One|Two),DC=example,DC=org$/i" size="80" /></td>
|
||||
</tr>
|
||||
<tr class="row_off">
|
||||
<td>{lang_What_to_import?}:</td>
|
||||
<td>
|
||||
|
Loading…
Reference in New Issue
Block a user