diff --git a/api/src/Accounts/Ads.php b/api/src/Accounts/Ads.php index 640ea98e4d..5a15948eca 100644 --- a/api/src/Accounts/Ads.php +++ b/api/src/Accounts/Ads.php @@ -1244,7 +1244,7 @@ class Ads } /** - * Fixes an enhancements for adLDAP required by EGroupware + * Fixes and enhancements for adLDAP required by EGroupware * * - allow to use utf-8 charset internally, not just an 8-bit iso-charset * - support for Windows2008r2 (maybe earlier too) and Samba4 "CN=Users" DN as container to create users or groups diff --git a/setup/account_migration.php b/setup/account_migration.php index 6c6d1770f4..29a748190f 100644 --- a/setup/account_migration.php +++ b/setup/account_migration.php @@ -1,14 +1,13 @@ LDAP + * EGroupware Setup - Account migration between SQL <--> LDAP (incl. AD and Univention) * - * The migration is done to the account-repository configured for EGroupware! + * The migration is done from the account-repository configured for EGroupware! * * @link http://www.egroupware.org * @package setup * @author Ralf Becker * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License - * @version $Id$ */ use EGroupware\Api; diff --git a/setup/inc/class.setup_cmd_ldap.inc.php b/setup/inc/class.setup_cmd_ldap.inc.php index 5beed42ae2..a27e99288c 100644 --- a/setup/inc/class.setup_cmd_ldap.inc.php +++ b/setup/inc/class.setup_cmd_ldap.inc.php @@ -5,9 +5,8 @@ * @link http://www.egroupware.org * @author Ralf Becker * @package setup - * @copyright (c) 2007-16 by Ralf Becker + * @copyright (c) 2007-18 by Ralf Becker * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License - * @version $Id$ */ use EGroupware\Api; @@ -454,6 +453,7 @@ class setup_cmd_ldap extends setup_cmd { $GLOBALS['egw']->db->query('TRUNCATE TABLE egw_accounts', __LINE__, __FILE__); $GLOBALS['egw']->db->query('DELETE FROM egw_addressbook WHERE account_id IS NOT NULL', __LINE__, __FILE__); + $GLOBALS['egw']->db->query('TRUNCATE TABLE egw_mailaccounts', __LINE__, __FILE__); } // instanciate accounts obj for new store $accounts_obj = $this->accounts_obj($to); @@ -524,9 +524,12 @@ class setup_cmd_ldap extends setup_cmd $account['homedirectory'] = $GLOBALS['egw_info']['server']['ldap_account_home'] . '/' . $account['account_lid']; $account['loginshell'] = $GLOBALS['egw_info']['server']['ldap_account_shell']; } - $account['account_passwd'] = self::hash_sql2ldap($account['account_pwd']); + if (!empty($account['account_pwd'])) + { + $account['account_passwd'] = self::hash_sql2ldap($account['account_pwd']); + } } - else + elseif (!empty($account['account_pwd'])) { $account['account_passwd'] = self::hash_ldap2sql($account['account_pwd']); } @@ -543,13 +546,18 @@ class setup_cmd_ldap extends setup_cmd $accounts_created++; // check if we need to migrate mail-account - if (!isset($ldap_class) && $this->account_repository !== 'ads') + if ($this->account_repository === 'ads') + { + $ldap_class = 'EGroupware\\Api\\Mail\\Smtp\\Ads'; + } + elseif (!isset($ldap_class)) { $ldap_class = false; $ldap = Api\Ldap::factory(false); foreach(array( // todo: have these enumerated by emailadmin ... 'qmailUser' => 'EGroupware\\Api\\Mail\\Smtp\\Oldqmailuser', 'dbMailUser' => 'EGroupware\\Api\\Mail\\Smtp\\Dbmailuser', + 'univentionMail' => 'EGroupware\\Api\\Mail\\Smtp\\Univention', // nothing to migrate for inetOrgPerson ... ) as $object_class => $class) { @@ -583,7 +591,7 @@ class setup_cmd_ldap extends setup_cmd $mailaccount['accountStatus'], $mailaccount['mailLocalAddress'], $mailaccount['quotaLimit'], false, $mailaccount['mailMessageStore']); - $msg[] = lang("Mail account of %1 migraged", $account['account_lid']); + $msg[] = lang("Mail account of %1 migrated", $account['account_lid']); } //else echo "

No mail account data found for #$account_id $account[account_lid]!

\n"; }