mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 08:34:42 +01:00
fixed account-migration to work with current accounts-class
This commit is contained in:
parent
108cb59d3c
commit
d36c179645
@ -77,9 +77,9 @@ if (!is_object($GLOBALS['egw_setup']->db))
|
||||
$GLOBALS['egw_setup']->loaddb();
|
||||
}
|
||||
// Load configuration values account_repository and auth_type, a setup has not yet done so
|
||||
$GLOBALS['egw_setup']->db->select($GLOBALS['egw_setup']->config_table,'config_name,config_value',
|
||||
array('config_name'=>array('account_repository','auth_type')),__LINE__,__FILE__);
|
||||
while(($row = $GLOBALS['egw_setup']->db->row(true)))
|
||||
foreach($GLOBALS['egw_setup']->db->select($GLOBALS['egw_setup']->config_table,'config_name,config_value',
|
||||
"config_name LIKE 'ldap%' OR config_name LIKE 'account_%' OR config_name LIKE '%encryption%' OR config_name='auth_type'",
|
||||
__LINE__,__FILE__) as $row)
|
||||
{
|
||||
$GLOBALS['egw_info']['server'][$row['config_name']] = $row['config_value'];
|
||||
}
|
||||
@ -98,7 +98,7 @@ if (!$_POST['migrate'])
|
||||
{
|
||||
// fetch and display the accounts of the NOT set $from repository
|
||||
$GLOBALS['egw_info']['server']['account_repository'] = $from;
|
||||
$GLOBALS['egw_setup']->setup_account_object();
|
||||
$GLOBALS['egw_setup']->setup_account_object($GLOBALS['egw_info']['server']);
|
||||
|
||||
// fetch all users and groups
|
||||
$accounts = $GLOBALS['egw_setup']->accounts->search(array(
|
||||
@ -174,7 +174,7 @@ if (!$_POST['migrate'])
|
||||
else // do the migration
|
||||
{
|
||||
$GLOBALS['egw_info']['server']['account_repository'] = $to;
|
||||
$GLOBALS['egw_setup']->setup_account_object();
|
||||
$GLOBALS['egw_setup']->setup_account_object($GLOBALS['egw_info']['server']);
|
||||
|
||||
$target = strtoupper($to);
|
||||
$accounts =& $_SESSION['all_accounts'];
|
||||
|
@ -904,10 +904,9 @@
|
||||
if (!is_object($GLOBALS['egw']->accounts)) $GLOBALS['egw']->accounts = $this->accounts;
|
||||
$this->accounts->cache_invalidate(); // the cache is shared for all instances of the class
|
||||
|
||||
if(($GLOBALS['egw_info']['server']['account_repository'] == 'ldap') &&
|
||||
!$this->accounts->ds)
|
||||
if($this->accounts->backend instanceof accounts_ldap && !$this->accounts->backend->ds)
|
||||
{
|
||||
printf("<b>Error: Error connecting to LDAP server %s!</b><br>",$GLOBALS['egw_info']['server']['ldap_host']);
|
||||
printf("<b>Error: Error connecting to LDAP server %s!</b><br>",$config['ldap_host']);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user