');
} elsif ($env{'form.action'} eq 'singlestudent') {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title,
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
'Course_Add_Student'));
$r->print($jscript."");
if ($crstype eq 'Community') {
@@ -932,21 +928,12 @@ sub print_user_modification_page {
my %abv_auth = &auth_abbrev();
my (%rulematch,%inst_results,$newuser,%alerts,%curr_rules,%got_rules);
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain);
- my $is_custom = &Apache::loncommon::needs_gci_custom();
- if ($is_custom) {
- if ($uhome eq 'no_host') {
- my $lc_ccuname = lc($ccuname);
- if ($lc_ccuname ne $ccuname) {
- $uhome = &Apache::lonnet::homeserver($lc_ccuname,$ccdomain);
- $ccuname = $lc_ccuname;
- }
- }
- }
if ($uhome eq 'no_host') {
+ my $usertype;
my ($rules,$ruleorder) =
&Apache::lonnet::inst_userrules($ccdomain,'username');
- my $usertype =
- &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules);
+ $usertype =
+ &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules);
my $cancreate =
&Apache::lonuserutils::can_create_user($ccdomain,$context,
$usertype);
@@ -956,26 +943,17 @@ sub print_user_modification_page {
official => 'institutional',
unofficial => 'non-institutional',
);
- if ($ccdomain eq 'gci') {
- $usertypetext{'unofficial'} = 'institutional',
- }
my $response;
if ($env{'form.origform'} eq 'crtusername') {
- if ($is_custom) {
- $response = ''.&mt('Invalid format for username for new user: [_1]',''.$ccuname.'').
- ' ';
- } else {
- $response = ''.&mt('No match was found for the username ([_1]) in LON-CAPA domain: [_2]',$ccuname,$ccdomain).' ';
- }
+ $response = ''.&mt('No match found for the username [_1] in LON-CAPA domain: [_2]',''.$ccuname.'',$ccdomain).
+ ' ';
}
$response .= '
'
.&mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.")
- .' ';
- if ($ccdomain eq 'gcitest') {
- $response .= &mt('Enter a valid e-mail address as the username for the new user.').' '.&mt('Please contact the [_1]helpdesk[_2] for assistance.'
- ,'','')
- .'
';
- }
+ .' '
+ .&mt('Please contact the [_1]helpdesk[_2] for assistance.'
+ ,'','')
+ .' ';
$env{'form.phase'} = '';
&print_username_entry_form($r,$context,$response,undef,undef,$crstype);
return;
@@ -1026,14 +1004,8 @@ sub print_user_modification_page {
if ($env{'form.popup'}) {
$args->{'no_nav_bar'} = 1;
}
- my $title = 'User Management';
- if ($context eq 'course') {
- if ($is_custom) {
- $title = 'Enrollment and Student Activity';
- }
- }
my $start_page =
- &Apache::loncommon::start_page($title,$js,$args);
+ &Apache::loncommon::start_page('User Management',$js,$args);
my %breadcrumb_text = &singleuser_breadcrumb($crstype);
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:backPage($form)",
@@ -1054,7 +1026,7 @@ sub print_user_modification_page {
if ($env{'form.action'} eq 'singlestudent') {
$helpitem = 'Course_Add_Student';
}
- my $crumbs = &Apache::lonhtmlcommon::breadcrumbs($title,
+ my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management',
$helpitem);
my $forminfo =<<"ENDFORMINFO";
@@ -1483,6 +1455,8 @@ sub display_existing_roles {
$newkey .= '_'.$newrole;
if ($start ne '' && $end ne '') {
$newvalue .= '_'.$end.'_'.$start;
+ } elsif ($end ne '') {
+ $newvalue .= '_'.$end;
}
$rolesdump{$newkey} = $newvalue;
}
@@ -2091,9 +2065,22 @@ sub personal_data_display {
if ($canmodify_status{'inststatus'}) {
$shown = &pick_inst_statuses($userenv{'inststatus'},$usertypes,$types);
} else {
- $shown .= $userenv{'inststatus'};
if ($userenv{'inststatus'} eq '') {
$hiderow = 1;
+ } else {
+ my @showitems;
+ foreach my $item ( map { &unescape($_); } split(':',$userenv{'inststatus'})) {
+ if (exists($usertypes->{$item})) {
+ push(@showitems,$usertypes->{$item});
+ } else {
+ push(@showitems,$item);
+ }
+ }
+ if (@showitems) {
+ $shown = join(', ',@showitems);
+ } else {
+ $hiderow = 1;
+ }
}
}
if (!$hiderow) {
@@ -2189,8 +2176,7 @@ sub get_inststatuses {
# ================================================================= Phase Three
sub update_user_data {
- my ($r,$context,$crstype) = @_;
- my $is_custom = &Apache::loncommon::needs_gci_custom();
+ my ($r,$context,$crstype) = @_;
my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'},
$env{'form.ccdomain'});
# Error messages
@@ -2243,13 +2229,7 @@ sub update_user_data {
if ($env{'form.action'} eq 'singlestudent') {
$helpitem = 'Course_Add_Student';
}
- my $title = 'User Management';
- if ($context eq 'course') {
- if ($is_custom) {
- $title = 'Enrollment and Student Activity';
- }
- }
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title,
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
$helpitem));
$r->print(&update_result_form($uhome));
# Check Inputs
@@ -2318,10 +2298,14 @@ sub update_user_data {
$r->print('
'.&mt('User [_1] in domain [_2]',
$env{'form.ccuname'}, $env{'form.ccdomain'}).'
');
my (%alerts,%rulematch,%inst_results,%curr_rules);
+ my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id');
my @usertools = ('aboutme','blog','portfolio');
my @requestcourses = ('official','unofficial','community');
my ($othertitle,$usertypes,$types) =
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'});
+ my %canmodify_status =
+ &Apache::lonuserutils::can_modify_userinfo($context,$env{'form.ccdomain'},
+ ['inststatus']);
if ($env{'form.makeuser'}) {
$r->print('
\n");
+ }
+ }
+ }
+ $r->print(&Apache::loncommon::end_data_table_row());
+ }
+ $r->print(&Apache::loncommon::end_data_table().' ');
+ return;
+}
+
sub tool_changes {
my ($context,$usertools,$oldaccess,$oldaccesstext,$userenv,$changeHash,
$changed,$newaccess,$newaccesstext) = @_;
@@ -3677,13 +3635,6 @@ sub custom_role_editor {
$context = 'domain';
$crstype = $env{'form.templatecrstype'};
}
- my $is_custom = &Apache::loncommon::needs_gci_custom();
- my $title = 'User Management';
- if ($context eq 'course') {
- if ($is_custom) {
- $title = 'Enrollment and Student Activity';
- }
- }
# ------------------------------------------------------- What can be assigned?
my %full=();
my %courselevel=();
@@ -3799,7 +3750,7 @@ sub custom_role_editor {
{href=>"javascript:backPage(document.form1,'','')",
text=>"Edit custom role",
faq=>282,bug=>'Instructor Interface',});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title,
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
'Course_Editing_Custom_Roles'));
$r->print($body_top);
@@ -3952,13 +3903,7 @@ sub set_custom_role {
.$jsback."\n"
.'// ]]>'."\n"
.''."\n";
- my $title = 'User Management';
- my $is_custom = &Apache::loncommon::needs_gci_custom();
- if ($context eq 'course') {
- if ($is_custom) {
- $title = 'Enrollment and Student Activity';
- }
- }
+
$r->print(&Apache::loncommon::start_page('Save Custom Role'),$jscript);
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"javascript:backPage(document.customresult,'pickrole','')",
@@ -3970,7 +3915,7 @@ sub set_custom_role {
{href=>"javascript:backPage(document.customresult,'set_custom_roles','')",
text=>"Result",
faq=>282,bug=>'Instructor Interface',});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title,
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
'Course_Editing_Custom_Roles'));
my ($rdummy,$roledef)=
@@ -4048,13 +3993,6 @@ sub handler {
} else {
$context = 'domain';
}
- my $title = 'User Management';
- my $is_custom = &Apache::loncommon::needs_gci_custom();
- if ($context eq 'course') {
- if ($is_custom) {
- $title = 'Enrollment and Student Activity';
- }
- }
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
['action','state','callingform','roletype','showrole','bulkaction','popup','phase',
'username','domain','srchterm','srchdomain','srchin','srchby','srchtype']);
@@ -4062,7 +4000,7 @@ sub handler {
if ($env{'form.action'} ne 'dateselect') {
&Apache::lonhtmlcommon::add_breadcrumb
({href=>"/adm/createuser",
- text=>$title,
+ text=>"User Management",
help=>'Course_Create_Class_List,Course_Change_Privileges,Course_View_Class_List,Course_Editing_Custom_Roles,Course_Add_Student,Course_Drop_Student,Course_Automated_Enrollment,Course_Self_Enrollment,Course_Manage_Group'});
}
#SD Following files not added to help, because the corresponding .tex-files seem to
@@ -4082,7 +4020,7 @@ sub handler {
# Main switch on form.action and form.state, as appropriate
if (! exists($env{'form.action'})) {
$r->print(&header());
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
$r->print(&print_main_menu($permission,$context,$crstype));
$r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'upload' && $permission->{'cusr'}) {
@@ -4098,12 +4036,8 @@ sub handler {
if (! exists($env{'form.state'})) {
&Apache::lonuserutils::print_first_users_upload_form($r,$context);
} elsif ($env{'form.state'} eq 'got_file') {
- my $formname;
- if ($env{'form.caller'} eq 'requestcrs') {
- $formname = 'studentform';
- }
&Apache::lonuserutils::print_upload_manager_form($r,$context,
- $permission,$crstype,$formname);
+ $permission,$crstype);
} elsif ($env{'form.state'} eq 'enrolling') {
if ($env{'form.datatoken'}) {
&Apache::lonuserutils::upfile_drop_add($r,$context,$permission);
@@ -4126,7 +4060,7 @@ sub handler {
if ($env{'form.phase'} eq 'createnewuser') {
my $response;
if ($env{'form.srchterm'} !~ /^$match_username$/) {
- my $response = '
'.&mt('You must specify a valid username. Only the following are allowed: letters numbers - . @').'
';
+ my $response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @');
$env{'form.phase'} = '';
&print_username_entry_form($r,$context,$response,$srch,undef,$crstype);
} else {
@@ -4201,7 +4135,7 @@ sub handler {
$r->print(&Apache::lonhtmlcommon::breadcrumbs("Update Users",
'Course_View_Class_List'));
if ($permission->{'cusr'}) {
- &Apache::lonuserutils::update_user_list($r,$context,$setting,$choice);
+ &Apache::lonuserutils::update_user_list($r,$context,$setting,$choice,$crstype);
$r->print(&Apache::loncommon::end_page());
} else {
$r->print(&mt('You are not authorized to make bulk changes to user roles'));
@@ -4342,7 +4276,7 @@ sub handler {
$r->print(&Apache::loncommon::end_page());
} else {
$r->print(&header());
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title));
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
$r->print(&print_main_menu($permission,$context,$crstype));
$r->print(&Apache::loncommon::end_page());
}
@@ -4388,10 +4322,6 @@ END
# Menu Phase One
sub print_main_menu {
my ($permission,$context,$crstype) = @_;
- my $is_custom = &Apache::loncommon::needs_gci_custom();
- if (($context eq 'course') && ($is_custom)) {
- return &print_gci_main_menu($permission,$context,$crstype)
- }
my $linkcontext = $context;
my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));
if (($context eq 'course') && ($crstype eq 'Community')) {
@@ -4551,7 +4481,7 @@ sub print_main_menu {
},
{
linktext => $linktext{$crstype}{'groups'},
- icon => 'conf.png',
+ icon => 'grps.png',
#help => 'Course_Manage_Group',
url => '/adm/coursegroups?refpage=cusr',
permission => $permission->{'grp_manage'},
@@ -4613,82 +4543,6 @@ return Apache::lonhtmlcommon::generate_m
# });
}
-sub print_gci_main_menu {
- my ($permission,$context,$crstype) = @_;
- my $stuterm = lc(&Apache::lonnet::plaintext('st',$crstype));
- my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity();
- my %links = (
- course => {
- single => 'Add/Modify a Student',
- drop => 'Drop Students',
- upload => 'Upload a File of Course Users',
- singleuser => 'Add/Modify a Course User',
- listusers => 'Concept Test Roster and Student Activity',
- },
- );
- my %linktitles = (
- course => {
- singleuser => 'Add a user with a certain role to this course.',
- listusers => 'Show and manage users in this course.',
- single => 'Add a user with the role of student to this course',
- drop => 'Remove a student from this course.',
- upload => 'Upload a CSV or a text file containing users.',
- },
- );
- my @menu = ( {categorytitle => 'Manage Users',
- items =>
- [
- {
- linktext => $links{$context}{'single'},
- #help => 'Course_Add_Student',
- icon => 'list-add.png',
- url => '/adm/createuser?action=singlestudent',
- permission => $permission->{'cusr'},
- linktitle => $linktitles{$context}{'single'},
-
- },
- {
- linktext => $links{$context}{'drop'},
- icon => 'edit-undo.png',
- #help => 'Course_Drop_Student',
- url => '/adm/createuser?action=drop',
- permission => $permission->{'cusr'},
- linktitle => $linktitles{$context}{'drop'},
- },
- {
- linktext => $links{$context}{'upload'},
- icon => 'sctr.png',
- #help => 'Course_Create_Class_List',
- url => '/adm/createuser?action=upload',
- permission => $permission->{'cusr'},
- linktitle => $linktitles{$context}{'upload'},
- },
- {
- linktext => $links{$context}{'listusers'},
- icon => 'edit-find.png',
- #help => 'Course_View_Class_List',
- url => '/adm/createuser?action=listusers',
- permission => ($permission->{'view'} || $permission->{'cusr'}),
- linktitle => $linktitles{$context}{'listusers'},
- },
- ]},
- {categorytitle => 'Administration',
- items => [ ]},
- );
-
- push(@{ $menu[1]->{items} }, #Category: Administration
- {
- linktext => 'Change Log',
- icon => 'document-properties.png',
- #help => 'Course_User_Logs',
- url => '/adm/createuser?action=changelogs',
- permission => $permission->{'cusr'},
- linktitle => 'View change log.',
- },
- );
- return Apache::lonhtmlcommon::generate_menu(@menu);
-}
-
sub restore_prev_selections {
my %saveable_parameters = ('srchby' => 'scalar',
'srchin' => 'scalar',
@@ -5653,7 +5507,16 @@ sub role_display_filter {
# Update Display button
$output .= '
'
.''
- .'
';
+ .'';
+
+ # Server version info
+ $output .= '
'
+ .&mt('Only changes made from servers running LON-CAPA [_1] or later are displayed.'
+ ,'2.6.99.0');
+ if ($version) {
+ $output .= ' '.&mt('This LON-CAPA server is version [_1]',$version);
+ }
+ $output .= '