X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/533793ee462552dd0b782a69e2cfe48c8f93dedc..ebd57a96ae0c0b61d1234c1776b9764f184c0315:/IkiWiki.pm diff --git a/IkiWiki.pm b/IkiWiki.pm index c497dd38f..75c957932 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -22,7 +22,7 @@ our @EXPORT = qw(hook debug error htmlpage template template_depends htmllink readfile writefile pagetype srcfile pagename displaytime strftime_utf8 will_render gettext ngettext urlto targetpage add_underlay pagetitle titlepage linkpage newpagefile - inject add_link add_autofile + inject add_link add_autofile useragent %config %links %pagestate %wikistate %renderedfiles %pagesources %destsources %typedlinks); our $VERSION = 3.00; # plugin interface version, next is ikiwiki version @@ -513,6 +513,14 @@ sub getsetup () { safe => 0, rebuild => 0, }, + cookiejar => { + type => "string", + default => "$ENV{HOME}/.ikiwiki/cookies", + description => "cookie control", + example => { file => "$ENV{HOME}/.ikiwiki/cookies" }, + safe => 0, # hooks into perl module internals + rebuild => 0, + }, } sub defaultconfig () { @@ -2274,6 +2282,13 @@ sub add_autofile ($$$) { $autofiles{$file}{generator}=$generator; } +sub useragent () { + return LWP::UserAgent->new( + cookie_jar => $config{cookiejar}, + env_proxy => 1, # respect proxy env vars + ); +} + sub sortspec_translate ($$) { my $spec = shift; my $reverse = shift;