mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
#561 solution for NC25+
This commit is contained in:
parent
5c7bdde088
commit
f0a3ea1348
1 changed files with 11 additions and 10 deletions
|
|
@ -104,19 +104,20 @@ class SnappyMailHelper
|
||||||
$doLogin = !$oActions->getMainAccountFromToken(false);
|
$doLogin = !$oActions->getMainAccountFromToken(false);
|
||||||
$aCredentials = static::getLoginCredentials();
|
$aCredentials = static::getLoginCredentials();
|
||||||
/*
|
/*
|
||||||
|
// NC25+ workaround for Impersonate plugin
|
||||||
// https://github.com/the-djmaze/snappymail/issues/561#issuecomment-1301317723
|
// https://github.com/the-djmaze/snappymail/issues/561#issuecomment-1301317723
|
||||||
// https://github.com/nextcloud/server/issues/34935#issuecomment-1302145157
|
// https://github.com/nextcloud/server/issues/34935#issuecomment-1302145157
|
||||||
// $ocSession['snappymail-uid'] Always NULL, so we use a cookie
|
require \OC::$SERVERROOT . '/version.php';
|
||||||
// $ocSession = \OC::$server->getSession();
|
if (24 < $OC_Version[0]) {
|
||||||
// if (!$doLogin && $ocSession['snappymail-uid'] && $ocSession['snappymail-uid'] != $aCredentials[0]) {
|
$ocSession = \OC::$server->getSession();
|
||||||
if (!$doLogin && !empty($_COOKIE['sm-nc-uid']) && $_COOKIE['sm-nc-uid'] != $aCredentials[0]) {
|
$ocSession->reopen();
|
||||||
// UID changed, Impersonate plugin probably active
|
if (!$doLogin && $ocSession['snappymail-uid'] && $ocSession['snappymail-uid'] != $aCredentials[0]) {
|
||||||
\RainLoop\Utils::ClearCookie('sm-nc-uid');
|
// UID changed, Impersonate plugin probably active
|
||||||
$oActions->Logout(true);
|
$oActions->Logout(true);
|
||||||
$doLogin = true;
|
$doLogin = true;
|
||||||
|
}
|
||||||
|
$ocSession->set('snappymail-uid', $aCredentials[0]);
|
||||||
}
|
}
|
||||||
// $ocSession->set('snappymail-uid', $aCredentials[0]);
|
|
||||||
\RainLoop\Utils::SetCookie('snappymail-uid', $aCredentials[0]);
|
|
||||||
*/
|
*/
|
||||||
if ($doLogin && $aCredentials[1] && $aCredentials[2]) {
|
if ($doLogin && $aCredentials[1] && $aCredentials[2]) {
|
||||||
$oActions->Logger()->AddSecret($aCredentials[2]);
|
$oActions->Logger()->AddSecret($aCredentials[2]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue