minimedit.git
3 years agonieuws: navigation links in common aside container v4.4
Mischa POSLAWSKY [Sun, 17 May 2020 03:42:58 +0000 (05:42 +0200)]
nieuws: navigation links in common aside container

3 years agoissue: metadata list in aside container
Mischa POSLAWSKY [Sun, 17 May 2020 03:06:19 +0000 (05:06 +0200)]
issue: metadata list in aside container

Better semantics, benefits from common aside styling.

3 years agoarticle: ignore placeholders before teaser paragraph
Mischa POSLAWSKY [Sun, 17 May 2020 03:39:59 +0000 (05:39 +0200)]
article: ignore placeholders before teaser paragraph

3 years agoarticle: find teaser paragraph from variable offset
Mischa POSLAWSKY [Sun, 17 May 2020 03:17:38 +0000 (05:17 +0200)]
article: find teaser paragraph from variable offset

Simplify matching by starting at optional first </h2>.
No longer ignores (short) preceding titles such as on Lijtweg home;
more reliable otherwise.

3 years agopage: restrict security policy of base-src
Mischa POSLAWSKY [Sun, 17 May 2020 00:40:31 +0000 (02:40 +0200)]
page: restrict security policy of base-src

3 years agohead: indicate explicit og:type of website
Mischa POSLAWSKY [Sat, 16 May 2020 23:50:32 +0000 (01:50 +0200)]
head: indicate explicit og:type of website

Include just to allow page overrides, such as "article" for nieuws pages
(might affect Facebook, but seems a minor and mostly useless distinction).
At least silences Dareboost warnings about required Open Graph properties.

3 years agohead: include canonical location in og:url
Mischa POSLAWSKY [Sun, 17 May 2020 00:03:52 +0000 (02:03 +0200)]
head: include canonical location in og:url

Does not (yet) account for all aliases, but at least provides a good
reference to the requested page.

3 years agopage: extend teaser range of fallback paragraph
Mischa POSLAWSKY [Sat, 16 May 2020 23:33:36 +0000 (01:33 +0200)]
page: extend teaser range of fallback paragraph

Arbitrarily increase allowed separation to 512 bytes, as Lijtweg index page
introduction recently moved beyond 256 because of longer image paths.

3 years agopage: declare minimal security policy header
Mischa POSLAWSKY [Sat, 16 May 2020 23:05:27 +0000 (01:05 +0200)]
page: declare minimal security policy header

Define current data usage to provide some protection from XSS attacks.
Allow for remaining scripts and images (editor script, gallery, some onclick
actions in user forms, inline svg) to be improved at a later time.

3 years agopage: disallow frame ancestors to prevent clickjacking
Mischa POSLAWSKY [Sat, 16 May 2020 22:17:23 +0000 (00:17 +0200)]
page: disallow frame ancestors to prevent clickjacking

Security policy recommended by Dareboost, to stop potential malicious page
embedding.  Support should be decent (enough), so do not bother with an
equivalent X-Frame-Options directive for compatibility.

3 years agothumb: strip metadata and chroma
Mischa POSLAWSKY [Sat, 18 Jan 2020 14:57:10 +0000 (15:57 +0100)]
thumb: strip metadata and chroma

Decreased colour quality recommended by Google PageSpeed:
<https://developers.google.com/speed/docs/insights/OptimizeImages>

3 years agothumb: decrease preferred quality to 85%
Mischa POSLAWSKY [Sat, 18 Jan 2020 14:57:10 +0000 (15:57 +0100)]
thumb: decrease preferred quality to 85%

Better trade-off, also recommended by PageSpeed.

3 years agothumb: prefer progressive jpeg encoding
Mischa POSLAWSKY [Sat, 18 Jan 2020 14:14:10 +0000 (15:14 +0100)]
thumb: prefer progressive jpeg encoding

Intermediate rendering for faster results, and overall smaller file sizes
similar (if not identical) to jpegtran -optimize or PageSpeed.

4 years agopage: reenclose template contents in static container
Mischa POSLAWSKY [Wed, 18 Mar 2020 16:28:59 +0000 (17:28 +0100)]
page: reenclose template contents in static container

Fix editing of new pages since v4.2-24-ged38c6a767 (2020-02-04)
[page: article method to find handler code].

