From: Joshua Ferraro Date: Tue, 8 Jul 2008 14:43:30 +0000 (-0400) Subject: Try to edit help, don't test, for some reason -w wasn't working X-Git-Tag: ffzg~204 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=7319cdf9d0b09efa8311d31c4fd75faecc7db2b0;p=koha.git Try to edit help, don't test, for some reason -w wasn't working Signed-off-by: Joshua Ferraro --- diff --git a/edithelp.pl b/edithelp.pl index d4cdd5c91d..f9f3c00508 100755 --- a/edithelp.pl +++ b/edithelp.pl @@ -80,10 +80,8 @@ if ( $type eq 'addnew' ) { } elsif ( $type eq 'create' || $type eq 'save' ) { my $file = _get_filepath($referer); - if (! -w $file) { - $error = "Cannot write file: '$file'"; - } else { - open (OUTFILE, ">$file") or die "Cannot write file: '$file'"; # unlikely death, since we just checked + unless (open (OUTFILE, ">$file")) {$error = "Cannot write file: '$file'";} else { + #open (OUTFILE, ">$file") or die "Cannot write file: '$file'"; # unlikely death, since we just checked # file is open write to it print OUTFILE "\n"; print OUTFILE ($type eq 'create') ? "
\n$help\n
" : $help; @@ -91,6 +89,7 @@ elsif ( $type eq 'create' || $type eq 'save' ) { close OUTFILE; print $input->redirect("/cgi-bin/koha/help.pl?url=$oldreferer"); } + } elsif ( $type eq 'modify' ) { # open file load data, kill include calls, pass data to the template