Try to edit help, don't test, for some reason -w wasn't working
authorJoshua Ferraro <jmf@liblime.com>
Tue, 8 Jul 2008 14:43:30 +0000 (10:43 -0400)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 8 Jul 2008 14:45:19 +0000 (09:45 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
edithelp.pl

index d4cdd5c..f9f3c00 100755 (executable)
@@ -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 "<!-- TMPL_INCLUDE NAME=\"help-top.inc\" -->\n";
                print OUTFILE ($type eq 'create') ? "<div class=\"main\">\n$help\n</div>" : $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