forked from extern/egroupware
Migration LDAP --> SQL
This commit is contained in:
parent
0c586d9ff0
commit
eef92b5785
@ -795,7 +795,7 @@ class socontacts
|
||||
|
||||
$start = $n = 0;
|
||||
$num = 100;
|
||||
while (($contacts = $sql_contacts->search(false,false,'n_family,n_given','','',false,'AND',
|
||||
while ($type != 'sql' && ($contacts = $sql_contacts->search(false,false,'n_family,n_given','','',false,'AND',
|
||||
array($start,$num),$type != 'contacts,accounts' ? array('contact_owner != 0') : false)))
|
||||
{
|
||||
// very worse hack, until Ralf finds a better solution
|
||||
@ -821,21 +821,21 @@ class socontacts
|
||||
}
|
||||
$start += $num;
|
||||
}
|
||||
if ($type == 'contacts,accounts-back') // migrate the accounts to sql
|
||||
if ($type == 'contacts,accounts-back' || $type == 'sql') // migrate the accounts to sql
|
||||
{
|
||||
// very worse hack, until Ralf finds a better solution
|
||||
// when migrating data, we need to bind as global ldap admin account
|
||||
// and not as currently logged in user
|
||||
$ldap_contacts->ds = $GLOBALS['egw']->ldap->ldapConnect();
|
||||
foreach($ldap_contacts->search(false,false,'n_family,n_given','','',false,'AND',
|
||||
false,array('owner' => 0)) as $contact)
|
||||
false,$type == 'sql'?null:array('owner' => 0)) as $contact)
|
||||
{
|
||||
if ($contact['jpegphoto']) // photo is NOT read by LDAP backend on search, need to do an extra read
|
||||
{
|
||||
$contact = $ldap_contacts->read($contact['id']);
|
||||
}
|
||||
unset($contact['id']); // ldap uid/account_lid
|
||||
if ($contact['account_id'] && ($old = $sql_contacts->read(array('account_id' => $contact['account_id']))))
|
||||
if ($type != 'sql' && $contact['account_id'] && ($old = $sql_contacts->read(array('account_id' => $contact['account_id']))))
|
||||
{
|
||||
$contact['id'] = $old['id'];
|
||||
}
|
||||
@ -845,7 +845,8 @@ class socontacts
|
||||
if (!($err = $sql_contacts->save()))
|
||||
{
|
||||
echo '<p style="margin: 0px;">'.$n.': '.$contact['n_fn'].
|
||||
($contact['org_name'] ? ' ('.$contact['org_name'].')' : '')." --> SQL (".lang('User').")</p>\n";
|
||||
($contact['org_name'] ? ' ('.$contact['org_name'].')' : '')." --> SQL (".
|
||||
($contact['owner']?lang('User'):lang('Contact')).")</p>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -101,6 +101,7 @@ contact saved addressbook de Kontakt gespeichert
|
||||
contact settings admin de Kontakt Einstellungen
|
||||
contactform addressbook de Kontaktformular
|
||||
contacts and account contact-data to ldap admin de Kontakte und Kontaktdaten der Benutzer nach LDAP
|
||||
contacts and account contact-data to sql admin de Kontakte und Kontaktdaten der Benutzer nach SQL
|
||||
contacts to ldap admin de Kontakte nach LDAP
|
||||
contacts to ldap, account contact-data to sql admin de Kontakte nach LDAP, Kontaktdaten der Benutzer nach SQL
|
||||
contains addressbook de beinhaltet
|
||||
|
@ -101,6 +101,7 @@ contact saved addressbook en Contact saved
|
||||
contact settings admin en Contact Settings
|
||||
contactform addressbook en Contactform
|
||||
contacts and account contact-data to ldap admin en contacts and account contact-data to LDAP
|
||||
contacts and account contact-data to sql admin en contacts and account contact-data to SQL
|
||||
contacts to ldap admin en contacts to LDAP
|
||||
contacts to ldap, account contact-data to sql admin en contacts to LDAP, account contact-data to SQL
|
||||
contains addressbook en contains
|
||||
|
@ -100,7 +100,7 @@
|
||||
</tr>
|
||||
<tr class="th">
|
||||
<td colspan="2">
|
||||
{lang_Additional_information_about_using_LDAP_as_contact_repository}:
|
||||
{lang_Additional_information_about_using_LDAP_as_contact_repository}:
|
||||
<a href="addressbook/doc/README" target="_blank">README</a>
|
||||
</td>
|
||||
</tr>
|
||||
@ -112,7 +112,8 @@
|
||||
<option value="contacts" title="{lang_if_accounts_are_already_in_LDAP}">{lang_contacts_to_LDAP}</option>
|
||||
<option value="contacts,accounts" title="{lang_use_setup_for_a_full_account-migration}">{lang_contacts_and_account_contact-data_to_LDAP}</option>
|
||||
<option value="contacts,accounts-back" title="{lang_for_read_only_LDAP}">{lang_contacts_to_LDAP,_account_contact-data_to_SQL}</option>
|
||||
</select>
|
||||
<option value="sql" title="{lang_for_read_only_LDAP}">{lang_contacts_and_account_contact-data_to_SQL}</option>
|
||||
</select>
|
||||
<input type="button" onclick="if (this.form.migrate.value) document.location.href='index.php?menuaction=addressbook.uicontacts.migrate2ldap&type='+this.form.migrate.value;" value="{lang_Start}" />
|
||||
</td>
|
||||
</tr>
|
||||
|
Loading…
Reference in New Issue
Block a user