4 years agoissue: match image replies for metadata
Mischa POSLAWSKY [Tue, 4 Feb 2020 21:36:11 +0000 (22:36 +0100)]
issue: match image replies for metadata

Database paragraphs not cleaned by editor lack preceding newline.

4 years agologin: target page in description and image metadata
Mischa POSLAWSKY [Tue, 4 Feb 2020 21:20:18 +0000 (22:20 +0100)]
login: target page in description and image metadata

4 years agologin: run handler of pending melding page
Mischa POSLAWSKY [Tue, 4 Feb 2020 20:22:56 +0000 (21:22 +0100)]
login: run handler of pending melding page

Run script to get dynamic page metadata.  Most wanted for issues (otherwise
inaccessible since move to database), considered mostly safe to execute.
Not a generic solution for other code which could exit.

4 years agologin: redirection message if pending page
Mischa POSLAWSKY [Tue, 4 Feb 2020 20:19:29 +0000 (21:19 +0100)]
login: redirection message if pending page

Assume ?goto page required authorisation.

4 years agopage: article method to find handler code
Mischa POSLAWSKY [Tue, 4 Feb 2020 19:52:00 +0000 (20:52 +0100)]
page: article method to find handler code

4 years agopage: separate method to load page contents
Mischa POSLAWSKY [Mon, 30 Dec 2019 06:42:11 +0000 (07:42 +0100)]
page: separate method to load page contents

4 years agoreply: ignore empty image uploads
Mischa POSLAWSKY [Wed, 15 Jan 2020 13:43:39 +0000 (14:43 +0100)]
reply: ignore empty image uploads

Fix invalid image appended for UPLOAD_ERR_NO_FILE.

4 years agoreply: accept html input from admins v4.3
Mischa POSLAWSKY [Sun, 5 Jan 2020 21:23:56 +0000 (22:23 +0100)]
reply: accept html input from admins

Forgo html formatting if text starts with an element such as <p>.
Restricted for safety since it's not validated.  Intermediate solution to
support rich contents (wysiwyg editor can be added later for accessibility).

4 years agoreply: accept image uploads with messages
Mischa POSLAWSKY [Sun, 5 Jan 2020 21:21:25 +0000 (22:21 +0100)]
reply: accept image uploads with messages

4 years agoissue: move photo icon before replies
Mischa POSLAWSKY [Sun, 5 Jan 2020 21:18:06 +0000 (22:18 +0100)]
issue: move photo icon before replies

Most common parts last for more stable appearance.

4 years agologin/post: require user to access
Mischa POSLAWSKY [Sun, 5 Jan 2020 19:56:37 +0000 (20:56 +0100)]
login/post: require user to access

Redirect to login to avoid incomprehensible error message.

Reported-by: Heleen Terlouw <heleen.terlouw.2910@gmail.com>
4 years agoissue: derive page metadata from row data
Mischa POSLAWSKY [Wed, 1 Jan 2020 11:06:15 +0000 (12:06 +0100)]
issue: derive page metadata from row data

4 years agopage: fix titleless article teaser fallback
Mischa POSLAWSKY [Wed, 1 Jan 2020 05:44:40 +0000 (06:44 +0100)]
page: fix titleless article teaser fallback

Broken since commit v4.0-28-gb3aec6cf1c (2019-11-09)
[page: replace output caching by article object].

4 years agothumb: delete subsequent animation frames
Mischa POSLAWSKY [Sat, 30 Nov 2019 21:13:07 +0000 (22:13 +0100)]
thumb: delete subsequent animation frames

Convert animated GIFs and accidental video to still frame.

4 years agopage: fix variable dependencies in error headers
Mischa POSLAWSKY [Mon, 30 Dec 2019 06:43:03 +0000 (07:43 +0100)]
page: fix variable dependencies in error headers

Editor checks broken in page.inc.php being called from fail() function.

4 years agoissue: common icon glyphs for improved fallback
Mischa POSLAWSKY [Mon, 30 Dec 2019 08:54:02 +0000 (09:54 +0100)]
issue: common icon glyphs for improved fallback

Irrelevant after styling, but improves compatibility if unstyled:
- RIGHT SPEECH BUBBLE is a common emoji available on at least android;
- CAMERA is more specific for the expected usage, and similar to other
  popular sites such as Twitter.

