mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-02-24 23:08:08 +08:00
Set default ContactsSync in Nextcloud
This commit is contained in:
parent
15e25a16e4
commit
91bc5931fd
1 changed files with 23 additions and 0 deletions
|
@ -187,6 +187,29 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
$sEmail = $sCustomEmail;
|
||||
}
|
||||
$aResult['DevEmail'] = $sEmail ?: '';
|
||||
} else if (!empty($aResult['ContactsSync'])) {
|
||||
$bSave = false;
|
||||
if (empty($aResult['ContactsSync']['Url'])) {
|
||||
$aResult['ContactsSync']['Url'] = "{$sWebDAV}/addressbooks/users/{$sUID}/contacts/";
|
||||
$bSave = true;
|
||||
}
|
||||
if (empty($aResult['ContactsSync']['User'])) {
|
||||
$aResult['ContactsSync']['User'] = $sUID;
|
||||
$bSave = true;
|
||||
}
|
||||
if (empty($aResult['ContactsSync']['Password'])) {
|
||||
$aResult['ContactsSync']['Password'] = '';
|
||||
}
|
||||
if ($bSave) {
|
||||
$oActions = \RainLoop\Api::Actions();
|
||||
$oAccount = $oActions->getAccountFromToken();
|
||||
$this->setContactsSyncData($oAccount, array(
|
||||
'Mode' => $aResult['ContactsSync']['Mode'],
|
||||
'User' => $aResult['ContactsSync']['User'],
|
||||
'Password' => $aResult['ContactsSync']['Password'],
|
||||
'Url' => $aResult['ContactsSync']['Url']
|
||||
));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue