--- loncom/interface/lonuserutils.pm 2008/06/24 16:17:05 1.59
+++ loncom/interface/lonuserutils.pm 2008/09/11 19:42:28 1.65
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Utility functions for managing LON-CAPA user accounts
#
-# $Id: lonuserutils.pm,v 1.59 2008/06/24 16:17:05 bisitz Exp $
+# $Id: lonuserutils.pm,v 1.65 2008/09/11 19:42:28 droeschl Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -169,7 +169,7 @@ sub propagate_id_change {
}
sub update_classlist {
- my ($cdom,$cnum,$udom,$uname,$user) = @_;
+ my ($cdom,$cnum,$udom,$uname,$user,$newend) = @_;
my ($uid,$classlistentry);
my $fullname =
&Apache::lonnet::format_name($user->{'firstname'},$user->{'middlename'},
@@ -180,15 +180,37 @@ sub update_classlist {
my @classinfo = split(/:/,$classhash{$uname.':'.$udom});
my $ididx=&Apache::loncoursedata::CL_ID() - 2;
my $nameidx=&Apache::loncoursedata::CL_FULLNAME() - 2;
+ my $endidx = &Apache::loncoursedata::CL_END() - 2;
+ my $startidx = &Apache::loncoursedata::CL_START() - 2;
for (my $i=0; $i<@classinfo; $i++) {
- if ($i == $ididx) {
+ if ($i == $endidx) {
+ if ($newend ne '') {
+ $classlistentry .= $newend.':';
+ } else {
+ $classlistentry .= $classinfo[$i].':';
+ }
+ } elsif ($i == $startidx) {
+ if ($newend ne '') {
+ if ($classinfo[$i] > $newend) {
+ $classlistentry .= $newend.':';
+ } else {
+ $classlistentry .= $classinfo[$i].':';
+ }
+ } else {
+ $classlistentry .= $classinfo[$i].':';
+ }
+ } elsif ($i == $ididx) {
if (defined($user->{'id'})) {
$classlistentry .= $user->{'id'}.':';
} else {
$classlistentry .= $classinfo[$i].':';
}
} elsif ($i == $nameidx) {
- $classlistentry .= $fullname.':';
+ if (defined($user->{'lastname'})) {
+ $classlistentry .= $fullname.':';
+ } else {
+ $classlistentry .= $classinfo[$i].':';
+ }
} else {
$classlistentry .= $classinfo[$i].':';
}
@@ -558,7 +580,7 @@ function verify(vf,sec_caller) {
if (tw==11) { foundrole=1; }
if (tw==12) { founddomain=1; }
}
- verify_message(vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail,foundrole,founddom);
+ verify_message(vf,founduname,foundpwd,foundname,foundid,foundsec,foundemail,foundrole,founddomain);
}
//
@@ -779,8 +801,7 @@ sub print_upload_manager_footer {
'onClick="javascript:verify(this.form,this.form.csec)" '.
'value="'.&mt('Update Users').'" />'."
\n";
if ($context eq 'course') {
- $Str .= &mt('Note: for large courses, this operation may be time '.
- 'consuming');
+ $Str .= &mt('Note: for large courses, this operation may be time consuming');
}
$Str .= '';
$r->print($Str);
@@ -790,15 +811,15 @@ sub print_upload_manager_footer {
sub forceid_change {
my ($context) = @_;
my $output =
- "
\n".'
'."\n".
+ &mt('Disable Student/Employee ID Safeguard and force change of conflicting IDs').
+ '
'."\n".
&mt('(only do if you know what you are doing.)')."\n";
if ($context eq 'domain') {
$output .= '
'."\n";
}
$output .= '
'. + &mt('Your CSV file').' '.&mt('is ready for download').'.
'."\n"); $r->rflush(); } if ($mode eq 'autoenroll') { @@ -3593,16 +3613,8 @@ sub upfile_drop_add { ''); next; } else { - my $baddom = 0; if ($entries{$fields{'dom'}} ne &LONCAPA::clean_domain($entries{$fields{'domain'}})) { - $baddom = 1; - } else { - if (&Apache::lonnet::domain($entries{$fields{'domain'}}) eq '') { - $baddom = 1; - } - } - if ($baddom) { $r->print('