Compare commits
2 Commits
66040d69db
...
ee7d9623a3
Author | SHA1 | Date | |
---|---|---|---|
ee7d9623a3 | |||
ecec258a64 |
@ -44,8 +44,10 @@ class Mail
|
|||||||
if (!empty($_ENV['MAIL_HOST'])) {
|
if (!empty($_ENV['MAIL_HOST'])) {
|
||||||
$mailer->Mailer = 'smtp';
|
$mailer->Mailer = 'smtp';
|
||||||
$mailer->Host = $_ENV['MAIL_HOST'];
|
$mailer->Host = $_ENV['MAIL_HOST'];
|
||||||
$mailer->Port = !empty($_ENV['MAIL_PORT']) ? $_ENV['MAIL_PORT'] : 25;
|
$mailer->Port = !empty($_ENV['MAIL_PORT']) ? $_ENV['MAIL_PORT'] : 587;
|
||||||
$mailer->SMTPSecure = !empty($_ENV['MAIL_SECURE']) ? $_ENV['MAIL_SECURE'] : '';
|
|
||||||
|
$secureMaping = ['none' => '', 'starttls' => PHPMailer::ENCRYPTION_STARTTLS, 'smtps' => PHPMailer::ENCRYPTION_SMTPS];
|
||||||
|
$mailer->SMTPSecure = !empty($_ENV['MAIL_SECURE']) ? $secureMaping[$_ENV['MAIL_SECURE']] : '';
|
||||||
|
|
||||||
if (!empty($_ENV['MAIL_USER'])) {
|
if (!empty($_ENV['MAIL_USER'])) {
|
||||||
$mailer->SMTPAuth = true;
|
$mailer->SMTPAuth = true;
|
||||||
|
@ -168,7 +168,10 @@ class HttpResponse
|
|||||||
private function redirectToLogin(): void
|
private function redirectToLogin(): void
|
||||||
{
|
{
|
||||||
$this->request->session()->set('redirect_after_login', $this->rawUrl);
|
$this->request->session()->set('redirect_after_login', $this->rawUrl);
|
||||||
$response = new Redirect($this->routeCollection->getRoute($this->appConfig['loginRouteId'])->generateLink(), IRedirect::TEMPORARY);
|
$response = new Redirect(
|
||||||
|
$this->routeCollection->getRoute($this->appConfig['loginRouteId'])
|
||||||
|
->generateLink(['redirect_after_login' => urlencode($this->rawUrl)]),
|
||||||
|
IRedirect::TEMPORARY);
|
||||||
header('Location: ' . $this->getRedirectUrl($response), true, $response->getHttpCode());
|
header('Location: ' . $this->getRedirectUrl($response), true, $response->getHttpCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user