File: webmodDel.cgi

package info (click to toggle)
plan 1.8.7-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,196 kB
  • ctags: 1,971
  • sloc: ansic: 24,392; perl: 1,361; sh: 1,030; makefile: 514; yacc: 120; sed: 17
file content (67 lines) | stat: -rwxr-xr-x 1,756 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/perl
#--------------------------------------------------------------------------

#--------------------------------------------------------------------------
require ("./cgi-lib.pl") || die "can\'t require cgi-lib.pl: $!";;
require ("./common.pl") || die "can\'t require common.pl: $!";;

#--------------------------------------------------------------------------
#--------------------------------------------------------------------------
sub header {
   local($mo,$yr)=@_;

   print "Content-type: text/html


<HTML>
<HEAD>
<TITLE>January 1999</TITLE>
</HEAD>
<BODY>
";
} # header

#--------------------------------------------------------------------------
# Print the content of the FORM
#--------------------------------------------------------------------------
sub delete {

   print "<FONT COLOR=\"#0000ff\">Attempt to delete ... </FONT>\n";

   if ( $Qui ne $Userid ) { 
	print "<FONT COLOR=\"#ff0000\">Can not delete: please use \"Get Calendar\" to re-sync</FONT>\n";
        return;
   }
   else {
   	open ( IN , "/usr/local/bin/plan -W -X $Row $Qui |" );
   	@error=<IN>;
   	close(IN);
	foreach $line ( @error ) { 
		print "$line\n";
	}
	print "Done. Please use \"Get Calendar\" to re-sync\n";
   }
} # form

#--------------------------------------------------------------------------
# Print the Footer
#--------------------------------------------------------------------------
sub footer {
   print <<"END";
END
   print "</HTML>";
} # footer

#--------------------------------------------------------------------------
# Main Function 
#--------------------------------------------------------------------------
   &ReadParse;
   $Row=$in{row};
   $Qui=$in{qui};
   $Userid=$in{userid};


   &header;
   &delete;
   &footer;