#! /usr/local/bin/perl # # Replacement reuse repository # # modify fetches the repository entry to be editted, and posts # back to the user as a form for modification. # # $Header: /home1/horton/rds/bin/RCS/modify.pl,v 1.2 1998/10/19 06:15:13 horton Exp horton $ # cgi-bin/reuse/modify.pl $repository="/home/horton/rds/entries"; $librarian="horton"; # close (STDERR); # STDERR = STDOUT; chdir($repository) || die "Content-type: text/html\nCannot access database - " . $repository; #open (STDERR,"> /dev/null"); # RCS installed in /usr/local/bin $ENV{'PATH'} = $ENV{'PATH'} .":/usr/local/bin"; $user = $ENV{'REMOTE_USER'}; eval &'do_determine_entry; sub send_which_oid { printf("Content-type: text/html\n\n"); printf("Reuse\n"); printf("

Modify Asset number

"); printf("\n"); printf("Enter the asset number that you wish to edit.\n"); printf("Home\n"); printf("\n"); } sub do_determine_entry { do { &'send_which_oid; return; } unless defined @ARGV; local($oid) = $ARGV[0]; if (! -r $oid . ".html") { printf("Content-type: text/html\n\n%s.html cannot be opennedEntry %s cannot be found?\n\n", $oid, $oid) ; die $repository . "/" . $oid . ".html" . ":cannot open" ; } printf("Content-type: text/html\n\n"); printf("\n"); printf("CiTR Repository \n"); printf("\n"); printf("\n"); printf("

Modify Asset no. %s

\n", $oid); printf("
\n"); printf("Your username :

\n"); printf("Reason :

\n"); printf("\n"); printf("



\n"); # printf("
Internal entry number is %s, \n", $ioid); # printf("Requested entry is %s

\n", $oid); if ($ioid != $oid) { printf("Mismatch between file name (%s.html) and entry (%s)

\n", $oid, $ioid); printf("\n"); &mail_error("Mismatch between file name ($oid.html) and entry ($ioid)"); } else { printf("\n", $oid); } printf("

\n"); printf("Home\n"); printf("\n\n"); } sub mail_error { $mess = $_[0]; open (EM, "| mail $librarian"); print EM "To: $librarian\n"; print EM "Subject: error detected in repository submission\n"; print EM "--------\n"; print EM "\n"; print EM "$mess\n"; close (EM); print STDERR "$mess\n"; }