[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /lonnet/perl lonnet.pm

raeburn raeburn at source.lon-capa.org
Tue Sep 25 19:06:07 EDT 2012


raeburn		Tue Sep 25 23:06:07 2012 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/lonnet/perl	lonnet.pm 
  Log:
  - For 2.11.
    - Backport 1.1190.
  
  
Index: loncom/lonnet/perl/lonnet.pm
diff -u loncom/lonnet/perl/lonnet.pm:1.1172.2.10 loncom/lonnet/perl/lonnet.pm:1.1172.2.11
--- loncom/lonnet/perl/lonnet.pm:1.1172.2.10	Sun Sep  2 16:23:02 2012
+++ loncom/lonnet/perl/lonnet.pm	Tue Sep 25 23:06:07 2012
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # TCP networking package
 #
-# $Id: lonnet.pm,v 1.1172.2.10 2012/09/02 16:23:02 raeburn Exp $
+# $Id: lonnet.pm,v 1.1172.2.11 2012/09/25 23:06:07 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -9976,7 +9976,7 @@
 # --------------------------------------------------------------- Verify a symb
 
 sub symbverify {
-    my ($symb,$thisurl)=@_;
+    my ($symb,$thisurl,$encstate)=@_;
     my $thisfn=$thisurl;
     $thisfn=&declutter($thisfn);
 # direct jump to resource in page or to a sequence - will construct own symbs
@@ -10013,6 +10013,9 @@
                if (
   &symbclean(&declutter($bighash{'map_id_'.$mapid}).'___'.$resid.'___'.$thisfn)
    eq $symb) { 
+                   if (ref($encstate)) {
+                       $$encstate = $bighash{'encrypted_'.$id};
+                   }
 		   if (($env{'request.role.adv'}) ||
 		       ($bighash{'encrypted_'.$id} eq $env{'request.enc'}) ||
                        ($thisurl eq '/adm/navmaps')) {
@@ -12213,11 +12216,14 @@
 
 =item *
 
-symbverify($symb,$thisfn) : verifies that $symb actually exists and is
-a possible symb for the URL in $thisfn, and if is an encryypted
+symbverify($symb,$thisfn,$ecstate) : verifies that $symb actually exists
+and is a possible symb for the URL in $thisfn, and if is an encrypted
 resource that the user accessed using /enc/ returns a 1 on success, 0
-on failure, user must be in a course, as it assumes the existance of
-the course initial hash, and uses $env('request.course.id'}
+on failure, user must be in a course, as it assumes the existence of
+the course initial hash, and uses $env('request.course.id'}.  The third
+arg is an optional reference to a scalar.  If this arg is passed in the
+call to symbverify, it will be set to 1 if the symb has been set to be 
+encrypted; otherwise it will be null.
 
 
 =item *




More information about the LON-CAPA-cvs mailing list