mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-03-11 21:50:15 +01:00
fixed not working ldif export:
- object class has to be phpgwContact - time()+cn gives not always ab unique uid (eg. no name = empty cn), added array index
This commit is contained in:
parent
0d9a26e224
commit
0205b0bf64
@ -132,18 +132,13 @@
|
|||||||
// Tack on some extra values
|
// Tack on some extra values
|
||||||
function export_end_record($buffer)
|
function export_end_record($buffer)
|
||||||
{
|
{
|
||||||
|
$context = 'ou=contacts,dc=domain,dc=com'; // some default to replace later
|
||||||
if ($GLOBALS['egw_info']['server']['ldap_contact_context'])
|
if ($GLOBALS['egw_info']['server']['ldap_contact_context'])
|
||||||
{
|
{
|
||||||
$context = $GLOBALS['egw_info']['server']['ldap_contact_context'];
|
$context = $GLOBALS['egw_info']['server']['ldap_contact_context'];
|
||||||
}
|
}
|
||||||
$time = gettimeofday();
|
$buffer[$this->id]['uid'] = time().':'.$this->id.($buffer[$this->id]['cn'] ? ':'.str_replace(',','',$buffer[$this->id]['cn']) : '');
|
||||||
$cn = str_replace(',','',$buffer[$this->id]['cn']);
|
$buffer[$this->id]['dn'] = 'uid='.$buffer[$this->id]['uid'].','.$context;
|
||||||
$buffer[$this->id]['dn'] = 'uid='.time().$time['usec'].':'.$cn.','.$context;
|
|
||||||
$buffer[$this->id]['uid'] = time().$time['usec'];
|
|
||||||
if ($buffer[$this->id]['cn'])
|
|
||||||
{
|
|
||||||
$buffer[$this->id]['uid'] .= ':'.$buffer[$this->id]['cn'];
|
|
||||||
}
|
|
||||||
$buffer[$this->id]['description'] = ereg_replace("\r\n",';',$buffer[$this->id]['description']);
|
$buffer[$this->id]['description'] = ereg_replace("\r\n",';',$buffer[$this->id]['description']);
|
||||||
//echo '<br>'.$this->id.' - '.$buffer[$this->id]['dn'];
|
//echo '<br>'.$this->id.' - '.$buffer[$this->id]['dn'];
|
||||||
return $buffer;
|
return $buffer;
|
||||||
@ -168,7 +163,7 @@
|
|||||||
$entries .= 'objectClass: organizationalPerson' . "\n";
|
$entries .= 'objectClass: organizationalPerson' . "\n";
|
||||||
# not needed for openldap > 2.1 anymore
|
# not needed for openldap > 2.1 anymore
|
||||||
#$entries .= 'objectClass: inetOrgPerson' . "\n";
|
#$entries .= 'objectClass: inetOrgPerson' . "\n";
|
||||||
$entries .= 'objectClass: egwContact' . "\n";
|
$entries .= 'objectClass: phpgwContact' . "\n";
|
||||||
$entries .= "\n";
|
$entries .= "\n";
|
||||||
}
|
}
|
||||||
$buffer = $entries;
|
$buffer = $entries;
|
||||||
|
Loading…
Reference in New Issue
Block a user