-path => "$Odin::PASTEBIN_PATH/", %attr;
}
+ sub hasuff ($) {
+ my ($edit) = @_;
+ return $Odin::COOKIE{"odin-cookie-probe"} ? "" : "?honc=$edit";
+ }
+
+ Odin::bake_cookie $r, "odin-cookie-probe=t";
+
my %props = (
lang => $lang, title => $title,
content => Odin::tidy_pastebin_content $content
$m->print($old{content});
} else {
$edit = $Odin::COOKIE{"odin-handoff.$tag"};
- $m->comp("%show", tag => $tag, edit => $edit, %old);
+ $m->comp("%show", tag => $tag,
+ honc => $honc, edit => $edit // $honc, %old);
}
} else {
if ($op eq "del") {
} else {
set_handoff_cookie $tag, $edit;
my $editp = Odin::update_pastebin $tag, $edit, %props;
- if ($editp) { $m->redirect("$Odin::PASTEBIN/$tag"); }
- else { $m->comp("%edit", tag => $tag, edit => $edit, %props); }
+ if ($editp) {
+ $m->redirect("$Odin::PASTEBIN/$tag" . hasuff $edit);
+ } else {
+ $m->comp("%edit", tag => $tag, edit => $edit, %props);
+ }
}
}
} elsif (defined $content) {
($tag, $edit) = Odin::new_pastebin %props;
set_handoff_cookie $tag, $edit;
- $m->redirect("$Odin::PASTEBIN/$tag");
+ $m->redirect("$Odin::PASTEBIN/$tag" . hasuff $edit);
} else {
Odin::path_info($r) =~ m:/$:
or $m->redirect("$Odin::PASTEBIN/", 301);
$edit => undef
$lang => undef
$title => undef
+ $honc => undef
$op => "edit"
</%args>
%#