4 years agoissue: unicode characters of indicator icons
Mischa POSLAWSKY [Mon, 30 Dec 2019 08:24:38 +0000 (09:24 +0100)]
issue: unicode characters of indicator icons

Replace ASCII placeholders by semantic equivalents, which can be styled by
custom fonts to maintain full client compatibility.

4 years agoissue: code cleanup breaking up row attributes
Mischa POSLAWSKY [Mon, 30 Dec 2019 08:30:29 +0000 (09:30 +0100)]
issue: code cleanup breaking up row attributes

Identical results using separate, more maintainable statements.

4 years agoissue: indicate image presence in overview
Mischa POSLAWSKY [Sun, 1 Dec 2019 22:14:15 +0000 (23:14 +0100)]
issue: indicate image presence in overview

Advertise uploads as they are proverbially worth more than text replies.

4 years agoreply: convert CR in line breaks
Mischa POSLAWSKY [Sat, 30 Nov 2019 23:12:46 +0000 (00:12 +0100)]
reply: convert CR in line breaks

Store submitted network/dos newlines as expected unix LF.

4 years agoissue: do not immediately close inserted rows
Mischa POSLAWSKY [Sat, 30 Nov 2019 23:05:19 +0000 (00:05 +0100)]
issue: do not immediately close inserted rows

Database fix applied earlier.

4 years agopage: convert error messages to html strings
Mischa POSLAWSKY [Sat, 30 Nov 2019 23:00:15 +0000 (00:00 +0100)]
page: convert error messages to html strings

Exception objects need to be converted to strings for usage as placeholders,
and while at it, xml characters should be escaped for proper display.

4 years agopage: reload error page within fail handler
Mischa POSLAWSKY [Sat, 30 Nov 2019 22:57:20 +0000 (23:57 +0100)]
page: reload error page within fail handler

Catch errors during display (such as an invalid placeholder value fixed in
the next commit) instead of ignoring subsequent displays causing empty
output.

4 years agopage: capture multiline titles in article contents
Mischa POSLAWSKY [Sat, 30 Nov 2019 22:51:38 +0000 (23:51 +0100)]
page: capture multiline titles in article contents

Fix recent page (doc/alv/2019-11-26/cv) containing subtitle.

4 years agodoclist: background width to end line at last item
Mischa POSLAWSKY [Fri, 29 Nov 2019 22:09:15 +0000 (23:09 +0100)]
doclist: background width to end line at last item

Assuming stylesheet draws a line by background-image, calculate its size to
target the earliest item.

4 years agodoclist: sublists of multiple dates grouped by year
Mischa POSLAWSKY [Mon, 18 Nov 2019 15:12:26 +0000 (16:12 +0100)]
doclist: sublists of multiple dates grouped by year

4 years agodoclist: code cleanup and preparation
Mischa POSLAWSKY [Fri, 29 Nov 2019 21:19:34 +0000 (22:19 +0100)]
doclist: code cleanup and preparation

4 years agodoclist: timeline styling to position links by age
Mischa POSLAWSKY [Sat, 16 Nov 2019 20:47:53 +0000 (21:47 +0100)]
doclist: timeline styling to position links by age

Calculate absolute "left" position based on average date lengths,
to be optionally used by the site's stylesheet.

4 years agoissue: populate ticket data before reply include v4.2
Mischa POSLAWSKY [Tue, 26 Nov 2019 16:24:05 +0000 (17:24 +0100)]
issue: populate ticket data before reply include

Reorder in commit v4.1-34-gc83e7f0379 (2019-11-25) [issue: include replies
before issue retrieval] breaks admin features due to missing $Issue.
Update row data on update instead.

4 years agopage: filter login/logout classes on any html element
Mischa POSLAWSKY [Tue, 26 Nov 2019 23:13:19 +0000 (00:13 +0100)]
page: filter login/logout classes on any html element

Needed on <ul>, but extend to cover any future usage.

4 years agoissue: include replies before issue retrieval
Mischa POSLAWSKY [Mon, 25 Nov 2019 15:20:32 +0000 (16:20 +0100)]
issue: include replies before issue retrieval

Load reply data before row query to reflect changes directly.

4 years agoissue: wrap items to allow containment
Mischa POSLAWSKY [Mon, 25 Nov 2019 15:15:18 +0000 (16:15 +0100)]
issue: wrap items to allow containment

