Diff for /loncom/lonnet/perl/lonnet.pm between versions 1.832 and 1.835

version 1.832, 2007/02/16 01:04:19 version 1.835, 2007/02/23 00:23:46
Line 5134  sub is_locked { Line 5134  sub is_locked {
   
 sub declutter_portfile {  sub declutter_portfile {
     my ($file) = @_;      my ($file) = @_;
     &logthis("got $file");      $file =~ s{^(/portfolio/|portfolio/)}{/};
     $file =~ s-^(/portfolio/|portfolio/)-/-;  
     &logthis("ret $file");  
     return $file;      return $file;
 }  }
   
Line 7087  sub setup_random_from_rndseed { Line 7085  sub setup_random_from_rndseed {
 }  }
   
 sub latest_receipt_algorithm_id {  sub latest_receipt_algorithm_id {
     return 'receipt2';      return 'receipt3';
 }  }
   
 sub recunique {  sub recunique {
     my $fucourseid=shift;      my $fucourseid=shift;
     my $unique;      my $unique;
     if ($env{"course.$fucourseid.receiptalg"} eq 'receipt2') {      if ($env{"course.$fucourseid.receiptalg"} eq 'receipt2' ||
    $env{"course.$fucourseid.receiptalg"} eq 'receipt3' ) {
  $unique=$env{"course.$fucourseid.internal.encseed"};   $unique=$env{"course.$fucourseid.internal.encseed"};
     } else {      } else {
  $unique=$perlvar{'lonReceipt'};   $unique=$perlvar{'lonReceipt'};
Line 7104  sub recunique { Line 7103  sub recunique {
 sub recprefix {  sub recprefix {
     my $fucourseid=shift;      my $fucourseid=shift;
     my $prefix;      my $prefix;
     if ($env{"course.$fucourseid.receiptalg"} eq 'receipt2') {      if ($env{"course.$fucourseid.receiptalg"} eq 'receipt2'||
    $env{"course.$fucourseid.receiptalg"} eq 'receipt3' ) {
  $prefix=$env{"course.$fucourseid.internal.encpref"};   $prefix=$env{"course.$fucourseid.internal.encpref"};
     } else {      } else {
  $prefix=$perlvar{'lonHostID'};   $prefix=$perlvar{'lonHostID'};
Line 7114  sub recprefix { Line 7114  sub recprefix {
   
 sub ireceipt {  sub ireceipt {
     my ($funame,$fudom,$fucourseid,$fusymb,$part)=@_;      my ($funame,$fudom,$fucourseid,$fusymb,$part)=@_;
   
       my $return =&recprefix($fucourseid).'-';
   
       if ($env{"course.$fucourseid.receiptalg"} eq 'receipt3' ||
    $env{'request.state'} eq 'construct') {
    $return .= (&digest("$funame,$fudom,$fucourseid,$fusymb,$part")%10000);
    return $return;
       }
   
     my $cuname=unpack("%32C*",$funame);      my $cuname=unpack("%32C*",$funame);
     my $cudom=unpack("%32C*",$fudom);      my $cudom=unpack("%32C*",$fudom);
     my $cucourseid=unpack("%32C*",$fucourseid);      my $cucourseid=unpack("%32C*",$fucourseid);
     my $cusymb=unpack("%32C*",$fusymb);      my $cusymb=unpack("%32C*",$fusymb);
     my $cunique=&recunique($fucourseid);      my $cunique=&recunique($fucourseid);
     my $cpart=unpack("%32S*",$part);      my $cpart=unpack("%32S*",$part);
     my $return =&recprefix($fucourseid).'-';      if ($env{"course.$fucourseid.receiptalg"} eq 'receipt2') {
     if ($env{"course.$fucourseid.receiptalg"} eq 'receipt2' ||  
  $env{'request.state'} eq 'construct') {  
  #&logthis("doing receipt2  using parts $cpart, uname $cuname and udom $cudom gets  ".($cpart%$cuname)." and ".($cpart%$cudom));   #&logthis("doing receipt2  using parts $cpart, uname $cuname and udom $cudom gets  ".($cpart%$cuname)." and ".($cpart%$cudom));
                 
  $return.= ($cunique%$cuname+   $return.= ($cunique%$cuname+
Line 7973  explanation of a user role term Line 7981  explanation of a user role term
   
 =item *  =item *
   
 get_my_roles($uname,$udom,$types,$roles,$roledoms) : All arguments are optional.  Returns a hash of a user's roles, with keys set to colon-sparated $uname,$udom,and $role, and value set to colon-separated start and end times for the role. If no username and domain are specified, will default to current user/domain. Types, roles, and roledoms are references to arrays, of role statuses (active, future or previous), roles (e.g., cc,in, st etc.) and domains of the roles which can be used to restrict the list if roles reported. If no array ref is provided for types, will default to return only active roles.    get_my_roles($uname,$udom,$types,$roles,$roledoms) : All arguments are
   optional.  Returns a hash of a user's roles, with keys set to
   colon-sparated $uname,$udom,and $role, and value set to
   colon-separated start and end times for the role. If no username and
   domain are specified, will default to current user/domain. Types,
   roles, and roledoms are references to arrays, of role statuses
   (active, future or previous), roles (e.g., cc,in, st etc.) and domains
   of the roles which can be used to restrict the list if roles
   reported. If no array ref is provided for types, will default to
   return only active roles.
   
 =back  =back
   
 =head2 User Modification  =head2 User Modification

Removed from v.1.832  
changed lines
  Added in v.1.835


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>