diff --git a/public/static/css/mapguesser.css b/public/static/css/mapguesser.css index 91a1374..b016fb5 100644 --- a/public/static/css/mapguesser.css +++ b/public/static/css/mapguesser.css @@ -84,7 +84,7 @@ hr { } p.small, span.small { - font-size: 12px; + font-size: 14px; } .justify { @@ -148,6 +148,13 @@ button, a.button { line-height: 35px; } +button.small { + font-size: 14px; + padding: 0 12px; + height: 32px; + line-height: 32px; +} + button:enabled:hover, button:enabled:focus, a.button:hover, a.button:focus { background-color: #29457f; outline: none; @@ -336,6 +343,12 @@ div.buttonContainer>button { margin: 0 auto; } +#cookiesNotice { + background-color: #eeeeee; + padding: 10px; + text-align: center; +} + #loading { position: fixed; width: 64px; diff --git a/views/templates/main_footer.php b/views/templates/main_footer.php index bb36eb7..cbb8457 100644 --- a/views/templates/main_footer.php +++ b/views/templates/main_footer.php @@ -14,5 +14,30 @@ + + + \ No newline at end of file diff --git a/views/templates/main_header.php b/views/templates/main_header.php index b27c91e..ccfa6f3 100644 --- a/views/templates/main_header.php +++ b/views/templates/main_header.php @@ -22,6 +22,14 @@ + +
+

+ uses cookies to improve user experience. By using the app or clicking I agree, you consent to our use of cookies. +

+ +
+
diff --git a/web.php b/web.php index bb911e1..279ac51 100644 --- a/web.php +++ b/web.php @@ -49,15 +49,19 @@ Container::$routeCollection->group('admin', function (MapGuesser\Routing\RouteCo $routeCollection->post('admin.deleteMap', 'deleteMap/{mapId}', [MapGuesser\Controller\MapAdminController::class, 'deleteMap']); }); -Container::$sessionHandler = new MapGuesser\Session\DatabaseSessionHandler(); +if (isset($_COOKIE['COOKIES_CONSENT'])) { + Container::$sessionHandler = new MapGuesser\Session\DatabaseSessionHandler(); -session_set_save_handler(Container::$sessionHandler, true); -session_start([ - 'gc_maxlifetime' => 604800, - 'cookie_lifetime' => 604800, - 'cookie_httponly' => true, - 'cookie_samesite' => 'Lax' -]); + session_set_save_handler(Container::$sessionHandler, true); + session_start([ + 'gc_maxlifetime' => 604800, + 'cookie_lifetime' => 604800, + 'cookie_httponly' => true, + 'cookie_samesite' => 'Lax' + ]); +} else { + $_SESSION = []; +} Container::$request = new MapGuesser\Request\Request($_SERVER['REQUEST_SCHEME'] . '://' . $_SERVER['HTTP_HOST'], $_GET, $_POST, $_SESSION);