--- loncom/interface/loncreateuser.pm 2008/07/13 09:57:29 1.249.2.2
+++ loncom/interface/loncreateuser.pm 2008/07/10 22:07:18 1.251
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.249.2.2 2008/07/13 09:57:29 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.251 2008/07/10 22:07:18 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1396,31 +1396,18 @@ sub modify_login_block {
}
sub personal_data_display {
- my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray) = @_;
- my ($output,$showforceid,%userenv,%canmodify,@inststatuses);
+ my ($ccuname,$ccdomain,$newuser,$context,$inst_results) = @_;
+ my ($output,$showforceid,%userenv,%canmodify);
my @userinfo = ('firstname','middlename','lastname','generation',
'permanentemail','id');
- my $rowcount = 0;
- my $editable = 0;
- if ($context eq 'selfcreate') {
- if (ref($inst_results) eq 'HASH') {
- @inststatuses = &get_inststatuses($inst_results);
- if (@inststatuses == 0) {
- @inststatuses = ('default');
- }
- $rolesarray = \@inststatuses;
- }
- }
if (!$newuser) {
# Get the users information
%userenv = &Apache::lonnet::get('environment',
['firstname','middlename','lastname','generation',
'permanentemail','id'],$ccdomain,$ccuname);
- }
- if ((!$newuser) || ($context eq 'selfcreate')) {
%canmodify =
&Apache::lonuserutils::can_modify_userinfo($context,$ccdomain,
- \@userinfo,$rolesarray);
+ \@userinfo);
}
my %lt=&Apache::lonlocal::texthash(
'pd' => "Personal Data",
@@ -1445,78 +1432,40 @@ sub personal_data_display {
&Apache::lonhtmlcommon::start_pick_box();
foreach my $item (@userinfo) {
my $rowtitle = $lt{$item};
- my $hiderow = 0;
if ($item eq 'generation') {
$rowtitle = $genhelp.$rowtitle;
}
- my $row = &Apache::lonhtmlcommon::row_title($rowtitle,undef,'LC_oddrow_value')."\n";
+ $output .= &Apache::lonhtmlcommon::row_title($rowtitle,undef,'LC_oddrow_value')."\n";
if ($newuser) {
if (ref($inst_results) eq 'HASH') {
if ($inst_results->{$item} ne '') {
- $row .= ''.$inst_results->{$item};
+ $output .= ''.$inst_results->{$item};
} else {
- if ($context eq 'selfcreate') {
- if ($canmodify{$item}) {
- $row .= '';
- $editable ++;
- } else {
- $hiderow = 1;
- }
- } else {
- $row .= '';
- }
+ $output .= '';
}
} else {
- if ($context eq 'selfcreate') {
- if ($canmodify{$item}) {
- $row .= '';
- $editable ++;
- } else {
- $hiderow = 1;
- }
- } else {
- $row .= '';
- }
+ $output .= '';
}
} else {
if ($canmodify{$item}) {
- $row .= '';
+ $output .= '';
} else {
- $row .= $userenv{$item};
+ $output .= $userenv{$item};
}
if ($item eq 'id') {
$showforceid = $canmodify{$item};
}
}
- $row .= &Apache::lonhtmlcommon::row_closure(1);
- if (!$hiderow) {
- $output .= $row;
- $rowcount ++;
- }
+ $output .= &Apache::lonhtmlcommon::row_closure(1);
}
$output .= &Apache::lonhtmlcommon::end_pick_box();
if (wantarray) {
- if ($context eq 'selfcreate') {
- return($output,$rowcount,$editable);
- } else {
- return ($output,$showforceid);
- }
+ return ($output,$showforceid);
} else {
return $output;
}
}
-sub get_inststatuses {
- my ($insthashref) = @_;
- my @inststatuses = ();
- if (ref($insthashref) eq 'HASH') {
- if (ref($insthashref->{'inststatus'}) eq 'ARRAY') {
- @inststatuses = @{$insthashref->{'inststatus'}};
- }
- }
- return @inststatuses;
-}
-
# ================================================================= Phase Three
sub update_user_data {
my ($r,$context) = @_;