Ignore:
Timestamp:
2000-07-13T10:21:53+12:00 (24 years ago)
Author:
sjboddie
Message:

merged changes to trunk into New_Config_Format branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New_Config_Format-branch/gsdl/cgi-bin/webpage_delcol.pl

    r841 r1279  
    1 #!/usr/local/bin/perl5 -w
     1#!perl -w
    22
    33###########################################################################
     
    3030use CGI;
    3131use GSDLHOME;
    32 use Fcntl ':flock';
    3332
    3433require util;
     
    7372    &util::rm_r($col_dir);
    7473
    75     # delete from collections.txt
    76     my $collist_filename
    77         = &util::filename_cat($ENV{'GSDLHOME'},"etc","collections.txt");
    78     if (open(CLIN,"<$collist_filename"))
    79     {
    80         if (flock(CLIN,LOCK_EX))
    81         {
    82         my @keep_dirnames = ();
    83         while (defined($line=<CLIN>))
    84         {
    85             chop $line;
    86             push(@keep_dirnames,$line) if ($line ne $dirname);
    87         }
    88         close(CLIN);
    89 
    90         if (open(CLIN,">$collist_filename"))
    91         {
    92             print CLIN join("\n",@keep_dirnames), "\n";
    93         }
    94 
    95         flock(CLIN,LOCK_UN);
    96         close(CLIN);
    97         }
    98         else
    99         {
    100         # problem locking file
    101         my $mess = "Unable to lock collection list configuration";
    102         $mess .= " file: $collist_filename";
    103         &webpageutil::error_location($args,$mess);
    104         return;
    105         }
    106     }
    107     else
    108     {
    109         # problem opening file for reading in
    110 
    111         my $mess = "Unable to open for input the collection list";
    112         $mess .= " configuration file: $collist_filename";
    113         &webpageutil::error_location($args,$mess);
    114         return;
    115     }
    11674    }
    11775    elsif ($delete_area eq "import")
     
    14098    my $mess_url = "$args->{'httpbuild'}&bca=mess";
    14199    $mess_url .= "&bc1dirname=$dirname" if ($delete_area ne "all");
    142     print "Content: text/html\n\n $mess_url&head=_headdone_&mess=_messdonedelcol_\n\n";
     100    print "Location: $mess_url&head=_headdone_&mess=_messdonedelcol_\n\n";
    143101    return;
    144102
Note: See TracChangeset for help on using the changeset viewer.