mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-06 07:57:02 +03:00
Disable Nextcloud Impersonate check #561
This commit is contained in:
parent
d3b65afb35
commit
7c362879ed
2 changed files with 7 additions and 8 deletions
|
|
@ -24,7 +24,6 @@ class PageController extends Controller
|
||||||
$bAdmin = \RainLoop\Api::Config()->Get('security', 'admin_panel_key', 'admin') == $_SERVER['QUERY_STRING'];
|
$bAdmin = \RainLoop\Api::Config()->Get('security', 'admin_panel_key', 'admin') == $_SERVER['QUERY_STRING'];
|
||||||
if (!$bAdmin) {
|
if (!$bAdmin) {
|
||||||
SnappyMailHelper::startApp(true);
|
SnappyMailHelper::startApp(true);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -58,7 +57,6 @@ class PageController extends Controller
|
||||||
public function appGet()
|
public function appGet()
|
||||||
{
|
{
|
||||||
SnappyMailHelper::startApp(true);
|
SnappyMailHelper::startApp(true);
|
||||||
exit;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -103,26 +103,27 @@ class SnappyMailHelper
|
||||||
} else {
|
} else {
|
||||||
$doLogin = !$oActions->getMainAccountFromToken(false);
|
$doLogin = !$oActions->getMainAccountFromToken(false);
|
||||||
$aCredentials = static::getLoginCredentials();
|
$aCredentials = static::getLoginCredentials();
|
||||||
|
/*
|
||||||
// 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
|
||||||
// $ocSession['snappymail-uid'] Always NULL, so we use a cookie
|
// $ocSession['snappymail-uid'] Always NULL, so we use a cookie
|
||||||
// $ocSession = \OC::$server->getSession();
|
// $ocSession = \OC::$server->getSession();
|
||||||
// if (!$doLogin && $ocSession['snappymail-uid'] && $ocSession['snappymail-uid'] != $aCredentials[0]) {
|
// if (!$doLogin && $ocSession['snappymail-uid'] && $ocSession['snappymail-uid'] != $aCredentials[0]) {
|
||||||
if (!$doLogin && !empty($_COOKIE['snappymail-uid']) && $_COOKIE['snappymail-uid'] != $aCredentials[0]) {
|
if (!$doLogin && !empty($_COOKIE['sm-nc-uid']) && $_COOKIE['sm-nc-uid'] != $aCredentials[0]) {
|
||||||
// UID changed, Impersonate plugin probably active
|
// UID changed, Impersonate plugin probably active
|
||||||
\setcookie('snappymail-uid');
|
\RainLoop\Utils::ClearCookie('sm-nc-uid');
|
||||||
$oActions->Logout(true);
|
$oActions->Logout(true);
|
||||||
$doLogin = true;
|
$doLogin = true;
|
||||||
// $this->logger->warning("Logout {$_COOKIE['snappymail-uid']}", ['app' => 'SnappyMail']);
|
|
||||||
}
|
}
|
||||||
// $ocSession['snappymail-uid'] = $aCredentials[0];
|
// $ocSession->set('snappymail-uid', $aCredentials[0]);
|
||||||
\setcookie('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]);
|
||||||
$oAccount = $oActions->LoginProcess($aCredentials[1], $aCredentials[2], false);
|
$oAccount = $oActions->LoginProcess($aCredentials[1], $aCredentials[2], false);
|
||||||
if ($oAccount) {
|
if ($oAccount) {
|
||||||
$oActions->Plugins()->RunHook('login.success', array($oAccount));
|
$oActions->Plugins()->RunHook('login.success', array($oAccount));
|
||||||
$oActions->SetAuthToken($oAccount);
|
$oActions->SetAuthToken($oAccount);
|
||||||
// $this->logger->warning("Login {$aCredentials[0]}", ['app' => 'SnappyMail']);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue