[LON-CAPA-cvs] cvs: loncom /auth lonroles.pm /interface loncreatecourse.pm

www lon-capa-cvs@mail.lon-capa.org
Mon, 24 Mar 2003 14:45:09 -0000


www		Mon Mar 24 09:45:09 2003 EDT

  Modified files:              
    /loncom/auth	lonroles.pm 
    /loncom/interface	loncreatecourse.pm 
  Log:
  Can now open course with access key restriction
  
  
Index: loncom/auth/lonroles.pm
diff -u loncom/auth/lonroles.pm:1.53 loncom/auth/lonroles.pm:1.54
--- loncom/auth/lonroles.pm:1.53	Sat Mar 22 20:46:51 2003
+++ loncom/auth/lonroles.pm	Mon Mar 24 09:45:09 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # User Roles Screen
 #
-# $Id: lonroles.pm,v 1.53 2003/03/23 01:46:51 www Exp $
+# $Id: lonroles.pm,v 1.54 2003/03/24 14:45:09 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -104,13 +104,13 @@
 # student attempts to register a new key
                           } else {
 # print form to enter a new key
-	                 $r->content_type('text/html');
-                         &Apache::loncommon::no_cache($r);
-                         $r->send_http_header;
-                         my $swinfo=&Apache::lonmenu::rawconfig();
-                         my $bodytag=&Apache::loncommon::bodytag
-                         ('Enter Access Key to Unlock this Course');
-                         $r->print(<<ENDENTERKEY);
+	                     $r->content_type('text/html');
+			     &Apache::loncommon::no_cache($r);
+			     $r->send_http_header;
+			     my $swinfo=&Apache::lonmenu::rawconfig();
+			     my $bodytag=&Apache::loncommon::bodytag
+				 ('Enter Access Key to Unlock this Course');
+			     $r->print(<<ENDENTERKEY);
 <head><title>Entering Course Access Key</title>
 </head>
 <html>
@@ -125,6 +125,7 @@
 </form>
 </body></html>
 ENDENTERKEY
+                            return OK;
                          }
                       }
 		  }
Index: loncom/interface/loncreatecourse.pm
diff -u loncom/interface/loncreatecourse.pm:1.17 loncom/interface/loncreatecourse.pm:1.18
--- loncom/interface/loncreatecourse.pm:1.17	Thu Feb  6 21:02:57 2003
+++ loncom/interface/loncreatecourse.pm	Mon Mar 24 09:45:09 2003
@@ -1,7 +1,7 @@
 # The LearningOnline Network
 # Create a course
 #
-# $Id: loncreatecourse.pm,v 1.17 2003/02/07 02:02:57 www Exp $
+# $Id: loncreatecourse.pm,v 1.18 2003/03/24 14:45:09 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -140,6 +140,11 @@
 <b>Disable student resource discussion: </b>
 <input type="checkbox" name="disresdis" />
 </p>
+<h2>Access Control</h2>
+<p>
+<b>Students need access key to enter course: </b>
+<input type="checkbox" name="setkeys" />
+</p>
 <h2>Course Coordinator</h2>
 <p>
 <b>Username:</b> <input type="text" size="15" name="ccuname" />
@@ -226,6 +231,14 @@
            $envflag=1;
            $cenv{'question.email'}=$ccuname.':'.$ccdomain;
        }
+       if ($ENV{'form.keys'}) {
+           $envflag=1;
+           $cenv{'question.email'}=$ccuname.':'.$ccdomain;
+       }
+    }
+    if ($ENV{'form.setkeys'}) {
+       $envflag=1;
+       $cenv{'keyaccess'}='yes';
     }
     if ($ENV{'form.disresdis'}) {
 	$envflag=1;