diff --git a/Core/API/RoutesAPI.class.php b/Core/API/RoutesAPI.class.php index d3566cb..8ec63de 100644 --- a/Core/API/RoutesAPI.class.php +++ b/Core/API/RoutesAPI.class.php @@ -246,6 +246,8 @@ namespace Core\API\Routes { "type" => new StringType("type"), "target" => new StringType("target", 128), "extra" => new StringType("extra", 64, true, ""), + "exact" => new Parameter("exact", Parameter::TYPE_BOOLEAN), + "active" => new Parameter("active", Parameter::TYPE_BOOLEAN, true, true), )); $this->isPublic = false; } diff --git a/Core/Configuration/CreateDatabase.class.php b/Core/Configuration/CreateDatabase.class.php index 681d0df..1c465ea 100644 --- a/Core/Configuration/CreateDatabase.class.php +++ b/Core/Configuration/CreateDatabase.class.php @@ -44,7 +44,7 @@ class CreateDatabase extends DatabaseScript { new DocumentRoute("/login", true, \Core\Documents\Account::class, "account/login.twig"), new DocumentRoute("/resendConfirmEmail", true, \Core\Documents\Account::class, "account/resend_confirm_email.twig"), new DocumentRoute("/debug", true, \Core\Documents\Info::class), - new StaticFileRoute("/static", true, "/static/welcome.html"), + new StaticFileRoute("/", true, "/static/welcome.html"), ]); $queries[] = $sql->createTable("Settings") diff --git a/Core/Documents/Admin.class.php b/Core/Documents/Admin.class.php index 3f3ed4d..528fceb 100644 --- a/Core/Documents/Admin.class.php +++ b/Core/Documents/Admin.class.php @@ -7,12 +7,9 @@ use Core\Objects\Router\Router; class Admin extends TemplateDocument { public function __construct(Router $router) { - $user = $router->getContext()->getUser(); - $template = $user ? "admin.twig" : "redirect.twig"; - $params = $user ? [] : ["url" => "/login"]; + parent::__construct($router, "admin.twig", []); $this->title = "Administration"; $this->searchable = false; - parent::__construct($router, $template, $params); $this->enableCSP(); $this->addCSPWhitelist("/js/admin-panel/"); } diff --git a/Core/Templates/admin.twig b/Core/Templates/admin.twig index 2891812..6370959 100644 --- a/Core/Templates/admin.twig +++ b/Core/Templates/admin.twig @@ -8,6 +8,6 @@ {% block body %}
- - + + {% endblock %} diff --git a/cli.php b/cli.php index 3d1ab6e..5e4bcea 100644 --- a/cli.php +++ b/cli.php @@ -456,7 +456,7 @@ function onRoutes(array $argv) { _exit("Error fetching routes: " . $req->getLastError()); } else { $routes = $req->getResult()["routes"]; - $head = ["id", "request", "action", "target", "extra", "active", "exact"]; + $head = ["id", "pattern", "type", "target", "extra", "active", "exact"]; // strict boolean foreach ($routes as &$route) { @@ -467,14 +467,15 @@ function onRoutes(array $argv) { printTable($head, $routes); } } else if ($action === "add") { - if (count($argv) < 6) { - _exit("Usage: cli.php routes add`s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: $paragraph-margin-bottom;\n}\n\n// Abbreviations\n//\n// 1. Duplicate behavior to the data-* attribute for our tooltip plugin\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Remove the bottom border in Firefox 39-.\n// 5. Prevent the text-decoration to be skipped.\n\nabbr[title],\nabbr[data-original-title] { // 1\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n border-bottom: 0; // 4\n text-decoration-skip-ink: none; // 5\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\nb,\nstrong {\n font-weight: $font-weight-bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n\nsmall {\n @include font-size(80%); // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n @include font-size(75%);\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n//\n// Links\n//\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n background-color: transparent; // Remove the gray background on active links in IE 10.\n\n @include hover() {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([class]) {\n color: inherit;\n text-decoration: none;\n\n @include hover() {\n color: inherit;\n text-decoration: none;\n }\n}\n\n\n//\n// Code\n//\n\npre,\ncode,\nkbd,\nsamp {\n font-family: $font-family-monospace;\n @include font-size(1em); // Correct the odd `em` font sizing in all browsers.\n}\n\npre {\n // Remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `rem`s\n margin-bottom: 1rem;\n // Don't allow content to break outside\n overflow: auto;\n // Disable auto-hiding scrollbar in IE & legacy Edge to avoid overlap,\n // making it impossible to interact with the content\n -ms-overflow-style: scrollbar;\n}\n\n\n//\n// Figures\n//\n\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1rem;\n}\n\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // Remove the border on images inside links in IE 10-.\n}\n\nsvg {\n // Workaround for the SVG overflow bug in IE10/11 is still required.\n // See https://github.com/twbs/bootstrap/issues/26878\n overflow: hidden;\n vertical-align: middle;\n}\n\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: $table-cell-padding;\n padding-bottom: $table-cell-padding;\n color: $table-caption-color;\n text-align: left;\n caption-side: bottom;\n}\n\n// 1. Removes font-weight bold by inheriting\n// 2. Matches default `