diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php index c3b79c392..ddc4f056c 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/ServiceActions.php @@ -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 */