Compare commits

...
Author SHA1 Message Date
bence 787427b211 MAPG-166 response to HEAD request with the GET content 2020-06-23 15:26:53 +02:00
bence 05b1a84168 Merged in bugfix/MAPG-164-fix-mail-sender (pull request #134)
MAPG-164 use env variable for mail sender instead of hardcoded value
2020-06-22 21:37:40 +00:00
bence e2a0da3dd2 MAPG-164 use env variable for mail sender instead of hardcoded value 2020-06-22 21:37:17 +00:00
bence e751fdaa3e Merged in feature/MAPG-165-make-version-number-more-nice (pull request #133)
MAPG-165 don't write 'Release_' into footer
2020-06-22 19:17:38 +00:00
bence 675d7e60d0 MAPG-165 don't write 'Release_' into footer 2020-06-22 21:17:02 +02:00
bence 0d097aacb5 Merged in feature/MAPG-164-make-possible-to-rename-application (pull request #132)
MAPG-164 show application's name from env variable
2020-06-22 19:07:39 +00:00
bence 98cd15e91f MAPG-164 show application's name from env variable 2020-06-22 21:06:15 +02:00
12 changed files with 33 additions and 22 deletions

No files matched your search

+1
View File
@@ -1,3 +1,4 @@
APP_NAME=MapQuiz
DEV=1 DEV=1
DB_HOST=mariadb DB_HOST=mariadb
DB_USER=mapguesser DB_USER=mapguesser
+4 -4
View File
@@ -1,9 +1,9 @@
Hi, Hi,
<br><br> <br><br>
You recently signed up on MapGuesser with this Google account ({{EMAIL}}). You recently signed up on {{APP_NAME}} with this Google account ({{EMAIL}}).
<br><br> <br><br>
Have fun on MapGuesser! Have fun on {{APP_NAME}}!
<br><br> <br><br>
Regards,<br> Regards,<br>
MapGuesser<br> {{APP_NAME}}<br>
<a href="{{BASE_URL}}" title="MapGuesser">{{BASE_URL}}</a> <a href="{{BASE_URL}}" title="{{APP_NAME}}">{{BASE_URL}}</a>
+5 -5
View File
@@ -1,14 +1,14 @@
Hi, Hi,
<br><br> <br><br>
You recently signed up on MapGuesser with this email address ({{EMAIL}}). To activate your account, please click on the following link:<br> You recently signed up on {{APP_NAME}} with this email address ({{EMAIL}}). To activate your account, please click on the following link:<br>
<a href="{{ACTIVATE_LINK}}" title="Account activation">{{ACTIVATE_LINK}}</a> <a href="{{ACTIVATE_LINK}}" title="Account activation">{{ACTIVATE_LINK}}</a>
<br><br> <br><br>
If you did not sign up on MapGuesser or changed your mind, no further action is required, your email address will be deleted soon.<br> If you did not sign up on {{APP_NAME}} or changed your mind, no further action is required, your email address will be deleted soon.<br>
However if you want to immediately delete it, please click on the following link:<br> However if you want to immediately delete it, please click on the following link:<br>
<a href="{{CANCEL_LINK}}" title="Sign up cancellation">{{CANCEL_LINK}}</a> <a href="{{CANCEL_LINK}}" title="Sign up cancellation">{{CANCEL_LINK}}</a>
<br><br> <br><br>
Have fun on MapGuesser! Have fun on {{APP_NAME}}!
<br><br> <br><br>
Regards,<br> Regards,<br>
MapGuesser<br> {{APP_NAME}}<br>
<a href="{{BASE_URL}}" title="MapGuesser">{{BASE_URL}}</a> <a href="{{BASE_URL}}" title="{{APP_NAME}}">{{BASE_URL}}</a>
+2 -4
View File
@@ -373,12 +373,11 @@ class LoginController
{ {
$mail = new Mail(); $mail = new Mail();
$mail->addRecipient($email); $mail->addRecipient($email);
$mail->setSubject('Welcome to MapGuesser - Activate your account'); $mail->setSubject('Welcome to ' . $_ENV['APP_NAME'] . ' - Activate your account');
$mail->setBodyFromTemplate('signup', [ $mail->setBodyFromTemplate('signup', [
'EMAIL' => $email, 'EMAIL' => $email,
'ACTIVATE_LINK' => $this->request->getBase() . '/'. \Container::$routeCollection->getRoute('signup.activate')->generateLink(['token' => $token]), 'ACTIVATE_LINK' => $this->request->getBase() . '/'. \Container::$routeCollection->getRoute('signup.activate')->generateLink(['token' => $token]),
'CANCEL_LINK' => $this->request->getBase() . '/' . \Container::$routeCollection->getRoute('signup.cancel')->generateLink(['token' => $token]), 'CANCEL_LINK' => $this->request->getBase() . '/' . \Container::$routeCollection->getRoute('signup.cancel')->generateLink(['token' => $token]),
'BASE_URL' => $this->request->getBase(),
]); ]);
$mail->send(); $mail->send();
} }
@@ -387,10 +386,9 @@ class LoginController
{ {
$mail = new Mail(); $mail = new Mail();
$mail->addRecipient($email); $mail->addRecipient($email);
$mail->setSubject('Welcome to MapGuesser'); $mail->setSubject('Welcome to ' . $_ENV['APP_NAME']);
$mail->setBodyFromTemplate('signup-noconfirm', [ $mail->setBodyFromTemplate('signup-noconfirm', [
'EMAIL' => $email, 'EMAIL' => $email,
'BASE_URL' => $this->request->getBase(),
]); ]);
$mail->send(); $mail->send();
} }
+9 -2
View File
@@ -29,6 +29,13 @@ class Mail
{ {
$this->body = file_get_contents(ROOT . '/mail/' . $template . '.html'); $this->body = file_get_contents(ROOT . '/mail/' . $template . '.html');
$baseParameters = [
'APP_NAME' => $_ENV['APP_NAME'],
'BASE_URL' => \Container::$request->getBase(),
];
$params = array_merge($baseParameters, $params);
foreach ($params as $key => $param) { foreach ($params as $key => $param) {
$this->body = str_replace('{{' . $key . '}}', $param, $this->body); $this->body = str_replace('{{' . $key . '}}', $param, $this->body);
} }
@@ -58,8 +65,8 @@ class Mail
$mailer->Mailer = 'mail'; $mailer->Mailer = 'mail';
} }
$mailer->setFrom($_ENV['MAIL_FROM'], 'MapGuesser'); $mailer->setFrom($_ENV['MAIL_FROM'], $_ENV['APP_NAME']);
$mailer->addReplyTo($_ENV['MAIL_FROM'], 'MapGuesser'); $mailer->addReplyTo($_ENV['MAIL_FROM'], $_ENV['APP_NAME']);
$mailer->Sender = !empty($_ENV['MAIL_BOUNCE']) ? $_ENV['MAIL_BOUNCE'] : $_ENV['MAIL_FROM']; $mailer->Sender = !empty($_ENV['MAIL_BOUNCE']) ? $_ENV['MAIL_BOUNCE'] : $_ENV['MAIL_FROM'];
$mailer->Subject = $this->subject; $mailer->Subject = $this->subject;
+5
View File
@@ -45,6 +45,11 @@ class RouteCollection
{ {
$groupNumber = count($uri); $groupNumber = count($uri);
// response to HEAD request with the GET content
if ($method === 'head') {
$method = 'get';
}
if (!isset($this->searchTable[$method][$groupNumber])) { if (!isset($this->searchTable[$method][$groupNumber])) {
return null; return null;
} }
+1 -1
View File
@@ -17,7 +17,7 @@ $jsFiles = [
<h1> <h1>
<a href="/maps" title="Back to playable maps"> <a href="/maps" title="Back to playable maps">
<img class="inline" width="1em" height="1em" src="<?= $_ENV['STATIC_ROOT'] ?>/img/icon.svg?rev=<?= REVISION ?>"><!-- <img class="inline" width="1em" height="1em" src="<?= $_ENV['STATIC_ROOT'] ?>/img/icon.svg?rev=<?= REVISION ?>"><!--
--><span>MapGuesser</span> --><span><?= $_ENV['APP_NAME'] ?></span>
</a> </a>
</h1> </h1>
<p class="header"> <p class="header">
+1 -1
View File
@@ -1,6 +1,6 @@
<?php require ROOT . '/views/templates/main_header.php'; ?> <?php require ROOT . '/views/templates/main_header.php'; ?>
<?php require ROOT . '/views/templates/header.php'; ?> <?php require ROOT . '/views/templates/header.php'; ?>
<h2>404 | Page not found</h2> <h2>404 | Page not found</h2>
<p>The requested URL was not found on this server. <a href="/" title="MapGuesser">Back to start.</a></p> <p>The requested URL was not found on this server. <a href="/" title="<?= $_ENV['APP_NAME'] ?>">Back to start.</a></p>
<?php require ROOT . '/views/templates/footer.php'; ?> <?php require ROOT . '/views/templates/footer.php'; ?>
<?php require ROOT . '/views/templates/main_footer.php'; ?> <?php require ROOT . '/views/templates/main_footer.php'; ?>
+1 -1
View File
@@ -12,7 +12,7 @@ $jsFiles = [
<h1> <h1>
<a href="/maps" title="Back to playable maps"> <a href="/maps" title="Back to playable maps">
<img class="inline" width="1em" height="1em" src="<?= $_ENV['STATIC_ROOT'] ?>/img/icon.svg?rev=<?= REVISION ?>"><!-- <img class="inline" width="1em" height="1em" src="<?= $_ENV['STATIC_ROOT'] ?>/img/icon.svg?rev=<?= REVISION ?>"><!--
--><span>MapGuesser</span> --><span><?= $_ENV['APP_NAME'] ?></span>
</a> </a>
</h1> </h1>
<p class="header"> <p class="header">
+1 -1
View File
@@ -1,5 +1,5 @@
</main> </main>
<footer> <footer>
<p><span class="bold">MapGuesser</span> <?= VERSION ?></p><!-- <p><span class="bold"><?= $_ENV['APP_NAME'] ?></span> <?= str_replace('Release_', '', VERSION) ?></p><!--
--><p>&copy; Pőcze Bence <?= (new DateTime(REVISION_DATE))->format('Y') ?></p> --><p>&copy; Pőcze Bence <?= (new DateTime(REVISION_DATE))->format('Y') ?></p>
</footer> </footer>
+2 -2
View File
@@ -1,8 +1,8 @@
<header> <header>
<h1> <h1>
<a href="/" title="MapGuesser"> <a href="/" title="<?= $_ENV['APP_NAME'] ?>">
<img class="inline" width="1em" height="1em" src="<?= $_ENV['STATIC_ROOT'] ?>/img/icon.svg?rev=<?= REVISION ?>"><!-- <img class="inline" width="1em" height="1em" src="<?= $_ENV['STATIC_ROOT'] ?>/img/icon.svg?rev=<?= REVISION ?>"><!--
--><span>MapGuesser</span> --><span><?= $_ENV['APP_NAME'] ?></span>
</a> </a>
</h1> </h1>
<p> <p>
+1 -1
View File
@@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<title>MapGuesser</title> <title><?= $_ENV['APP_NAME'] ?></title>
<link href="<?= $_ENV['STATIC_ROOT'] ?>/css/mapguesser.css?rev=<?= REVISION ?>" rel="stylesheet"> <link href="<?= $_ENV['STATIC_ROOT'] ?>/css/mapguesser.css?rev=<?= REVISION ?>" rel="stylesheet">
<?php if (isset($cssFiles)) : ?> <?php if (isset($cssFiles)) : ?>
<?php foreach ($cssFiles as $cssFile) : ?> <?php foreach ($cssFiles as $cssFile) : ?>