[LON-CAPA-cvs] cvs: loncom /publisher loncleanup.pm

albertel lon-capa-cvs@mail.lon-capa.org
Sat, 28 May 2005 18:53:51 -0000


albertel		Sat May 28 14:53:51 2005 EDT

  Modified files:              
    /loncom/publisher	loncleanup.pm 
  Log:
  - I hate the Style police too, but they keep breaking into my house and committing cleaned up code...
  
  
Index: loncom/publisher/loncleanup.pm
diff -u loncom/publisher/loncleanup.pm:1.2 loncom/publisher/loncleanup.pm:1.3
--- loncom/publisher/loncleanup.pm:1.2	Fri May 27 22:18:03 2005
+++ loncom/publisher/loncleanup.pm	Sat May 28 14:53:50 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to cleanup XML files
 #
-# $Id: loncleanup.pm,v 1.2 2005/05/28 02:18:03 www Exp $
+# $Id: loncleanup.pm,v 1.3 2005/05/28 18:53:50 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -257,62 +257,62 @@
 # ---------------------------------------------------------------- Main Handler
 sub handler {
 
-  my $r=shift;
+    my $r=shift;
 
 
 # Get query string for limited number of parameters
 
-  &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
-					  ['filename']);
+    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
+					    ['filename']);
 
-  if ($env{'form.filename'}) {
-      $fn=$env{'form.filename'};
-      $fn=~s/^http\:\/\/[^\/]+//;
-  } else {
-     $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
-         ' unspecified filename for cleanup', $r->filename); 
-     return HTTP_NOT_FOUND;
-  }
-
-  unless ($fn) { 
-     $r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
-         ' trying to cleanup non-existing file', $r->filename); 
-     return HTTP_NOT_FOUND;
-  } 
+    if ($env{'form.filename'}) {
+	$fn=$env{'form.filename'};
+	$fn=~s/^http\:\/\/[^\/]+//;
+    } else {
+	$r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
+		       ' unspecified filename for cleanup', $r->filename); 
+	return HTTP_NOT_FOUND;
+    }
+
+    unless ($fn) { 
+	$r->log_reason($env{'user.name'}.' at '.$env{'user.domain'}.
+		       ' trying to cleanup non-existing file', $r->filename); 
+	return HTTP_NOT_FOUND;
+    } 
 
 # ----------------------------------------------------------- Start page output
-  my $uname;
-  my $udom;
+    my $uname;
+    my $udom;
+
+    ($uname,$udom)=
+	&Apache::loncacc::constructaccess($fn,$r->dir_config('lonDefDomain'));
+    unless (($uname) && ($udom)) {
+	$r->log_reason($uname.' at '.$udom.
+		       ' trying to cleanup file '.$env{'form.filename'}.
+		       ' ('.$fn.') - not authorized', 
+		       $r->filename); 
+	return HTTP_NOT_ACCEPTABLE;
+    }
+
+    $fn=~s/\/\~(\w+)//;
 
-  ($uname,$udom)=
-    &Apache::loncacc::constructaccess($fn,$r->dir_config('lonDefDomain'));
-  unless (($uname) && ($udom)) {
-     $r->log_reason($uname.' at '.$udom.
-         ' trying to cleanup file '.$env{'form.filename'}.
-         ' ('.$fn.') - not authorized', 
-         $r->filename); 
-     return HTTP_NOT_ACCEPTABLE;
-  }
-
-  $fn=~s/\/\~(\w+)//;
-
-  &Apache::loncommon::content_type($r,'text/html');
-  $r->send_http_header;
-
-  $r->print('<html><head><title>LON-CAPA Construction Space</title></head>');
-
-  $r->print(&Apache::loncommon::bodytag('Cleanup XML Document'));
-
-  if ($env{'form.phase'} eq 'three') {
-      &phasethree($r,$fn,$uname,$udom);
-  } elsif ($env{'form.phase'} eq 'two') {
-      &phasetwo($r,$fn,$uname,$udom);
-  } else {
-      &phaseone($r,$fn,$uname,$udom);
-  }
+    &Apache::loncommon::content_type($r,'text/html');
+    $r->send_http_header;
+
+    $r->print('<html><head><title>LON-CAPA Construction Space</title></head>');
+
+    $r->print(&Apache::loncommon::bodytag('Cleanup XML Document'));
+
+    if ($env{'form.phase'} eq 'three') {
+	&phasethree($r,$fn,$uname,$udom);
+    } elsif ($env{'form.phase'} eq 'two') {
+	&phasetwo($r,$fn,$uname,$udom);
+    } else {
+	&phaseone($r,$fn,$uname,$udom);
+    }
 
-  $r->print('</body></html>');
-  return OK;  
+    $r->print('</body></html>');
+    return OK;  
 }
 
 1;