[LON-CAPA-cvs] cvs: loncom /homework bridgetask.pm /interface slotrequest.pm

albertel lon-capa-cvs@mail.lon-capa.org
Mon, 10 Apr 2006 07:37:39 -0000


This is a MIME encoded message

--albertel1144654659
Content-Type: text/plain

albertel		Mon Apr 10 03:37:39 2006 EDT

  Modified files:              
    /loncom/interface	slotrequest.pm 
    /loncom/homework	bridgetask.pm 
  Log:
  - switching to use the more official : as domain username seperator (rather tahn @, since MSU will want @ in valid usernames)
  
  
--albertel1144654659
Content-Type: text/plain
Content-Disposition: attachment; filename="albertel-20060410033739.txt"

Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.56 loncom/interface/slotrequest.pm:1.57
--- loncom/interface/slotrequest.pm:1.56	Thu Mar 30 00:20:44 2006
+++ loncom/interface/slotrequest.pm	Mon Apr 10 03:37:16 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler for requesting to have slots added to a students record
 #
-# $Id: slotrequest.pm,v 1.56 2006/03/30 05:20:44 albertel Exp $
+# $Id: slotrequest.pm,v 1.57 2006/04/10 07:37:16 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -254,7 +254,7 @@
 	    if (&network_error($value)) { 
 		return 'error: Unable to determine current status';
 	    }
