login: preview teaser metadata of goto target
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 5 Dec 2020 03:15:09 +0000 (04:15 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 19 Dec 2020 02:01:43 +0000 (03:01 +0100)
Assume the introduction paragraph does not contain restricted contents
(also included in public sitemap) and wanted as contents for social media
links instead of unrelated login description.

login/index.php

index e1f0cae048e58a2753b6a61dbb20ea46b025a0cc..7038dcbdcf7d9085b1a802f4c5548f35cd887a35 100644 (file)
@@ -43,6 +43,8 @@ if (!$User or !$User->login) {
                $target = new ArchiveArticle("$target.html");
 
                if ($target and $target->handler == 'melding') {
+                       # run forbidden handler to determine metadata
+                       #TODO: generic solution
                        $caller = $Page;
                        $Page = $target;
                        ob_start();
@@ -54,9 +56,8 @@ if (!$User or !$User->login) {
                if ($target->title) {
                        $Page->title .= ' voor ' . $target->title;
                }
-               if ($target->image) {
-                       $Page->image = $target->image;
-               }
+               $Page->image = $target->image;
+               $Page->teaser = $target->teaser;
        }
        ob_start();
        require_once 'login/form.inc.php';