mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 12:39:25 +01:00
fix error when saving mail-account
This commit is contained in:
parent
02d0f3a801
commit
b42c2fe4f7
@ -334,7 +334,7 @@ class Account implements \ArrayAccess
|
|||||||
// store account-information of managed mail server
|
// store account-information of managed mail server
|
||||||
if ($user > 0 && $data['acc_smtp_type'] && $data['acc_smtp_type'] != __NAMESPACE__.'\\Smtp')
|
if ($user > 0 && $data['acc_smtp_type'] && $data['acc_smtp_type'] != __NAMESPACE__.'\\Smtp')
|
||||||
{
|
{
|
||||||
$smtp = self::_smtp($data);
|
$smtp = $this->smtpServer($data);
|
||||||
$smtp->setUserData($user, (array)$data['mailAlternateAddress'], (array)$data['mailForwardingAddress'],
|
$smtp->setUserData($user, (array)$data['mailAlternateAddress'], (array)$data['mailForwardingAddress'],
|
||||||
$data['deliveryMode'], $data['accountStatus'], $data['mailLocalAddress'], $data['quotaLimit']);
|
$data['deliveryMode'], $data['accountStatus'], $data['mailLocalAddress'], $data['quotaLimit']);
|
||||||
}
|
}
|
||||||
@ -1136,10 +1136,12 @@ class Account implements \ArrayAccess
|
|||||||
|
|
||||||
// remove redundant namespace to fit into column
|
// remove redundant namespace to fit into column
|
||||||
$ns_len = strlen(__NAMESPACE__)+1;
|
$ns_len = strlen(__NAMESPACE__)+1;
|
||||||
|
$backup = array();
|
||||||
foreach(array('acc_smtp_type', 'acc_imap_type') as $attr)
|
foreach(array('acc_smtp_type', 'acc_imap_type') as $attr)
|
||||||
{
|
{
|
||||||
if (substr($data[$attr], 0, $ns_len) == __NAMESPACE__.'\\')
|
if (substr($data[$attr], 0, $ns_len) == __NAMESPACE__.'\\')
|
||||||
{
|
{
|
||||||
|
$backup[$attr] = $data[$attr];
|
||||||
$data[$attr] = substr($data[$attr], $ns_len);
|
$data[$attr] = substr($data[$attr], $ns_len);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1164,6 +1166,9 @@ class Account implements \ArrayAccess
|
|||||||
{
|
{
|
||||||
$data['acc_id'] = self::$db->get_last_insert_id(self::TABLE, 'acc_id');
|
$data['acc_id'] = self::$db->get_last_insert_id(self::TABLE, 'acc_id');
|
||||||
}
|
}
|
||||||
|
// restore namespace in class-names
|
||||||
|
if ($backup) $data = array_merge($data, $backup);
|
||||||
|
|
||||||
// store identity
|
// store identity
|
||||||
$new_ident_id = self::save_identity($data);
|
$new_ident_id = self::save_identity($data);
|
||||||
if (!($data['ident_id'] > 0))
|
if (!($data['ident_id'] > 0))
|
||||||
|
Loading…
Reference in New Issue
Block a user