-	    my $me=$env{'user.name'}.'@'.$env{'user.domain'};
+	    my $me=$env{'user.name'}.':'.$env{'user.domain'};
 	    foreach my $key (keys(%consumed)) {
 		if ($consumed{$key}->{'name'} eq $me) {
 		    my $num=(split('\0',$key))[1];
@@ -284,7 +284,7 @@
 	return undef;
     }
     
-    my %reservation=('name'      => $env{'user.name'}.'@'.$env{'user.domain'},
+    my %reservation=('name'      => $env{'user.name'}.':'.$env{'user.domain'},
 		     'timestamp' => time,
 		     'symb'      => $symb);
 
@@ -397,7 +397,7 @@
 
     foreach my $entry (sort { $consumed{$a}{'name'} cmp 
 				  $consumed{$b}{'name'} } (keys(%consumed))) {
-	my ($uname,$udom) = split('@',$consumed{$entry}{'name'});
+	my ($uname,$udom) = split(':',$consumed{$entry}{'name'});
 	my ($result,$msg) =
 	    &release_reservation($slot_name,$uname,$udom,
 				 $consumed{$entry}{'symb'},$mgr);
@@ -465,7 +465,7 @@
     my %consumed=&Apache::lonnet::dump('slot_reservations',$cdom,$cnum,
 				       "^$slot_name\0");
     foreach my $entry (keys(%consumed)) {
-	if ( $consumed{$entry}->{'name'} eq ($uname.'@'.$udom) ) {
+	if ( $consumed{$entry}->{'name'} eq ($uname.':'.$udom) ) {
 	    &Apache::lonnet::del('slot_reservations',[$entry],
 				 $cdom,$cnum);
 	}
@@ -1055,14 +1055,14 @@
 					      $consumed{$b}{name} }
 				   (keys(%consumed))) {
 		    my (undef,$id)=split("\0",$entry);
-		    my ($uname,$udom) = split('@',$consumed{$entry}{'name'});
+		    my ($uname,$udom) = split(':',$consumed{$entry}{'name'});
 		    $ids.= '<nobr>';
 		    foreach my $item (@stu_display_order) {
 			if ($stu_display{$item}) {
 			    if ($item eq 'fullname') {
 				$ids.=$fullname->{"$uname:$udom"}.' ';
 			    } elsif ($item eq 'username') {
-				$ids.="<tt>$uname\@$udom</tt> ";
+				$ids.="<tt>$uname:$udom</tt> ";
 			    }
 			}
 		    }
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.137 loncom/homework/bridgetask.pm:1.138
--- loncom/homework/bridgetask.pm:1.137	Mon Apr 10 03:30:54 2006
+++ loncom/homework/bridgetask.pm	Mon Apr 10 03:37:39 2006
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.137 2006/04/10 07:30:54 albertel Exp $
+# $Id: bridgetask.pm,v 1.138 2006/04/10 07:37:39 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -66,7 +66,7 @@
     
     my @allowed=split(",",$slot->{'proctor'});
     foreach my $possible (@allowed) {
-	my ($puser,$pdom)=(split('@',$possible));
+	my ($puser,$pdom)=(split(':',$possible));
 	if ($puser eq $user && $pdom eq $domain) {
 	    my $authenticated=0;
 	    if ( $slot->{'secret'} =~ /\S/ &&
@@ -95,7 +95,7 @@
 		#setup new version and who did it
 		$Apache::lonhomework::results{'resource.0.version'}=$version;
 		$Apache::lonhomework::results{"resource.$version.0.checkedin"}=
-		    $user.'@'.$domain;
+		    $user.':'.$domain;
 		$Apache::lonhomework::results{"resource.$version.0.checkedin.slot"}=
 		    $slot_name;
 
@@ -103,7 +103,7 @@
 	    } elsif ($authenticated && $type eq 'problem') {
 		&Apache::lonxml::debug("authed $slot_name");
 		$Apache::lonhomework::results{"resource.0.checkedin"}=
-		    $user.'@'.$domain;
+		    $user.':'.$domain;
 		$Apache::lonhomework::results{"resource.0.checkedin.slot"}=
 		    $slot_name;
 	    }
@@ -632,7 +632,7 @@
     }
 
 
-    my $me=$env{'user.name'}.'@'.$env{'user.domain'};
+    my $me=$env{'user.name'}.':'.$env{'user.domain'};
 
     #need to try both queues..
     if (defined($env{'form.regradeaspecificsubmission'}) &&
@@ -678,7 +678,7 @@
 	#otherwise (defined($who) && $who ne $me) some else has it...
 	return (undef,'not_allowed',
 		&mt('Another user ([_1]) currently has the record for [_2] locked.',
-		    $who,$env{'form.gradinguser'}.'@'.$env{'form.gradingdomain'}));
+		    $who,$env{'form.gradinguser'}.':'.$env{'form.gradingdomain'}));
     }
 
 
@@ -906,7 +906,7 @@
 	    }
 	    &Apache::lonxml::debug("all dim ".join(':',@Apache::bridgetask::dimensionlist)."results -> m_f $mandatory_failed o_p $optional_passed u $ungraded r $review");
 	    $Apache::lonhomework::results{'resource.0.regrader'}=
-		$env{'user.name'}.'@'.$env{'user.domain'};
+		$env{'user.name'}.':'.$env{'user.domain'};
 	    if ($review) {
 		$Apache::lonhomework::results{"resource.$version.0.status"}='review';
 		if ($env{'form.queue'} eq 'reviewqueue') {
@@ -1022,11 +1022,11 @@
     if ($queue eq 'none') { return 'ok'; }
     my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();
     if (!defined($key)) {
-	$key="$symb\0queue\0$uname\@$udom";
+	$key="$symb\0queue\0$uname:$udom";
     }
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
-    my $me=$env{'user.name'}.'@'.$env{'user.domain'};
+    my $me=$env{'user.name'}.':'.$env{'user.domain'};
     my $who=&queue_key_locked($queue,$key,$cdom,$cnum);
     if  ($who eq $me) {
 	return &Apache::lonnet::del($queue,["$key\0locked"],$cdom,$cnum);
@@ -1089,7 +1089,7 @@
     my ($symb,$cid,$udom,$uname)=&Apache::lonxml::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
-    my $todo="$symb\0queue\0$uname\@$udom";
+    my $todo="$symb\0queue\0$uname:$udom";
     my ($key,$value)=&Apache::lonnet::get($queue,[$todo],$cdom,$cnum);
     if ($key eq $todo && ref($value)) {
 	return $value;
@@ -1135,7 +1135,7 @@
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
     my %data;
-    $data{"$symb\0queue\0$uname\@$udom"}=$user_data;
+    $data{"$symb\0queue\0$uname:$udom"}=$user_data;
     return &Apache::lonnet::cput($queue,\%data,$cdom,$cnum);
 }
 
@@ -1184,7 +1184,7 @@
 		my $ekey=&Apache::lonnet::escape($key);
 		my ($action,$description,$status)=('select',&mt('Select'));
 		if (exists($queue{"$key\0locked"})) {
-		    my $me=$env{'user.name'}.'@'.$env{'user.domain'};
+		    my $me=$env{'user.name'}.':'.$env{'user.domain'};
 		    $status=&mt('Locked by <tt>[_1]</tt>',$queue{"$key\0locked"});
 		    if ($me eq $queue{"$key\0locked"}) {
 			($action,$description)=('resume',&mt('Resume'));
@@ -1218,7 +1218,7 @@
 		}
 	    }
 	    $result.= "<td>".$fullname->{$uname.':'.$udom}.
-		" <tt>($uname\@$udom)</tt> </td>";
+		" <tt>($uname:$udom)</tt> </td>";
 	    $result.='<td>Slot: '.$slot.' End time: '.
 		&Apache::lonlocal::locallocaltime($slot_data{'endtime'}).
 		"</td></tr>";
@@ -1265,13 +1265,13 @@
 
 sub encode_queue_key {
     my ($symb,$udom,$uname)=@_;
-    return "$symb\0queue\0$uname\@$udom";
+    return "$symb\0queue\0$uname:$udom";
 }
 
 sub decode_queue_key {
     my ($key)=@_;
     my ($symb,undef,$user) = split("\0",$key);
-    my ($uname,$udom) = split('@',$user);
+    my ($uname,$udom) = split(':',$user);
     return ($symb,$uname,$udom);
 }
 
@@ -1334,7 +1334,7 @@
 sub find_mid_grade {
     my ($queue,$symb,$cdom,$cnum)=@_;
     my $todo=&Apache::lonnet::unescape($env{'form.gradingkey'});
-    my $me=$env{'user.name'}.'@'.$env{'user.domain'};
+    my $me=$env{'user.name'}.':'.$env{'user.domain'};
     if ($todo) {
 	my $who=&queue_key_locked($queue,$todo,$cdom,$cnum);
 	if ($who eq $me) { return $todo; }
@@ -1354,7 +1354,7 @@
 
 sub lock_key {
     my ($queue,$todo)=@_;
-    my $me=$env{'user.name'}.'@'.$env{'user.domain'};
+    my $me=$env{'user.name'}.':'.$env{'user.domain'};
     my (undef,$cid)=&Apache::lonxml::whichuser();
     my $cnum=$env{'course.'.$cid.'.num'};
     my $cdom=$env{'course.'.$cid.'.domain'};
@@ -1848,7 +1848,7 @@
     foreach my $t (1..$Apache::lonhomework::history{'version'}) {
 	if (exists($Apache::lonhomework::history{$t.':resource.0.regrader'})) {
 	    my ($gname,$gdom) = 
-		split('@',$Apache::lonhomework::history{$t.':resource.0.regrader'});
+		split(':',$Apache::lonhomework::history{$t.':resource.0.regrader'});
 	    my $fullname = &Apache::loncommon::plainname($gname,$gdom);
 	    $grader = &Apache::loncommon::aboutmewrapper($fullname,
 							 $gname,$gdom);
@@ -1972,7 +1972,7 @@
       <tr><td colspan="2">Student who should be logged in is:</td></tr>
       <tr><td>Name:</td><td>$name</td></tr>
       <tr><td>Student ID:</td><td>$env{'environment.id'}</td></tr>
-      <tr><td>Usename</td><td>$user\@$domain</td></tr>
+      <tr><td>Usename</td><td>$user:$domain</td></tr>
       <tr><td colspan="2"><img src="$url" /></td></tr>
     </table>
   </tr></td>

--albertel1144654659--