login: title with value of redirect target
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 12 Jun 2019 22:55:17 +0000 (00:55 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Wed, 12 Jun 2019 22:55:17 +0000 (00:55 +0200)
Name the requested page before login, so it can be read by external sites
such as in Whatsapp or Facebook links.  Assume titles do not contain restricted
details and may be retrieved freely.

login/index.php

index 8b4c223914bf31d8befcf26a814d75ca7db80e2c..c7d705df7c2c69a337a001383591dc12877df3ab 100644 (file)
@@ -39,6 +39,17 @@ if (empty($User)) {
        ob_clean();
        require_once 'login/form.inc.php';
        $Place['warn'] = $message;
+       $Place['title'] = 'Inloggen';
+       if (isset($_REQUEST['goto'])) {
+               require_once 'nieuws.inc.php';
+               $target = ltrim($_REQUEST['goto'], '/');
+               $target = new ArchiveArticle("$target.html");
+               if ($target->file) {
+                       if ($target->title) {
+                               $Place['title'] .= ' voor ' . $target->title;
+                       }
+               }
+       }
        return TRUE;
 }