[LON-CAPA-cvs] cvs: loncom /interface loncommon.pm lonmodifycourse.pm
raeburn
lon-capa-cvs-allow@mail.lon-capa.org
Mon, 24 Sep 2007 23:29:55 -0000
raeburn Mon Sep 24 19:29:55 2007 EDT
Modified files:
/loncom/interface loncommon.pm lonmodifycourse.pm
Log:
Only allow selection of default authentication method used for auto-enrollment in a course from types available to Domain Coordinator (set in domain config).
Index: loncom/interface/loncommon.pm
diff -u loncom/interface/loncommon.pm:1.586 loncom/interface/loncommon.pm:1.587
--- loncom/interface/loncommon.pm:1.586 Wed Sep 19 02:24:26 2007
+++ loncom/interface/loncommon.pm Mon Sep 24 19:29:53 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# a pile of common routines
#
-# $Id: loncommon.pm,v 1.586 2007/09/19 06:24:26 raeburn Exp $
+# $Id: loncommon.pm,v 1.587 2007/09/24 23:29:53 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1883,6 +1883,14 @@
}
if (!$can_assign{'krb4'} && !$can_assign{'krb5'}) {
return;
+ } elsif ($authtype eq '') {
+ if (grep(/^mode$/,(keys(%in)))) {
+ if ($in{'mode'} eq 'modifycourse') {
+ if ($authnum == 1) {
+ $authtype = '<input type="hidden" name="login" value="krb">';
+ }
+ }
+ }
}
$jscall = "javascript:changed_radio('krb',$in{'formname'});";
if ($authtype eq '') {
@@ -1956,6 +1964,14 @@
}
if (!$can_assign{'int'}) {
return;
+ } elsif ($authtype eq '') {
+ if (grep(/^mode$/,(keys(%in)))) {
+ if ($in{'mode'} eq 'modifycourse') {
+ if ($authnum == 1) {
+ $authtype = '<input type="hidden" name="login" value="int">';
+ }
+ }
+ }
}
$jscall = "javascript:changed_radio('int',$in{'formname'});";
if ($authtype eq '') {
@@ -1997,6 +2013,14 @@
}
if (!$can_assign{'loc'}) {
return;
+ } elsif ($authtype eq '') {
+ if (grep(/^mode$/,(keys(%in)))) {
+ if ($in{'mode'} eq 'modifycourse') {
+ if ($authnum == 1) {
+ $authtype = '<input type="hidden" name="login" value="loc">';
+ }
+ }
+ }
}
$jscall = "javascript:changed_radio('loc',$in{'formname'});";
if ($authtype eq '') {
@@ -2035,6 +2059,14 @@
}
if (!$can_assign{'fsys'}) {
return;
+ } elsif ($authtype eq '') {
+ if (grep(/^mode$/,(keys(%in)))) {
+ if ($in{'mode'} eq 'modifycourse') {
+ if ($authnum == 1) {
+ $authtype = '<input type="hidden" name="login" value="fsys">';
+ }
+ }
+ }
}
$jscall = "javascript:changed_radio('fsys',$in{'formname'});";
if ($authtype eq '') {
@@ -2095,7 +2127,6 @@
return ($authnum,%can_assign);
}
-
###############################################################
## Get Authentication Defaults for Domain ##
###############################################################
Index: loncom/interface/lonmodifycourse.pm
diff -u loncom/interface/lonmodifycourse.pm:1.31 loncom/interface/lonmodifycourse.pm:1.32
--- loncom/interface/lonmodifycourse.pm:1.31 Wed Mar 7 20:58:45 2007
+++ loncom/interface/lonmodifycourse.pm Mon Sep 24 19:29:53 2007
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# handler for DC-only modifiable course settings
#
-# $Id: lonmodifycourse.pm,v 1.31 2007/03/08 01:58:45 albertel Exp $
+# $Id: lonmodifycourse.pm,v 1.32 2007/09/24 23:29:53 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -313,7 +313,7 @@
'usrd' => 'Use the radio buttons to select a different course owner.',
'deam' => "Default Authentication method",
'deus' => "The default authentication method, and default authentication parameter (domain, initial password or argument) are used when automatic enrollment of students in a course requires addition of new user accounts in your domain, and the class list file contains empty entries for the <authtype> and <autharg> properties for the new student. If you choose 'internally authenticated', and leave the initial password field empty, the automated enrollment process will create a randomized password for each new student account that it adds to your LON-CAPA domain.",
- 'gobt' => "Modify settings",
+ 'gobt' => "Save",
);
my @bgcolors = ('#eeeeee','#cccccc');
@@ -377,10 +377,15 @@
curr_authtype => $curr_authtype,
curr_autharg => $enrollvar{'autharg'}
);
- my $krbform = &Apache::loncommon::authform_kerberos(%param);
- my $intform = &Apache::loncommon::authform_internal(%param);
- my $locform = &Apache::loncommon::authform_local(%param);
-
+ my (%authform,$authenitems);
+ $authform{'krb'} = &Apache::loncommon::authform_kerberos(%param);
+ $authform{'int'} = &Apache::loncommon::authform_internal(%param);
+ $authform{'loc'} = &Apache::loncommon::authform_local(%param);
+ foreach my $item ('krb','int','loc') {
+ if ($authform{$item} ne '') {
+ $authenitems .= $authform{$item}.'<br />';
+ }
+ }
if ($numlocalcc == 0) {
$ownertable = $lt{'nocc'};
}
@@ -437,7 +442,7 @@
</p><p>
<table width="100%" cellspacing="6" cellpadding="6">
<tr>
- <td colspan="2">Use the appropriate text boxes and radio buttons below to change some or all of the four automated enrollment settings that may only be changed by a Domain Coordinator. Click the <b>"$lt{'gobt'}"</b> button to save your changes.</td>
+ <td colspan="2">Use the appropriate text boxes and radio buttons below to change some or all of the four automated enrollment settings that may only be changed by a Domain Coordinator.
</tr>
<tr>
<td width="50%" valign="top">
@@ -455,12 +460,7 @@
<tr>
<td width="50%" valign="top">
<b>$lt{'deam'}:</b><br/><br/>
- $krbform
- <br/>
- $intform
- <br/>
- $locform
- <br/>
+ $authenitems
<br/>
$lt{'deus'}.
</td>