[LON-CAPA-cvs] cvs: modules /gerd/authorspace cpfiles.pl

www www@source.lon-capa.org
Thu, 23 Jun 2011 21:03:16 -0000


www		Thu Jun 23 21:03:16 2011 EDT

  Added files:                 
    /modules/gerd/authorspace	cpfiles.pl 
  Log:
  Starting PIML script to move author spaces
  
  

Index: modules/gerd/authorspace/cpfiles.pl
+++ modules/gerd/authorspace/cpfiles.pl
use strict;

# Domains hosted on this server
my @thislibdoms=();
# Read the host table
open(IN,"/home/httpd/lonTabs/dns_hosts.tab");
while (my $line=<IN>) {
   if ($line=~/^\s*\#/) { next; }
   chomp($line);
   unless ($line=~/\S/) { next; }
   my ($server,$domain,$function,$ip,$protocol,$interdom)=split(/\:/,$line);
# Okay, now is this me?
}
close(IN);

# Go over all directories in the /home-directory
foreach my $home_directory (</home/*>) {
# Extract the author name
   my ($author) = ($home_directory=~/\/([^\/]+)$/); 
# Does this have a public_html-directory?
   unless (-e "/home/$author/public_html") { next; }
   print "$author\n";
}