mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 18:19:22 +03:00
CpanelAutoLogin service
This commit is contained in:
parent
2ad305e40e
commit
f52be6fb66
1 changed files with 31 additions and 0 deletions
|
|
@ -820,6 +820,37 @@ class ServiceActions
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function ServiceCpanelAutoLogin()
|
||||
{
|
||||
$oException = null;
|
||||
$oAccount = null;
|
||||
|
||||
$sEmail = $this->oHttp->GetEnv('REMOTE_USER', '');
|
||||
$sLogin = '';
|
||||
$sPassword = $this->oHttp->GetEnv('REMOTE_PASSWORD', '');
|
||||
|
||||
if (0 < \strlen($sEmail) && 0 < \strlen(\trim($sPassword)))
|
||||
{
|
||||
try
|
||||
{
|
||||
$this->oActions->Logger()->AddSecret($sPassword);
|
||||
|
||||
$oAccount = $this->oActions->LoginProcess($sEmail, $sLogin, $sPassword);
|
||||
$this->oActions->AuthProcess($oAccount);
|
||||
}
|
||||
catch (\Exception $oException)
|
||||
{
|
||||
$this->oActions->Logger()->WriteException($oException);
|
||||
}
|
||||
}
|
||||
|
||||
$this->oActions->Location('./');
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue