[LON-CAPA-cvs] cvs: modules /sharrison/hosts_tab manage_hosts.pl
harris41
lon-capa-cvs@mail.lon-capa.org
Sun, 25 Aug 2002 14:54:04 -0000
harris41 Sun Aug 25 10:54:04 2002 EDT
Added files:
/modules/sharrison/hosts_tab manage_hosts.pl
Log:
basic scheme of handling hosts.tab; functionality not yet written
Index: modules/sharrison/hosts_tab/manage_hosts.pl
+++ modules/sharrison/hosts_tab/manage_hosts.pl
#!/usr/bin/perl
=pod
=head1 NAME
B<manage_hosts.pl> - Allow user to view hosts.tab and manager to edit hosts.tab
=head1 SYNOPSIS
This is a CGI script. I<Need to include apache configuration here.>
=head1 DESCRIPTION
General narrative: First choose between development or production. If
in SSL mode, authenticate with htpasswd, and then allow management.
Otherwise, just allow for viewing.
=AUTHOR
Scott Harrison, 2002, sharrison@users.sourceforge.net
Written to help the LON-CAPA project.
=cut
# ==================================================================== Modules.
# Probably CGI.
# Mail parser.
# ===================================== Determine if production or development.
# Time-out (when the user could choose "development") and then automatically
# blink to production.
# ================================================ Either show, or allow edits.
# If in http:// mode, then only show list.
# If in https:// mode with the right htpasswd user, then allow for edits.
# ============================================= Read in the relevant hosts.tab.
open(IN,'<hosts.tab');
while(<IN>)
{
chomp; # remove new-line
push(@entries,$_); # build array with hosts.tab entries
}
close(IN);
# ========== Scan in the e-mail and query the hosts.tab manager about response.
# The manager can either:
# "okay", "postpone", "delete" or "hand-edit" the hosts.tab request.
# =============================================== Output the new hosts_new.tab.
open(OUT,'>hosts_new.tab');
close(OUT);