mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 21:49:21 +03:00
Cleanup MailSo Validator
Cleanup removed features
This commit is contained in:
parent
8fe8369b2a
commit
1009398d0c
15 changed files with 65 additions and 192 deletions
|
|
@ -884,28 +884,6 @@ class ServiceActions
|
|||
$oAccount = null;
|
||||
$bLogout = true;
|
||||
|
||||
if ($this->oActions->Config()->Get('labs', 'allow_external_login', false))
|
||||
{
|
||||
$sEmail = \trim($this->oHttp->GetRequest('Email', ''));
|
||||
$sPassword = $this->oHttp->GetRequest('Password', '');
|
||||
|
||||
try
|
||||
{
|
||||
$oAccount = $this->oActions->LoginProcess($sEmail, $sPassword);
|
||||
$this->oActions->AuthToken($oAccount);
|
||||
$bLogout = !($oAccount instanceof \RainLoop\Model\Account);
|
||||
}
|
||||
catch (\Throwable $oException)
|
||||
{
|
||||
$this->oActions->Logger()->WriteException($oException);
|
||||
}
|
||||
|
||||
if ($bLogout)
|
||||
{
|
||||
$this->oActions->SetAuthLogoutToken();
|
||||
}
|
||||
}
|
||||
|
||||
switch (\strtolower($this->oHttp->GetRequest('Output', 'Redirect')))
|
||||
{
|
||||
case 'json':
|
||||
|
|
@ -941,46 +919,6 @@ class ServiceActions
|
|||
return '';
|
||||
}
|
||||
|
||||
public function ServiceExternalSso() : string
|
||||
{
|
||||
$this->oHttp->ServerNoCache();
|
||||
|
||||
$sResult = '';
|
||||
$bLogout = true;
|
||||
$sKey = $this->oActions->Config()->Get('labs', 'external_sso_key', '');
|
||||
if ($this->oActions->Config()->Get('labs', 'allow_external_sso', false) &&
|
||||
!empty($sKey) && $sKey === \trim($this->oHttp->GetRequest('SsoKey', '')))
|
||||
{
|
||||
$sEmail = \trim($this->oHttp->GetRequest('Email', ''));
|
||||
$sPassword = $this->oHttp->GetRequest('Password', '');
|
||||
|
||||
$sResult = \RainLoop\Api::GetUserSsoHash($sEmail, $sPassword);
|
||||
$bLogout = 0 === \strlen($sResult);
|
||||
|
||||
switch (\strtolower($this->oHttp->GetRequest('Output', 'Plain')))
|
||||
{
|
||||
case 'plain':
|
||||
@\header('Content-Type: text/plain');
|
||||
break;
|
||||
|
||||
case 'json':
|
||||
@\header('Content-Type: application/json; charset=utf-8');
|
||||
$sResult = \MailSo\Base\Utils::Php2js(array(
|
||||
'Action' => 'ExternalSso',
|
||||
'Result' => $sResult
|
||||
), $this->Logger());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($bLogout)
|
||||
{
|
||||
$this->oActions->SetAuthLogoutToken();
|
||||
}
|
||||
|
||||
return $sResult;
|
||||
}
|
||||
|
||||
private function changeAction()
|
||||
{
|
||||
$this->oHttp->ServerNoCache();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue