--- loncom/interface/londocs.pm 2006/11/29 22:02:47 1.261
+++ loncom/interface/londocs.pm 2007/06/11 17:13:30 1.274
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Documents
#
-# $Id: londocs.pm,v 1.261 2006/11/29 22:02:47 www Exp $
+# $Id: londocs.pm,v 1.274 2007/06/11 17:13:30 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -42,7 +42,7 @@ use HTML::Entities;
use GDBM_File;
use Apache::lonlocal;
use Cwd;
-use LONCAPA;
+use LONCAPA qw(:DEFAULT :match);
my $iconpath;
@@ -99,7 +99,7 @@ sub authorhosts {
$ca=$env{'user.name'};
$cd=$env{'user.domain'};
} else {
- ($cd,$ca)=($realm=~/^\/(\w+)\/(\w+)$/);
+ ($cd,$ca)=($realm=~/^\/($match_domain)\/($match_username)$/);
}
my $allowed=0;
my $myhome=&Apache::lonnet::homeserver($ca,$cd);
@@ -235,7 +235,6 @@ sub dumpcourse {
my ($ext)=($_=~/\.(\w+)$/);
my $title=$hash{'title_'.$hash{
'ids_/uploaded/'.$origcrsdata{'domain'}.'/'.$origcrsdata{'num'}.'/'.$_}};
- $title=~s/:/:/g;
$r->print('
'.($title?$title:' ').' | ');
if (!$title) {
$title=$_;
@@ -366,7 +365,7 @@ sub exportcourse {
if (ref($curRes)) {
my $symb = $curRes->symb();
my $ressymb = $symb;
- if ($ressymb =~ m|adm/(\w+)/(\w+)/(\d+)/bulletinboard$|) {
+ if ($ressymb =~ m|adm/($match_domain)/($match_username)/(\d+)/bulletinboard$|) {
unless ($ressymb =~ m|adm/wrapper/adm|) {
$ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard';
}
@@ -613,7 +612,7 @@ sub build_package {
if (grep/^$count$/,@$discussions) {
my $ressymb = $symb;
my $mode;
- if ($ressymb =~ m|adm/(\w+)/(\w+)/(\d+)/bulletinboard$|) {
+ if ($ressymb =~ m|adm/($match_domain)/($match_username)/(\d+)/bulletinboard$|) {
unless ($ressymb =~ m|adm/wrapper/adm|) {
$ressymb = 'bulletin___'.$3.'___adm/wrapper/adm/'.$1.'/'.$2.'/'.$3.'/bulletinboard';
}
@@ -698,7 +697,7 @@ sub process_content {
}
} elsif ($symb =~ m-lib/templates/examupload\.problem$-) {
$content_type = 'examupload';
- } elsif ($symb =~ m-adm/(\w+)/(\w+)/(\d+)/bulletinboard$-) {
+ } elsif ($symb =~ m-adm/($match_domain)/($match_username)/(\d+)/bulletinboard$-) {
$content_type = 'bulletinboard';
my $contents = &Apache::imsexport::templatedpage($content_type,$3,$count,\@uploads,$1,$2);
if ($contents) {
@@ -913,7 +912,7 @@ sub group_import {
while (@_) {
my $name = shift;
my $url = shift;
- if (($url =~ m#^/uploaded/$coursedom/$coursenum/(default_\d+\.)(page|sequence)$#) && ($caller eq 'londocs')) {
+ if (($url =~ m{^/uploaded/\Q$coursedom\E/\Q$coursenum\E/(default_\d+\.)(page|sequence)$}) && ($caller eq 'londocs')) {
my $errtext = '';
my $fatal = 0;
my $newmapstr = '