[LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 15 Apr 2005 21:28:54 -0000


albertel		Fri Apr 15 17:28:54 2005 EDT

  Modified files:              
    /loncom/interface	lonnavmaps.pm 
  Log:
  - death to ::reply
  
  
Index: loncom/interface/lonnavmaps.pm
diff -u loncom/interface/lonnavmaps.pm:1.324 loncom/interface/lonnavmaps.pm:1.325
--- loncom/interface/lonnavmaps.pm:1.324	Fri Apr 15 17:08:37 2005
+++ loncom/interface/lonnavmaps.pm	Fri Apr 15 17:28:54 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Navigate Maps Handler
 #
-# $Id: lonnavmaps.pm,v 1.324 2005/04/15 21:08:37 albertel Exp $
+# $Id: lonnavmaps.pm,v 1.325 2005/04/15 21:28:54 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2114,43 +2114,32 @@
     my $udom=$env{'user.domain'};
     my $uhome=$env{'user.home'};
     my $cid=$env{'request.course.id'};
-    my $chome=$env{'course.'.$cid.'.home'};
     my ($cdom,$cnum)=split(/\_/,$cid);
     
-    my $userprefix=$uname.'_'.$udom.'_';
-    
-    my %courserdatas; my %useropt; my %courseopt; my %userrdatas;
+    my %useropt; my %courseopt;
     unless ($uhome eq 'no_host') { 
 # ------------------------------------------------- Get coursedata (if present)
-	my $reply=&Apache::lonnet::reply('dump:'.$cdom.':'.$cnum.
-					 ':resourcedata',$chome);
+	%courseopt=&Apache::lonnet::dump('resourcedata',$cdom,$cnum);
 	# Check for network failure
-	if ( $reply =~ /no.such.host/i || $reply =~ /con_lost/i) {
+	my ($tmp)=keys(%courseopt);
+
+	if ( $tmp =~ /no.such.host/i || $tmp =~ /con_lost/i) {
 	    $self->{NETWORK_FAILURE} = 1;
-	} elsif ($reply!~/^error\:/) {
-	    $courserdatas{$cid}=$reply;
-	    $courserdatas{$cid.'.last_cache'}=time;
-	}
-	foreach (split(/\&/,$courserdatas{$cid})) {
-	    my ($name,$value)=split(/\=/,$_);
-	    $courseopt{$userprefix.&Apache::lonnet::unescape($name)}=
-		&Apache::lonnet::unescape($value);
+	    undef(%courseopt);
+	} elsif ($tmp=~/^error\:/) {
+	    undef(%courseopt);
 	}
+
 # --------------------------------------------------- Get userdata (if present)
-	my $reply=&Apache::lonnet::reply('dump:'.$udom.':'.$uname.':resourcedata',$uhome);
-	if ($reply!~/^error\:/) {
-	    $userrdatas{$uname.'___'.$udom}=$reply;
-	    $userrdatas{$uname.'___'.$udom.'.last_cache'}=time;
-	}
-	# check to see if network failed
-	elsif ( $reply=~/no.such.host/i || $reply=~/con.*lost/i )
-	{
+	
+	%useropt=&Apache::lonnet::dump('resourcedata',$udom,$uname);
+	($tmp)=keys(%courseopt);
+	if ($tmp=~/^error\:/) {
+	    undef(%useropt);
+	} elsif ( $tmp=~/no.such.host/i || $tmp=~/con.lost/i ) {
+	    # check to see if network failed
 	    $self->{NETWORK_FAILURE} = 1;
-	}
-	foreach (split(/\&/,$userrdatas{$uname.'___'.$udom})) {
-	    my ($name,$value)=split(/\=/,$_);
-	    $useropt{$userprefix.&Apache::lonnet::unescape($name)}=
-		&Apache::lonnet::unescape($value);
+	    undef(%useropt);
 	}
 	$self->{COURSE_OPT} = \%courseopt;
 	$self->{USER_OPT} = \%useropt;
@@ -2187,13 +2176,10 @@
 
     my %feedback=();
     my %error=();
-    my $keys = &Apache::lonnet::reply('keys:'.
-				      $env{'user.domain'}.':'.
-				      $env{'user.name'}.':nohist_email',
-				      $env{'user.home'});
+    my @keys = &Apache::lonnet::getkeys('nohist_email',$env{'user.domain'},
+					$env{'user.name'});
     
-    foreach my $msgid (split(/\&/, $keys)) {
-	$msgid=&Apache::lonnet::unescape($msgid);
+    foreach my $msgid (@keys) {
 	if ((!$emailstatus{$msgid}) || ($emailstatus{$msgid} eq 'new')) {
 	    my $plain=
 		&Apache::lonnet::unescape(&Apache::lonnet::unescape($msgid));
@@ -2457,7 +2443,7 @@
 
     my $symbparm=$symb.'.'.$what;
     my $mapparm=$mapname.'___(all).'.$what;
-    my $usercourseprefix=$uname.'_'.$udom.'_'.$cid;
+    my $usercourseprefix=$cid;
 
     my $seclevel= $usercourseprefix.'.['.$csec.'].'.$what;
     my $seclevelr=$usercourseprefix.'.['.$csec.'].'.$symbparm;