--- loncom/interface/loncreateuser.pm 2001/12/19 17:17:46 1.22
+++ loncom/interface/loncreateuser.pm 2002/04/23 21:05:45 1.33
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.22 2001/12/19 17:17:46 albertel Exp $
+# $Id: loncreateuser.pm,v 1.33 2002/04/23 21:05:45 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -45,8 +45,9 @@
# April Guy Albertelli
# 05/10,10/16 Gerd Kortemeyer
# 11/12,11/13,11/15 Scott Harrison
+# 02/11/02 Matthew Hall
#
-# $Id: loncreateuser.pm,v 1.22 2001/12/19 17:17:46 albertel Exp $
+# $Id: loncreateuser.pm,v 1.33 2002/04/23 21:05:45 matthew Exp $
###
package Apache::loncreateuser;
@@ -63,123 +64,20 @@ my $authformint;
my $authformfsys;
my $authformloc;
-sub BEGIN {
+BEGIN {
$ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/;
my $krbdefdom=$1;
$krbdefdom=~tr/a-z/A-Z/;
- $authformnop=(<
-
-Do not change login data
-
-END
- $authformkrb=(<
-
-Kerberos authenticated with domain
-
-
-END
- $authformint=(<
-
-Internally authenticated (with initial password
-)
-
-END
- $authformfsys=(<
-
-Filesystem authenticated (with initial password
-)
-
-END
- $authformloc=(<
-
-Local Authentication with argument
-
-
-END
- $loginscript=(<
-function setkrb(vf) {
- if (vf.krbdom.value!='') {
- vf.login[0].checked=true;
- vf.krbdom.value=vf.krbdom.value.toUpperCase();
- vf.intpwd.value='';
- vf.fsyspwd.value='';
- vf.locarg.value='';
- }
-}
-
-function setint(vf) {
- if (vf.intpwd.value!='') {
- vf.login[1].checked=true;
- vf.krbdom.value='';
- vf.fsyspwd.value='';
- vf.locarg.value='';
- }
-}
-
-function setfsys(vf) {
- if (vf.fsyspwd.value!='') {
- vf.login[2].checked=true;
- vf.krbdom.value='';
- vf.intpwd.value='';
- vf.locarg.value='';
- }
-}
-
-function setloc(vf) {
- if (vf.locarg.value!='') {
- vf.login[3].checked=true;
- vf.krbdom.value='';
- vf.intpwd.value='';
- vf.fsyspwd.value='';
- }
-}
-
-function clicknop(vf) {
- vf.krbdom.value='';
- vf.intpwd.value='';
- vf.fsyspwd.value='';
- vf.locarg.value='';
-}
-
-function clickkrb(vf) {
- vf.krbdom.value='$krbdefdom';
- vf.intpwd.value='';
- vf.fsyspwd.value='';
- vf.locarg.value='';
-}
-
-function clickint(vf) {
- vf.krbdom.value='';
- vf.fsyspwd.value='';
- vf.locarg.value='';
-}
-
-function clickfsys(vf) {
- vf.krbdom.value='';
- vf.intpwd.value='';
- vf.locarg.value='';
-}
-
-function clickloc(vf) {
- vf.krbdom.value='';
- vf.intpwd.value='';
- vf.fsyspwd.value='';
-}
-
-ENDLOGINSCRIPT
- $generalrule=<
-As a general rule, only authors or co-authors should be filesystem
-authenticated (which allows access to the server filesystem).
-
-END
+ my %param = ( formname => 'document.cu',
+ kerb_def_dom => $krbdefdom
+ );
+ $loginscript = &Apache::loncommon::authform_header(%param);
+ $generalrule = &Apache::loncommon::authform_authorwarning(%param);
+ $authformnop = &Apache::loncommon::authform_nochange(%param);
+ $authformkrb = &Apache::loncommon::authform_kerberos(%param);
+ $authformint = &Apache::loncommon::authform_internal(%param);
+ $authformfsys = &Apache::loncommon::authform_filesystem(%param);
+ $authformloc = &Apache::loncommon::authform_local(%param);
}
# =================================================================== Phase one
@@ -187,7 +85,9 @@ END
sub phase_one {
my $r=shift;
my $defdom=$ENV{'user.domain'};
- $r->print(<print(<<"ENDDOCUMENT");
The LearningOnline Network with CAPA
@@ -196,8 +96,10 @@ sub phase_one {
Create User, Change User Privileges
@@ -206,7 +108,6 @@ ENDDOCUMENT
}
# =================================================================== Phase two
-
sub phase_two {
my $r=shift;
my $ccuname=$ENV{'form.ccuname'};
@@ -215,16 +116,20 @@ sub phase_two {
$ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/;
my $krbdefdom=$1;
$krbdefdom=~tr/a-z/A-Z/;
+ my %param = ( formname => 'document.cu',
+ kerb_def_dom => $krbdefdom
+ );
+ $loginscript = &Apache::loncommon::authform_header(%param);
my $defdom=$ENV{'user.domain'};
$ccuname=~s/\W//g;
$ccdomain=~s/\W//g;
- $r->print(<
The LearningOnline Network with CAPA
-
-
-Create User, Change User Privileges
-');
+ $r->print(&course_level_table(%inccourses));
+ $r->print("
\n");
+ $r->print("