--- loncom/interface/loncreateuser.pm 2001/02/15 00:57:41 1.1
+++ loncom/interface/loncreateuser.pm 2001/11/16 06:23:11 1.20
@@ -1,4 +1,4 @@
-# The LearningOnline Network
+# The LearningOnline Network with CAPA
# Create a user
#
# (Create a course
@@ -10,34 +10,159 @@
# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
#
+# YEAR=2001
# 3/1/1 Gerd Kortemeyer)
#
# 3/1 Gerd Kortemeyer)
#
# 2/14 Gerd Kortemeyer)
#
-# 2/14 Gerd Kortemeyer
+# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17,3/24,04/12 Gerd Kortemeyer
+# April Guy Albertelli
+# 05/10,10/16 Gerd Kortemeyer
+# 11/12,11/13,11/15 Scott Harrison
#
+# $Id: loncreateuser.pm,v 1.20 2001/11/16 06:23:11 harris41 Exp $
+###
+
package Apache::loncreateuser;
use strict;
use Apache::Constants qw(:common :http);
use Apache::lonnet;
-sub handler {
- my $r = shift;
+my $loginscript; # piece of javascript used in two separate instances
+my $generalrule;
+my $authformnop;
+my $authformkrb;
+my $authformint;
+my $authformfsys;
+my $authformloc;
- if ($r->header_only) {
- $r->content_type('text/html');
- $r->send_http_header;
- return OK;
- }
+sub 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='';
+ }
+}
- if (&Apache::lonnet::allowed('ccc',$ENV{'user.domain'})) {
- $r->content_type('text/html');
- $r->send_http_header;
+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
+}
+# =================================================================== Phase one
+sub phase_one {
+ my $r=shift;
+ my $defdom=$ENV{'user.domain'};
$r->print(<
@@ -45,14 +170,525 @@ sub handler {
Create User, Change User Privileges
-
+