1
0
mirror of https://github.com/typemill/typemill.git synced 2025-08-04 05:07:44 +02:00

V2.1.0 Fixed simplemail and empty line in template

This commit is contained in:
trendschau
2024-01-15 17:15:20 +01:00
parent f5faf67c5d
commit e7f311558f
6 changed files with 39 additions and 18 deletions

View File

@@ -16,3 +16,4 @@
127.0.0.1;2023-12-27 11:31:36;login: authcode wrong or outdated.
127.0.0.1;2023-12-27 11:31:52;login: authcode wrong or outdated.
127.0.0.1;2023-12-27 11:32:10;login: authcode wrong or outdated.
127.0.0.1;2024-01-15 13:11:20;login: invalid data

View File

@@ -36,7 +36,10 @@ class ControllerWebAuth extends Controller
\Typemill\Static\Helpers::addLogEntry('login: invalid data');
}
$this->c->get('flash')->addMessage('error', Translations::translate('Wrong password or username, please try again.'));
if($this->c->get('flash'))
{
$this->c->get('flash')->addMessage('error', Translations::translate('Wrong password or username, please try again.'));
}
return $response->withHeader('Location', $this->routeParser->urlFor('auth.show'))->withStatus(302);
}
@@ -50,7 +53,10 @@ class ControllerWebAuth extends Controller
\Typemill\Static\Helpers::addLogEntry('login: user not found');
}
$this->c->get('flash')->addMessage('error', Translations::translate('Wrong password or username, please try again.'));
if($this->c->get('flash'))
{
$this->c->get('flash')->addMessage('error', Translations::translate('Wrong password or username, please try again.'));
}
return $response->withHeader('Location', $this->routeParser->urlFor('auth.show'))->withStatus(302);
}
@@ -79,7 +85,10 @@ class ControllerWebAuth extends Controller
]);
}
$this->c->get('flash')->addMessage('error', Translations::translate('Wrong password or username, please try again.'));
if($this->c->get('flash'))
{
$this->c->get('flash')->addMessage('error', Translations::translate('Wrong password or username, please try again.'));
}
return $response->withHeader('Location', $this->routeParser->urlFor('auth.show'))->withStatus(302);
}
@@ -103,8 +112,11 @@ class ControllerWebAuth extends Controller
$mail = new SimpleMail($this->settings);
$subject = Translations::translate('Your verification code for Typemill');
$message = Translations::translate('Use the following verification code to login into Typemill') . ': ' . $authcodevalue;
$subject = Translations::translate('Your Typemill verification code');
$message = Translations::translate('Dear user') . ',<br><br>';
$message .= Translations::translate('Someone tried to log in to your Typemill website and we want to make sure it is you. Enter the following verification code to finish your login. The code will be valid for 5 minutes.');
$message .= '<br><br>' . $authcodevalue . '<br><br>';
$message .= Translations::translate('If you did not make this login attempt, please reset your password immediately.');
$send = $mail->send($userdata['email'], $subject, $message);
@@ -136,7 +148,10 @@ class ControllerWebAuth extends Controller
\Typemill\Static\Helpers::addLogEntry('login: user not confirmed yet.');
}
$this->c->get('flash')->addMessage('error', Translations::translate('Your registration is not confirmed yet. Please check your e-mails and use the confirmation link.'));
if($this->c->get('flash'))
{
$this->c->get('flash')->addMessage('error', Translations::translate('Your registration is not confirmed yet. Please check your e-mails and use the confirmation link.'));
}
return $response->withHeader('Location', $this->routeParser->urlFor('auth.show'))->withStatus(302);
}
@@ -185,7 +200,10 @@ class ControllerWebAuth extends Controller
\Typemill\Static\Helpers::addLogEntry('login: invalid verification code format');
}
$this->c->get('flash')->addMessage('error', Translations::translate('Invalid verification code format, please try again.'));
if($this->c->get('flash'))
{
$this->c->get('flash')->addMessage('error', Translations::translate('Invalid verification code format, please try again.'));
}
return $response->withHeader('Location', $this->routeParser->urlFor('auth.show'))->withStatus(302);
}
@@ -199,7 +217,10 @@ class ControllerWebAuth extends Controller
\Typemill\Static\Helpers::addLogEntry('login: user not found');
}
$this->c->get('flash')->addMessage('error', Translations::translate('Wrong password or username, please try again.'));
if($this->c->get('flash'))
{
$this->c->get('flash')->addMessage('error', Translations::translate('Wrong password or username, please try again.'));
}
return $response->withHeader('Location', $this->routeParser->urlFor('auth.show'))->withStatus(302);
}
@@ -215,7 +236,10 @@ class ControllerWebAuth extends Controller
\Typemill\Static\Helpers::addLogEntry('login: verification code wrong or outdated.');
}
$this->c->get('flash')->addMessage('error', Translations::translate('The verification was wrong or outdated, please start again.'));
if($this->c->get('flash'))
{
$this->c->get('flash')->addMessage('error', Translations::translate('The verification was wrong or outdated, please start again.'));
}
return $response->withHeader('Location', $this->routeParser->urlFor('auth.show'))->withStatus(302);
}

View File

@@ -8,7 +8,7 @@ use Slim\Flash\Messages;
class FlashMessages
{
private $container;
public $container;
public function __construct($container)
{

View File

@@ -44,7 +44,7 @@ class SimpleMail
$headers = 'Content-Type: text/html; charset=utf-8' . "\r\n";
$headers .= 'Content-Transfer-Encoding: base64' . "\r\n";
$headers .= 'From: ' . $this->from . "\r\n";
if($this->$reply)
if($this->reply)
{
$headers .= 'Reply-To: base64' . $this->reply . "\r\n";
}

View File

@@ -43,9 +43,7 @@ class License
}
elseif($licenseStatus === true)
{
echo '<pre>';
print_r($licensedata);
die();
die('Static License licenceStatus is true');
}
else
{

View File

@@ -1,4 +1,3 @@
<?php
use DI\Container;
@@ -45,7 +44,6 @@ use Typemill\Extensions\TwigCaptchaExtension;
$timer = [];
$timer['start'] = microtime(true);
/****************************
* HIDE ERRORS BY DEFAULT *
****************************/
@@ -341,11 +339,11 @@ $app->add(new SecurityMiddleware($routeParser, $container->get('settings')));
$app->add(new OldInputMiddleware($container->get('view')));
$app->add(new FlashMessages($container));
# Add Twig-View Middleware
$app->add(TwigMiddleware::createFromContainer($app));
$app->add(new FlashMessages($container));
# add JsonBodyParser Middleware
$app->add(new JsonBodyParser());