diff options
author | Miquel Lionel <lionel@les-miquelots.net> | 2021-06-24 11:55:16 +0100 |
---|---|---|
committer | Miquel Lionel <lionelmiquel@sfr.fr> | 2021-06-24 13:57:59 +0100 |
commit | 6dae1be9e256deb796e99fd2f235bcbd61ccb460 (patch) | |
tree | fb7a4625909acd243c4332afe8ff60c90bf62d16 | |
parent | e11030375845ce40359c9a90122e686d4d58f113 (diff) | |
download | gpigeon-6dae1be9e256deb796e99fd2f235bcbd61ccb460.tar.gz gpigeon-6dae1be9e256deb796e99fd2f235bcbd61ccb460.zip |
Simplify link auto-deletion
-rwxr-xr-x | gpigeon-template.cgi | 1 | ||||
-rw-r--r-- | link-tmpl-template.cgi | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/gpigeon-template.cgi b/gpigeon-template.cgi index 529c589..b9ac7ad 100755 --- a/gpigeon-template.cgi +++ b/gpigeon-template.cgi @@ -221,6 +221,7 @@ if (ValidCookie($id_cookie, $cookies_dir) or argon2id_verify($argon2id_hash,$pw) open my $out, '>', $link_path or die "Can't write to link file: $!"; while( <$in> ) { s/{link_user}/{$link_asker}/g; + s/{link_filename}/{$generated_form_filename}/g; s/{link_web_title}/$text_strings{link_web_title}/g; s/{link_send_btn}/$text_strings{link_send_btn}/g; s/{type_msg_below}/$text_strings{type_msg_below}/g; diff --git a/link-tmpl-template.cgi b/link-tmpl-template.cgi index 2984e9f..aadafc4 100644 --- a/link-tmpl-template.cgi +++ b/link-tmpl-template.cgi @@ -1,5 +1,6 @@ #! /usr/bin/perl -wT my $linkuser = q{link_user}; +my $linkfilename = q{link_filename}; use warnings; use strict; use GPG; @@ -73,9 +74,7 @@ else { } } - if ($0 =~ /([\w]+)\.cgi$/){ - unlink "$1.cgi"; - } + unlink $linkfilename; print "Location: /merci/index.html\n\n"; } } |