Fix contents from appearing in next <li> with lower screen width.

Similar to column lists in commit v3.4-0-g72d8db8c87 (2018-07-08)
[login/list: wrap each item to allow containment].

4 years agoissue: metadata in sidebar container
Mischa POSLAWSKY [Mon, 25 Nov 2019 14:45:54 +0000 (15:45 +0100)]
issue: metadata in sidebar container

Separate list of global summary information, allowing a more hidden (aside)
styling keeping focus on discussion and clarifying repetitions (most items
are also represented as changes).

4 years agoupload: replace double line breaks by paragraphs in text input
Mischa POSLAWSKY [Mon, 25 Nov 2019 20:14:28 +0000 (21:14 +0100)]
upload: replace double line breaks by paragraphs in text input

4 years agoupload: common function to parse user text input
Mischa POSLAWSKY [Mon, 25 Nov 2019 20:12:33 +0000 (21:12 +0100)]
upload: common function to parse user text input

Move duplicate code from issue and reply pages.

4 years agoreply: omit empty messages like issue page
Mischa POSLAWSKY [Fri, 8 Nov 2019 01:29:05 +0000 (02:29 +0100)]
reply: omit empty messages like issue page

Copy recent update in formatting.

4 years agopage: restore meta tags for editors
Mischa POSLAWSKY [Wed, 20 Nov 2019 23:31:27 +0000 (00:31 +0100)]
page: restore meta tags for editors

4 years agoauth: append login to formatted user names
Mischa POSLAWSKY [Wed, 20 Nov 2019 23:19:01 +0000 (00:19 +0100)]
auth: append login to formatted user names

4 years agofoto: increase thumbnail height for exceptional rows
Mischa POSLAWSKY [Thu, 24 Oct 2019 05:08:27 +0000 (07:08 +0200)]
foto: increase thumbnail height for exceptional rows

Even with the configured maximum of 200*1.25=250px, resulting sizes appear
to regularly exceed that, with anything up to 262px being quite common and
easily reproducible (in Lijtweg historisch).

4 years agofoto: keep static images of height 250
Mischa POSLAWSKY [Thu, 24 Oct 2019 04:58:04 +0000 (06:58 +0200)]
foto: keep static images of height 250

Drop dynamic source replacement to match actual client sizes, as the quality
loss from downsizing a _larger_ image is minimal.

Originally introduced in lijtweg commit v2.5-7-gcd93e774e6 (2017-10-11)
[foto: replace justified thumbnails by height-optimised versions]
with visible improvements probably due to using the target size of 200px
without adjusting for up to 1.25x enlargement to fit.

Testing originals of 250px on modern browsers with (bilinear) rescaling
is hard to distinguish (not significantly more blurry) and depends on only
a single thumbnail resolution to be created for significantly reduced
resource requirements.  May be slightly larger on average, but likely much
smaller without reloads and considering caching opportunities.

4 years agoissue: styling class on closed rows
Mischa POSLAWSKY [Wed, 20 Nov 2019 12:57:01 +0000 (13:57 +0100)]
issue: styling class on closed rows

Link tag does not cover metadata.  Keep strike-through for compatibility,
but with equivalent <s> as <strike> has been deprecated in HTML5.

4 years agoissue: feed subpage for atom xml formatting
Mischa POSLAWSKY [Fri, 8 Nov 2019 00:02:50 +0000 (01:02 +0100)]
issue: feed subpage for atom xml formatting

Feature of news articles lost during database transition.

Include adapted from nieuws/feed/index.php for different object structure
(to be merged again later if possible).

4 years agologin/commits: escape html characters in commit messages
Mischa POSLAWSKY [Mon, 18 Nov 2019 21:20:45 +0000 (22:20 +0100)]
login/commits: escape html characters in commit messages

4 years agowidget/contact: accept non-word characters in sender email addresses
Mischa POSLAWSKY [Sun, 17 Nov 2019 13:51:08 +0000 (14:51 +0100)]
widget/contact: accept non-word characters in sender email addresses

Allow any remotely valid address, including <hans.verlinden@planet.nl>.

4 years agoreply: list attribute changes for each row
Mischa POSLAWSKY [Fri, 8 Nov 2019 01:23:18 +0000 (02:23 +0100)]
reply: list attribute changes for each row

4 years agoreply: identify textual journal columns
Mischa POSLAWSKY [Fri, 8 Nov 2019 01:22:31 +0000 (02:22 +0100)]
reply: identify textual journal columns

4 years agoissue: count number of replies in overview
Mischa POSLAWSKY [Fri, 8 Nov 2019 00:21:45 +0000 (01:21 +0100)]
issue: count number of replies in overview

4 years agoreply: omit header from mandatory output
Mischa POSLAWSKY [Thu, 7 Nov 2019 16:50:05 +0000 (17:50 +0100)]
reply: omit header from mandatory output

Can be prepended manually if wanted.

4 years agoissue: inline ticket body like replies
Mischa POSLAWSKY [Thu, 7 Nov 2019 16:49:58 +0000 (17:49 +0100)]
issue: inline ticket body like replies

4 years agoissue: display assignments in overview
Mischa POSLAWSKY [Thu, 7 Nov 2019 05:13:53 +0000 (06:13 +0100)]
issue: display assignments in overview

4 years agoissue: resolve author logins to full names
Mischa POSLAWSKY [Thu, 7 Nov 2019 05:13:34 +0000 (06:13 +0100)]
issue: resolve author logins to full names

4 years agoissue: select restricted by current page
Mischa POSLAWSKY [Thu, 7 Nov 2019 04:56:00 +0000 (05:56 +0100)]
issue: select restricted by current page

Allow setup of multiple distinct categories.

4 years agoissue: record row changes in journal
Mischa POSLAWSKY [Thu, 7 Nov 2019 04:51:30 +0000 (05:51 +0100)]
issue: record row changes in journal

4 years agoissue: admin option to close or reopen
Mischa POSLAWSKY [Thu, 7 Nov 2019 04:23:30 +0000 (05:23 +0100)]
issue: admin option to close or reopen

4 years agoissue: assignment text field for admins
Mischa POSLAWSKY [Thu, 7 Nov 2019 04:04:59 +0000 (05:04 +0100)]
issue: assignment text field for admins

4 years agoreply: share parent data from issue page
Mischa POSLAWSKY [Thu, 7 Nov 2019 04:04:09 +0000 (05:04 +0100)]
reply: share parent data from issue page

Provide easy access to selected metadata.

4 years agoreply: set method to abstract update queries
Mischa POSLAWSKY [Thu, 7 Nov 2019 03:59:13 +0000 (04:59 +0100)]
reply: set method to abstract update queries

Extend insert, renamed to generic "set", to allow updates using the same
syntax with an additional select parameter.

4 years agoissue: database insert method to keep array values
Mischa POSLAWSKY [Thu, 7 Nov 2019 03:43:53 +0000 (04:43 +0100)]
issue: database insert method to keep array values

Feature to apply literal SQL with optional arguments, stolen from other
projects modeled after DBIx::Simple.

4 years agoissue: closed at bottom, option ?open to exclude
Mischa POSLAWSKY [Thu, 24 Oct 2019 21:53:24 +0000 (23:53 +0200)]
issue: closed at bottom, option ?open to exclude

4 years agoissue: display ticket creation date
Mischa POSLAWSKY [Sun, 20 Oct 2019 04:16:49 +0000 (06:16 +0200)]
issue: display ticket creation date

4 years agoissue: order by last update, changed on reply
Mischa POSLAWSKY [Sun, 20 Oct 2019 04:07:07 +0000 (06:07 +0200)]
issue: order by last update, changed on reply

Initial value determined by:

UPDATE issues SET updated = greatest(created, closed, (
SELECT max(created) FROM comments WHERE page = issues.link
));

4 years agoissue: append and ignore page titles in links
Mischa POSLAWSKY [Sun, 20 Oct 2019 03:49:22 +0000 (05:49 +0200)]
issue: append and ignore page titles in links

Preserve names of replaced files, and improve recognition of sent targets
as well as seo score.

4 years agoissue: track messages in database
Mischa POSLAWSKY [Sun, 20 Oct 2019 03:47:19 +0000 (05:47 +0200)]
issue: track messages in database

Replace file storage by PostgreSQL table, similar to comments in commit
v4.0-21-g0cc6251412 (2019-10-27) [nieuws/replies: read contents from database].

Existing files are imported similar to earlier comments:

ls melding/2*/*.html | perl -MFile::Slurp -lnE ' #/
my ($page, $date, $name) = split m{/};
$name =~ s/(\d+-\d+)-// and $date .= "-$1";
my $closed = qx(stat -c%y "$page/.tags/opgelost/$date-$name" 2>/dev/null);
chomp $closed;
$name =~ s/\.html$//;
my $html = read_file($_);
$html =~ s{<h2>(.*?)</h2>\n+}{}; my $title = $1;
chomp, s/\\\K/\\/g, s/\n/\\n/g, s/\t/\\t/g for $html;
say join "\t", $page, $date, $name, $title, $html, $closed || "\\N";
' | psql lijtweg -c 'COPY issues (page, created, link, subject, body, closed) FROM STDIN'

Afterwards, the following queries can be executed to convert and clean up
these imported rows further:

-- rename issue references to new page ids
UPDATE comments c SET page = (SELECT coalesce((SELECT page||'/'||id
FROM issues WHERE c.page LIKE page || '/%-' || link), c.page));

-- move authorship contents to dedicated column
SELECT id, regexp_matches(body, '<p class="right">(?:Ingediend door |<em>)?([^<]*)')
FROM issues WHERE body ~ 'right';
UPDATE issues SET author = 'cees' WHERE body ~ '<p class="right">.*Cees';
UPDATE issues SET author = '301' WHERE body ~ '<p class="right">.*de Roos';
UPDATE issues SET body = regexp_replace(body, E'\n+<p class="right">.*</p>$', '')
WHERE body ~ 'right';

4 years agoreply: restrict submission form to users
Mischa POSLAWSKY [Thu, 7 Nov 2019 16:34:09 +0000 (17:34 +0100)]
reply: restrict submission form to users

Assumed as much on insert.

4 years agonieuws: authorise admins by edit subpermissions v4.1
Mischa POSLAWSKY [Thu, 31 Oct 2019 18:26:45 +0000 (19:26 +0100)]
nieuws: authorise admins by edit subpermissions

Treat news maintenance like any other edit location.

4 years agologin/edit: move admin block to distinct widget
Mischa POSLAWSKY [Sat, 26 Oct 2019 00:00:34 +0000 (02:00 +0200)]
login/edit: move admin block to distinct widget

4 years agologin/edit: user override in page code
Mischa POSLAWSKY [Fri, 25 Oct 2019 23:59:54 +0000 (01:59 +0200)]
login/edit: user override in page code

4 years agologin/edit: admin event dates (creation, setup, visit)
Mischa POSLAWSKY [Fri, 25 Oct 2019 23:20:06 +0000 (01:20 +0200)]
login/edit: admin event dates (creation, setup, visit)

4 years agoedit/page: keep page named after existing directory
Mischa POSLAWSKY [Mon, 28 Oct 2019 02:36:22 +0000 (03:36 +0100)]
edit/page: keep page named after existing directory

Allow either subdir.html or subdir/index.html, preventing edit from creating
conforming duplicates.

Reported-by: Arie van Marion
4 years agopage: silence object warnings on missing pages
Mischa POSLAWSKY [Mon, 28 Oct 2019 04:02:49 +0000 (05:02 +0100)]
page: silence object warnings on missing pages

4 years agopage: replace output caching by article object
Mischa POSLAWSKY [Thu, 24 Oct 2019 21:49:46 +0000 (23:49 +0200)]
page: replace output caching by article object

4 years agonieuws: avoid invalid date access for missing articles
Mischa POSLAWSKY [Thu, 24 Oct 2019 21:54:05 +0000 (23:54 +0200)]
nieuws: avoid invalid date access for missing articles

Broken since page objects introduced in commit v3.9-11-g234326791b
(2019-06-28) [page: promote news article class to represent all pages].

4 years agoreply: setup database to fetch objects
Mischa POSLAWSKY [Mon, 21 Oct 2019 06:44:48 +0000 (08:44 +0200)]
reply: setup database to fetch objects

Avoid repetition on each fetch in upcoming usage.

4 years agonieuws: rename nieuws/replies widget to generic reply
Mischa POSLAWSKY [Mon, 21 Oct 2019 06:23:42 +0000 (08:23 +0200)]
nieuws: rename nieuws/replies widget to generic reply

Can be placed on any page (such as upcoming issues), not specific to nieuws.

4 years agowidget/contact: current user overrides login, email fallback
Mischa POSLAWSKY [Mon, 4 Nov 2019 23:20:54 +0000 (00:20 +0100)]
widget/contact: current user overrides login, email fallback

4 years agonieuws/replies: insert method to add database rows
Mischa POSLAWSKY [Thu, 17 Oct 2019 03:53:55 +0000 (05:53 +0200)]
nieuws/replies: insert method to add database rows

Minimal database abstraction for code maintainability
(feature similar to perl DBIx::Simple).

4 years agonieuws/replies: database class with query method
Mischa POSLAWSKY [Thu, 17 Oct 2019 03:52:48 +0000 (05:52 +0200)]
nieuws/replies: database class with query method

Code cleanup preparing for more extensive database support
(where default php is somewhat lacking).

4 years agonieuws/replies: read contents from database
Mischa POSLAWSKY [Thu, 17 Oct 2019 03:20:55 +0000 (05:20 +0200)]
nieuws/replies: read contents from database

Replace file storage by a PostgreSQL table.  Resign to the additional
dependency for this kind of social feature since it's much more appropriate
(especially with upcoming extensions), and optional similar to external
comment services.

Identical results after importing existing files:

ls melding/2*/*/*.html | perl -MFile::Slurp -lnE '
my ($page, $meta) = m{(.*)/(.*)};
my ($time, $author) = split /[:.]/, $meta;
$time .= "00" while length($time) < 14;
$time =~ s/^(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/$1-$2-$3 $4:$5:/g;
my $html = read_file($_);
chomp, s/\\\K/\\/g, s/\n/\\n/g, s/\t/\\t/g for $html;
say join "\t", $page, $author, $time, $html;
' | psql -c 'COPY comments (page, author, created, message) FROM STDIN'

4 years agoauth: admin edit permissions for page (sub)directories
Mischa POSLAWSKY [Thu, 24 Oct 2019 03:31:40 +0000 (05:31 +0200)]
auth: admin edit permissions for page (sub)directories

Allow edit parameters to match parent directories; for example "edit doc"
to maintain all but only documents.

4 years agoauth: admin subpermission check for edit pages
Mischa POSLAWSKY [Tue, 22 Oct 2019 03:11:28 +0000 (05:11 +0200)]
auth: admin subpermission check for edit pages

Check for specific "edit $path" rights in addition to full "edit",
allowing for partial access.

4 years agositemap: skip subdirectories containing .gitignore
Mischa POSLAWSKY [Sat, 19 Oct 2019 16:01:05 +0000 (18:01 +0200)]
sitemap: skip subdirectories containing .gitignore

Assume html files stored in (partially) untracked directories are not meant
for public distribution.  Fixes unintended inclusion of profile/ pages and
archived documents in data/, and avoids a costly search in thumb/.

4 years agologin/post: ignore ?login override for non user admins
Mischa POSLAWSKY [Thu, 24 Oct 2019 19:47:33 +0000 (21:47 +0200)]
login/post: ignore ?login override for non user admins

Confidential data was not secure from people who acquired these urls.

4 years agologin/edit: password generation for user admins
Mischa POSLAWSKY [Fri, 18 Oct 2019 19:22:25 +0000 (21:22 +0200)]
login/edit: password generation for user admins

Option to reset users of Lijtweg.

4 years agologin/edit: allow setup form for missing users
Mischa POSLAWSKY [Fri, 18 Oct 2019 19:18:38 +0000 (21:18 +0200)]
login/edit: allow setup form for missing users

Fix creation since validation added in commit v3.6-0-gd1fc7642f0
(2018-08-11) [login/emulate: request page as different user].

4 years agologin/edit: reconfigure size attribute
Mischa POSLAWSKY [Fri, 18 Oct 2019 19:15:09 +0000 (21:15 +0200)]
login/edit: reconfigure size attribute

Ignored since syntax change in commit v3.7-15-g1888ccc749 (2018-11-13)
[login/edit: generic setup of input attributes].

4 years agologin/edit: remaining access from user object
Mischa POSLAWSKY [Fri, 18 Oct 2019 19:14:46 +0000 (21:14 +0200)]
login/edit: remaining access from user object

Some optional code paths broken by commit v3.9-8-g882347cba8 (2019-06-28)
[auth: store global user metadata in User object].