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

albertel lon-capa-cvs@mail.lon-capa.org
Fri, 14 Oct 2005 20:00:35 -0000


albertel		Fri Oct 14 16:00:35 2005 EDT

  Modified files:              
    /loncom/homework	bridgetask.pm 
    /loncom/interface	slotrequest.pm 
  Log:
  - allow use of a secret word rather than the password (optionally)
  
  
Index: loncom/homework/bridgetask.pm
diff -u loncom/homework/bridgetask.pm:1.71 loncom/homework/bridgetask.pm:1.72
--- loncom/homework/bridgetask.pm:1.71	Fri Oct 14 13:27:23 2005
+++ loncom/homework/bridgetask.pm	Fri Oct 14 16:00:23 2005
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA 
 # definition of tags that give a structure to a document
 #
-# $Id: bridgetask.pm,v 1.71 2005/10/14 17:27:23 albertel Exp $
+# $Id: bridgetask.pm,v 1.72 2005/10/14 20:00:23 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -68,8 +68,18 @@
     foreach my $possible (@allowed) {
 	my ($puser,$pdom)=(split('@',$possible));
 	if ($puser eq $user && $pdom eq $domain) {
-	    my $authhost=&Apache::lonnet::authenticate($puser,$env{'form.proctorpassword'},$pdom);
-	    if ($authhost ne 'no_host') {
+	    my $authenticated=0;
+	    if ( $slot->{'secret'} =~ /\S/ &&
+		 $env{'form.proctorpassword'} eq $slot->{'secret'} ) {
+		$authenticated=1;
+	    } else {
+		
+		my $authhost=&Apache::lonnet::authenticate($puser,$env{'form.proctorpassword'},$pdom);
+		if ($authhost ne 'no_host') {
+		    $authenticated=1;
+		}
+	    }
+	    if ($authenticated) {
 		my $version=
 		    $Apache::lonhomework::results{'resource.version'}=
 		    ++$Apache::lonhomework::history{'resource.version'};
Index: loncom/interface/slotrequest.pm
diff -u loncom/interface/slotrequest.pm:1.21 loncom/interface/slotrequest.pm:1.22
--- loncom/interface/slotrequest.pm:1.21	Fri Oct 14 15:30:36 2005
+++ loncom/interface/slotrequest.pm	Fri Oct 14 16:00:34 2005
@@ -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.21 2005/10/14 19:30:36 albertel Exp $
+# $Id: slotrequest.pm,v 1.22 2005/10/14 20:00:34 albertel Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -475,6 +475,7 @@
   <th>'.$linkstart.'description">Description</a></th>
   <th>'.$linkstart.'starttime"  >Start Time</a></th>
   <th>'.$linkstart.'endtime"    >End Time</a></th>
+  <th>'.$linkstart.'secret"     >Secret</a></th>
   <th>'.$linkstart.'maxspace"   >Max space</a></th>
   <th>                           Scheduled Students</th>
   <th>'.$linkstart.'unique"     >Unique Period</a></th>
@@ -551,6 +552,7 @@
  <td>$description</td>
  <td>$start</td>
  <td>$end</td>
+ <td>$slots{$slot}->{'secret'}</td>
  <td>$slots{$slot}->{'maxspace'}</td>
  <td>$ids</td>
  <td>$unique</td>