mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-10-30 09:03:33 +03:00
Nextcloud changed stored password handling
This commit is contained in:
parent
56950b4b70
commit
46bd6d4564
3 changed files with 13 additions and 5 deletions
|
|
@ -106,7 +106,8 @@ class SnappyMailHelper
|
|||
// Login failure, reset password to prevent more attempts
|
||||
$sUID = \OC::$server->getUserSession()->getUser()->getUID();
|
||||
\OC::$server->getSession()['snappymail-passphrase'] = '';
|
||||
\OC::$server->getConfig()->setUserValue($sUID, 'snappymail', 'snappymail-password', '');
|
||||
\OC::$server->getConfig()->setUserValue($sUID, 'snappymail', 'passphrase', '');
|
||||
\SnappyMail\Log::error('Nextcloud', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -132,11 +133,14 @@ class SnappyMailHelper
|
|||
// If the user has set credentials for SnappyMail in their personal settings,
|
||||
// this has the first priority.
|
||||
$sEmail = $config->getUserValue($sUID, 'snappymail', 'snappymail-email');
|
||||
$sPassword = $config->getUserValue($sUID, 'snappymail', 'snappymail-password');
|
||||
$sPassword = $config->getUserValue($sUID, 'snappymail', 'passphrase')
|
||||
?: $config->getUserValue($sUID, 'snappymail', 'snappymail-password');
|
||||
if ($sEmail && $sPassword) {
|
||||
$sPassword = static::decodePassword($sPassword, \md5($sEmail));
|
||||
if ($sPassword) {
|
||||
return [$sUID, $sEmail, $sPassword];
|
||||
} else {
|
||||
\SnappyMail\Log::debug('Nextcloud', 'decodePassword failed for getUserValue');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue