version 1.19, 2007/12/21 15:22:01
|
version 1.21, 2007/12/21 20:34:26
|
Line 771 sub forceid_change {
|
Line 771 sub forceid_change {
|
############################################################### |
############################################################### |
############################################################### |
############################################################### |
sub print_upload_manager_form { |
sub print_upload_manager_form { |
my ($r,$context) = @_; |
my ($r,$context,$permission) = @_; |
my $firstLine; |
my $firstLine; |
my $datatoken; |
my $datatoken; |
if (!$env{'form.datatoken'}) { |
if (!$env{'form.datatoken'}) { |
Line 2423 ENDTWO
|
Line 2423 ENDTWO
|
} |
} |
|
|
sub date_section_selector { |
sub date_section_selector { |
my ($context) = @_; |
my ($context,$permission) = @_; |
my $callingform = $env{'form.callingform'}; |
my $callingform = $env{'form.callingform'}; |
my $formname = 'dateselect'; |
my $formname = 'dateselect'; |
my $groupslist = &get_groupslist(); |
my $groupslist = &get_groupslist(); |
Line 2502 END
|
Line 2502 END
|
$starttime = time; |
$starttime = time; |
} |
} |
$date_items = &date_setting_table($starttime,undef,$context, |
$date_items = &date_setting_table($starttime,undef,$context, |
$env{'form.bulkaction'}); |
$env{'form.bulkaction'},$formname, |
|
$permission); |
} |
} |
$output .= '<h3>'.$headertext.'</h3>'. |
$output .= '<h3>'.$headertext.'</h3>'. |
'<form name="'.$formname.'" method="post">'."\n". |
'<form name="'.$formname.'" method="post">'."\n". |
Line 2536 END
|
Line 2537 END
|
$info = '<input type="hidden" name="retainsec" value="0" />'; |
$info = '<input type="hidden" name="retainsec" value="0" />'; |
} |
} |
my $sections_select .= &course_sections(\%sections_count,$env{'form.showrole'}); |
my $sections_select .= &course_sections(\%sections_count,$env{'form.showrole'}); |
my $secbox = '<p>'.&Apache::lonhtmlcommon::start_pick_box()."\n". |
my $rowtitle = &mt('New section to assign'); |
&Apache::lonhtmlcommon::row_title(&mt('New section to assign'),'LC_oddrow_value')."\n". |
my $secbox = §ion_picker($cdom,$cnum,$env{'form.showrole'},$rowtitle,$permission,$context); |
'<table class="LC_createuser"><tr class="LC_section_row">'."\n". |
|
'<td align="center">'.&mt('Existing sections')."\n". |
|
'<br />'.$sections_select.'</td><td align="center">'. |
|
&mt('New section').'<br />'."\n". |
|
'<input type="text" name="newsec" size="15" />'."\n". |
|
'<input type="hidden" name="sections" value="" />'."\n". |
|
'</td></tr></table>'."\n". |
|
&Apache::lonhtmlcommon::row_closure(1)."\n". |
|
&Apache::lonhtmlcommon::end_pick_box().'</p>'; |
|
$output .= $info.$secbox; |
$output .= $info.$secbox; |
} |
} |
$output .= '<p>'. |
$output .= '<p>'. |
Line 2883 sub print_first_users_upload_form {
|
Line 2875 sub print_first_users_upload_form {
|
|
|
# ================================================= Drop/Add from uploaded file |
# ================================================= Drop/Add from uploaded file |
sub upfile_drop_add { |
sub upfile_drop_add { |
my ($r,$context) = @_; |
my ($r,$context,$permission) = @_; |
&Apache::loncommon::load_tmp_file($r); |
&Apache::loncommon::load_tmp_file($r); |
my @userdata=&Apache::loncommon::upfile_record_sep(); |
my @userdata=&Apache::loncommon::upfile_record_sep(); |
if($env{'form.noFirstLine'}){shift(@userdata);} |
if($env{'form.noFirstLine'}){shift(@userdata);} |
Line 3810 sub can_create_user {
|
Line 3802 sub can_create_user {
|
return $cancreate; |
return $cancreate; |
} |
} |
|
|
|
sub can_modify_userinfo { |
|
my ($context,$dom,$fields,$userroles) = @_; |
|
my %domconfig = |
|
&Apache::lonnet::get_dom('configuration',['usermodification'], |
|
$dom); |
|
my %canmodify; |
|
if (ref($fields) eq 'ARRAY') { |
|
foreach my $field (@{$fields}) { |
|
$canmodify{$field} = 0; |
|
if (&Apache::lonnet::allowed('mau',$dom)) { |
|
$canmodify{$field} = 1; |
|
} else { |
|
if (ref($domconfig{'usermodification'}) eq 'HASH') { |
|
if (ref($domconfig{'usermodification'}{$context}) eq 'HASH') { |
|
if (ref($userroles) eq 'ARRAY') { |
|
foreach my $role (@{$userroles}) { |
|
my $testrole; |
|
if ($role =~ /^cr\//) { |
|
$testrole = 'cr'; |
|
} else { |
|
$testrole = $role; |
|
} |
|
if (ref($domconfig{'usermodification'}{$context}{$testrole}) eq 'HASH') { |
|
if ($domconfig{'usermodification'}{$context}{$testrole}{$field}) { |
|
$canmodify{$field} = 1; |
|
last; |
|
} |
|
} |
|
} |
|
} else { |
|
foreach my $key (keys(%{$domconfig{'usermodification'}{$context}})) { |
|
if (ref($domconfig{'usermodification'}{$context}{$key}) eq 'HASH') { |
|
if ($domconfig{'usermodification'}{$context}{$key}{$field}) { |
|
$canmodify{$field} = 1; |
|
last; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} elsif ($context eq 'course') { |
|
if (ref($userroles) eq 'ARRAY') { |
|
if (grep(/^st$/,@{$userroles})) { |
|
$canmodify{$field} = 1; |
|
} |
|
} else { |
|
$canmodify{$field} = 1; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
return %canmodify; |
|
} |
|
|
sub check_usertype { |
sub check_usertype { |
my ($dom,$uname,$rules) = @_; |
my ($dom,$uname,$rules) = @_; |
my $usertype; |
my $usertype; |