[LON-CAPA-cvs] cvs: loncom /auth loncacc.pm /interface loncss.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 27 Nov 2006 16:47:16 -0000


albertel		Mon Nov 27 11:47:16 2006 EDT

  Modified files:              
    /loncom/interface	loncss.pm 
    /loncom/auth	loncacc.pm 
  Log:
  - conversion over to using helper er
  
  
Index: loncom/interface/loncss.pm
diff -u loncom/interface/loncss.pm:1.5 loncom/interface/loncss.pm:1.6
--- loncom/interface/loncss.pm:1.5	Wed Sep 27 18:48:42 2006
+++ loncom/interface/loncss.pm	Mon Nov 27 11:47:16 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # gerenates a lon-capa CSS response
 #
-# $Id: loncss.pm,v 1.5 2006/09/27 22:48:42 albertel Exp $
+# $Id: loncss.pm,v 1.6 2006/11/27 16:47:16 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -33,6 +33,7 @@
 use Apache::Constants qw(:common);
 use POSIX qw(strftime);
 use CGI::Cookie();
+use LONCAPA;
 
 sub handler {
     my ($r) = @_;
@@ -53,8 +54,7 @@
 
     my $handle;
     if ($cookies{'lonID'}) {
-	$handle=$cookies{'lonID'}->value;
-        $handle=~s/\W//g;
+	$handle=&LONCAPA::clean_handle($cookies{'lonID'}->value);
     }
 
     if ($handle ne '' 
Index: loncom/auth/loncacc.pm
diff -u loncom/auth/loncacc.pm:1.42 loncom/auth/loncacc.pm:1.43
--- loncom/auth/loncacc.pm:1.42	Wed Nov 22 20:49:41 2006
+++ loncom/auth/loncacc.pm	Mon Nov 27 11:47:16 2006
@@ -2,7 +2,7 @@
 # Cookie Based Access Handler for Construction Area
 # (lonacc: 5/21/99,5/22,5/29,5/31 Gerd Kortemeyer)
 #
-# $Id: loncacc.pm,v 1.42 2006/11/23 01:49:41 albertel Exp $
+# $Id: loncacc.pm,v 1.43 2006/11/27 16:47:16 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -36,10 +36,11 @@
 use Apache::lonlocal;
 use Apache::lonnet;
 use Apache::lonacc;
+use LONCAPA qw(:DEFAULT :match);
 
 sub constructaccess {
     my ($url,$ownerdomain)=@_;
-    my ($ownername)=($url=~/\/(?:\~|priv\/|home\/)(\w+)\//);
+    my ($ownername)=($url=~/\/(?:\~|priv\/|home\/)($match_username)\//);
     unless (($ownername) && ($ownerdomain)) { return ''; }
     # We do not allow editing of previous versions of files.
     if ($url=~/\.(\d+)\.(\w+)$/) { return ''; }