mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Improved login handling for Nextcloud #96
This commit is contained in:
parent
00b08260e9
commit
c5d1e5e9c6
4 changed files with 25 additions and 7 deletions
|
|
@ -143,6 +143,23 @@ class NextcloudPlugin extends \RainLoop\Plugins\AbstractPlugin
|
|||
'WebDAV' => $sWebDAV
|
||||
// 'WebDAV_files' => $sWebDAV . '/files/' . $sUID
|
||||
];
|
||||
if (empty($aResult['Auth'])) {
|
||||
$config = \OC::$server->getConfig();
|
||||
// Only store the user's password in the current session if they have
|
||||
// enabled auto-login using Nextcloud username or email address.
|
||||
if ($config->getAppValue('snappymail', 'snappymail-autologin', false)) {
|
||||
$sEmail = $sUID;
|
||||
} else if ($config->getAppValue('snappymail', 'snappymail-autologin-with-email', false)) {
|
||||
$sEmail = $config->getUserValue($sUID, 'settings', 'email', '');
|
||||
}
|
||||
// If the user has set credentials for SnappyMail in their personal
|
||||
// settings, override everything before and use those instead.
|
||||
$sCustomEmail = $config->getUserValue($sUID, 'snappymail', 'snappymail-email', '');
|
||||
if ($sCustomEmail) {
|
||||
$sEmail = $sCustomEmail;
|
||||
}
|
||||
$aResult['DevEmail'] = $sEmail ?: '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue