use Data::Dumper;
use CGI qw( -no_xhtml);
+use IO::File;
use SL::Auth;
use SL::Form;
use SL::Locale;
_login($client, $login);
}
+sub templates_cache_writable {
+ my $dir = $::lx_office_conf{paths}->{userspath} . '/templates-cache';
+ return 1 if -w $dir;
+
+ # Try actually creating a file. Due to ACLs this might be possible
+ # even if the basic Unix permissions and Perl's -w test say
+ # otherwise.
+ my $file = "${dir}/.writetest";
+ my $out = IO::File->new($file, "w") || return 0;
+ $out->close;
+ unlink $file;
+
+ return 1;
+}
+
1;
Support::TestSetup::login();
+if (!Support::TestSetup::templates_cache_writable()) {
+ plan skip_all => 'Cache dir not writable for this test';
+} else {
+ plan tests => 19;
+}
+
sub reset_test_env {
$ENV{HTTP_USER_AGENT} = 'Perl Tests';
Support::TestSetup::login();
+if (!Support::TestSetup::templates_cache_writable()) {
+ plan skip_all => 'Cache dir not writable for this test';
+} else {
+ plan tests => 11;
+}
+
my $pr = SL::Presenter->get;
# Passing invalid parameters: