version 1.201, 2007/12/05 17:40:29
|
version 1.202, 2007/12/05 21:23:14
|
Line 627 sub print_user_modification_page {
|
Line 627 sub print_user_modification_page {
|
} |
} |
ENDSCRIPT |
ENDSCRIPT |
} else { |
} else { |
$nondc_setsection_code = |
$nondc_setsection_code = |
&Apache::lonuserutils::setsections_javascript('cu',$groupslist); |
&Apache::lonuserutils::setsections_javascript('cu',$groupslist); |
} |
} |
my $js = &user_modification_js($pjump_def,$dc_setcourse_code, |
my $js = &user_modification_js($pjump_def,$dc_setcourse_code, |
Line 1198 ENDBADAUTH
|
Line 1198 ENDBADAUTH
|
} |
} |
} else { # Authentication type is valid |
} else { # Authentication type is valid |
&initialize_authen_forms($ccdomain,$currentauth); |
&initialize_authen_forms($ccdomain,$currentauth); |
my $authformnop_row; |
my $authformnop_row; |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
$authformnop_row = &Apache::loncommon::start_data_table_row(); |
$authformnop_row = &Apache::loncommon::start_data_table_row(); |
} |
} |
Line 1816 END
|
Line 1816 END
|
$r->print(&mt('Revoking [_1] in [_2]: [_3]', |
$r->print(&mt('Revoking [_1] in [_2]: [_3]', |
$role,$scope,'<b>'.$result.'</b>').'<br />'); |
$role,$scope,'<b>'.$result.'</b>').'<br />'); |
if ($role eq 'st') { |
if ($role eq 'st') { |
my $result = |
my $result = |
&Apache::lonuserutils::classlist_drop($scope, |
&Apache::lonuserutils::classlist_drop($scope, |
$env{'form.ccuname'},$env{'form.ccdomain'}, |
$env{'form.ccuname'},$env{'form.ccdomain'}, |
$now); |
$now); |
$r->print($result); |
$r->print($result); |
} |
} |
} |
} |
Line 1843 END
|
Line 1843 END
|
$r->print(&mt('Deleting [_1] in [_2]: [_3]',$role,$scope, |
$r->print(&mt('Deleting [_1] in [_2]: [_3]',$role,$scope, |
'<b>'.$result.'</b>').'<br />'); |
'<b>'.$result.'</b>').'<br />'); |
if ($role eq 'st') { |
if ($role eq 'st') { |
my $result = |
my $result = |
&Apache::lonuserutils::classlist_drop($scope, |
&Apache::lonuserutils::classlist_drop($scope, |
$env{'form.ccuname'},$env{'form.ccdomain'}, |
$env{'form.ccuname'},$env{'form.ccdomain'}, |
$now); |
$now); |
$r->print($result); |
$r->print($result); |
} |
} |
} |
} |
Line 2393 sub handler {
|
Line 2393 sub handler {
|
$context = 'domain'; |
$context = 'domain'; |
} |
} |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
['action','state']); |
['action','state','callingform','roletype','showrole','bulkaction']); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::add_breadcrumb |
if ($env{'form.action'} ne 'dateselect') { |
({href=>"/adm/createuser", |
&Apache::lonhtmlcommon::add_breadcrumb |
text=>"User Management"}); |
({href=>"/adm/createuser", |
|
text=>"User Management"}); |
|
} |
my ($permission,$allowed) = &get_permission($context); |
my ($permission,$allowed) = &get_permission($context); |
if (!$allowed) { |
if (!$allowed) { |
$env{'user.error.msg'}= |
$env{'user.error.msg'}= |
Line 2447 sub handler {
|
Line 2449 sub handler {
|
if (! exists($env{'form.state'})) { |
if (! exists($env{'form.state'})) { |
&Apache::lonuserutils::print_expire_menu($r,$context); |
&Apache::lonuserutils::print_expire_menu($r,$context); |
} elsif ($env{'form.state'} eq 'done') { |
} elsif ($env{'form.state'} eq 'done') { |
&Apache::lonuserutils::expire_user_list($r); |
&Apache::lonuserutils::expire_user_list($r,$context); |
} else { |
} else { |
&Apache::lonuserutils::print_expire_menu($r,$context); |
&Apache::lonuserutils::print_expire_menu($r,$context); |
} |
} |
Line 2512 sub handler {
|
Line 2514 sub handler {
|
&custom_role_editor($r); |
&custom_role_editor($r); |
} |
} |
} elsif ($env{'form.action'} eq 'listusers' && $permission->{'view'}) { |
} elsif ($env{'form.action'} eq 'listusers' && $permission->{'view'}) { |
my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles); |
if ($env{'form.phase'} eq 'bulkchange') { |
my $formname = 'studentform'; |
&Apache::lonhtmlcommon::add_breadcrumb |
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { |
({href=>'backPage(document.studentform)', |
($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles) = |
text=>"List Users"}); |
&Apache::lonuserutils::courses_selector($env{'request.role.domain'}, |
my $setting = $env{'form.roletype'}; |
$formname); |
my $choice = $env{'form.bulkaction'}; |
my $js = &add_script($jscript).$cb_jscript; |
$r->print(&header()); |
my $loadcode = |
$r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users", |
&Apache::lonuserutils::course_selector_loadcode($formname); |
'User_Management_List')); |
if ($loadcode ne '') { |
if ($permission->{'cusr'}) { |
$r->print(&header($js,{'onload' => $loadcode,})); |
&Apache::lonuserutils::update_user_list($r,$context,$setting,$choice); |
|
} |
|
} else { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>'/adm/createuser?action=listusers', |
|
text=>"List Users"}); |
|
my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles); |
|
my $formname = 'studentform'; |
|
if ($context eq 'domain' && $env{'form.roletype'} eq 'course') { |
|
($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles) = |
|
&Apache::lonuserutils::courses_selector($env{'request.role.domain'}, |
|
$formname); |
|
$jscript .= &verify_user_display(); |
|
my $js = &add_script($jscript).$cb_jscript; |
|
my $loadcode = |
|
&Apache::lonuserutils::course_selector_loadcode($formname); |
|
if ($loadcode ne '') { |
|
$r->print(&header($js,{'onload' => $loadcode,})); |
|
} else { |
|
$r->print(&header($js)); |
|
} |
} else { |
} else { |
$r->print(&header($js)); |
$r->print(&header(&add_script(&verify_user_display()))); |
} |
} |
} else { |
$r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users", |
$r->print(&header()); |
'User_Management_List')); |
|
&Apache::lonuserutils::print_userlist($r,undef,$permission,$context, |
|
$formname,$totcodes,$codetitles,$idlist,$idlist_titles); |
|
$r->print(&Apache::loncommon::end_page()); |
} |
} |
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>'/adm/createuser?action=listusers', |
|
text=>"List Users"}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users", |
|
'User_Management_List')); |
|
&Apache::lonuserutils::print_userlist($r,undef,$permission,$context, |
|
$formname,$totcodes,$codetitles,$idlist,$idlist_titles); |
|
$r->print(&Apache::loncommon::end_page()); |
|
} elsif ($env{'form.action'} eq 'expire' && $permission->{'cusr'}) { |
} elsif ($env{'form.action'} eq 'expire' && $permission->{'cusr'}) { |
$r->print(&header()); |
$r->print(&header()); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
Line 2547 sub handler {
|
Line 2564 sub handler {
|
if (! exists($env{'form.state'})) { |
if (! exists($env{'form.state'})) { |
&Apache::lonuserutils::print_expire_menu($r,$context); |
&Apache::lonuserutils::print_expire_menu($r,$context); |
} elsif ($env{'form.state'} eq 'done') { |
} elsif ($env{'form.state'} eq 'done') { |
&Apache::lonuserutiles::expire_user_list($r); |
&Apache::lonuserutiles::expire_user_list($r,$context); |
} else { |
} else { |
&print_expire_menu($r,$context); |
&print_expire_menu($r,$context); |
} |
} |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
|
} elsif ($env{'form.action'} eq 'dateselect') { |
|
if ($permission->{'cusr'}) { |
|
$r->print(&header(undef,undef,{'no_nav_bar' => 1}). |
|
&Apache::lonuserutils::date_section_selector($context). |
|
&Apache::loncommon::end_page()); |
|
} else { |
|
$r->print(&header(). |
|
'<span class="LC_error">'.&mt('You do not have permission to modify dates or sections for users').'</span>'. |
|
&Apache::loncommon::end_page()); |
|
} |
} else { |
} else { |
$r->print(&header()); |
$r->print(&header()); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); $r->print(&print_main_menu($permission)); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
|
$r->print(&print_main_menu($permission)); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
return OK; |
return OK; |
} |
} |
|
|
sub header { |
sub header { |
my ($jscript,$loaditems) = @_; |
my ($jscript,$loaditems,$args) = @_; |
my $start_page; |
my $start_page; |
if (ref($loaditems) eq 'HASH') { |
if (ref($loaditems) eq 'HASH') { |
$start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems,}); |
$start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems}); |
} else { |
} else { |
$start_page=&Apache::loncommon::start_page('User Management',$jscript); |
$start_page=&Apache::loncommon::start_page('User Management',$jscript,$args); |
} |
} |
return $start_page; |
return $start_page; |
} |
} |
Line 2576 sub add_script {
|
Line 2604 sub add_script {
|
return '<script type="text/javascript">'."\n".$js."\n".'</script>'; |
return '<script type="text/javascript">'."\n".$js."\n".'</script>'; |
} |
} |
|
|
|
sub verify_user_display { |
|
my $output = <<"END"; |
|
|
|
function display_update() { |
|
document.studentform.action.value = 'listusers'; |
|
document.studentform.phase.value = 'display'; |
|
document.studentform.submit(); |
|
} |
|
|
|
END |
|
return $output; |
|
|
|
} |
|
|
############################################################### |
############################################################### |
############################################################### |
############################################################### |
# Menu Phase One |
# Menu Phase One |
Line 3150 sub course_level_table {
|
Line 3192 sub course_level_table {
|
<td>'.$area.'<br />Domain: '.$domain.'</td>'."\n"; |
<td>'.$area.'<br />Domain: '.$domain.'</td>'."\n"; |
if ($role ne 'cc') { |
if ($role ne 'cc') { |
if (%sections_count) { |
if (%sections_count) { |
my $currsec = |
my $currsec = |
&Apache::lonuserutils::course_sections(\%sections_count, |
&Apache::lonuserutils::course_sections(\%sections_count, |
$protectedcourse.'_'.$role); |
$protectedcourse.'_'.$role); |
$table .= |
$table .= |
'<td><table class="LC_createuser">'. |
'<td><table class="LC_createuser">'. |
'<tr class="LC_section_row"> |
'<tr class="LC_section_row"> |
Line 3192 ENDTIMEENTRY
|
Line 3234 ENDTIMEENTRY
|
<td>'.$plrole.'</td> |
<td>'.$plrole.'</td> |
<td>'.$area.'</td>'."\n"; |
<td>'.$area.'</td>'."\n"; |
if (%sections_count) { |
if (%sections_count) { |
my $currsec = |
my $currsec = |
&Apache::lonuserutils::course_sections(\%sections_count, |
&Apache::lonuserutils::course_sections(\%sections_count, |
$customrole); |
$customrole); |
$table.= |
$table.= |