--- loncom/interface/loncreateuser.pm 2010/08/09 23:39:43 1.329.2.3
+++ loncom/interface/loncreateuser.pm 2010/10/11 15:38:17 1.329.2.5
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.329.2.3 2010/08/09 23:39:43 raeburn Exp $
+# $Id: loncreateuser.pm,v 1.329.2.5 2010/10/11 15:38:17 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -469,9 +469,10 @@ sub courserequest_display {
# =================================================================== Phase one
sub print_username_entry_form {
- my ($r,$context,$response,$srch,$forcenewuser,$crstype) = @_;
+ my ($r,$context,$response,$srch,$forcenewuser,$crstype,$brcrum) = @_;
my $defdom=$env{'request.role.domain'};
my $formtoset = 'crtuser';
+ my $is_custom = &Apache::loncommon::needs_gci_custom();
if (exists($env{'form.startrolename'})) {
$formtoset = 'docustom';
$env{'form.rolename'} = $env{'form.startrolename'};
@@ -493,37 +494,42 @@ sub print_username_entry_form {
&& (&Apache::lonnet::allowed('mcr','/'))) {
$jscript .= &customrole_javascript();
}
- my %loaditems = (
- 'onload' => "javascript:setFormElements(document.$formtoset)",
- );
- my %breadcrumb_text = &singleuser_breadcrumb($crstype);
my $title = 'User Management';
if ($context eq 'course') {
- if (&Apache::loncommon::needs_gci_custom()) {
+ if ($is_custom) {
$title = 'Enrollment and Student Activity';
}
}
- my $start_page =
- &Apache::loncommon::start_page($title,
- $jscript,{'add_entries' => \%loaditems,});
- if ($env{'form.action'} eq 'custom') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.crtuser)",
- text=>"Pick custom role",});
- } else {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.crtuser)",
- text=>$breadcrumb_text{'search'},
- faq=>282,bug=>'Instructor Interface',});
- }
my $helpitem = 'Course_Change_Privileges';
if ($env{'form.action'} eq 'custom') {
$helpitem = 'Course_Editing_Custom_Roles';
} elsif ($env{'form.action'} eq 'singlestudent') {
$helpitem = 'Course_Add_Student';
}
- my $crumbs = &Apache::lonhtmlcommon::breadcrumbs($title,
- $helpitem);
+ my %breadcrumb_text = &singleuser_breadcrumb($crstype);
+ if ($env{'form.action'} eq 'custom') {
+ push(@{$brcrum},
+ {href=>"javascript:backPage(document.crtuser)",
+ text=>"Pick custom role",
+ help => $helpitem,}
+ );
+ } else {
+ push (@{$brcrum},
+ {href => "javascript:backPage(document.crtuser)",
+ text => $breadcrumb_text{'search'},
+ help => $helpitem,
+ faq => 282,
+ bug => 'Instructor Interface',}
+ );
+ }
+ my %loaditems = (
+ 'onload' => "javascript:setFormElements(document.$formtoset)",
+ );
+ my $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => 'User Management',
+ add_entries => \%loaditems,};
+ $r->print(&Apache::loncommon::start_page($title,$jscript,$args));
+
my %lt=&Apache::lonlocal::texthash(
'srst' => 'Search for a user and enroll as a student',
'srme' => 'Search for a user and enroll as a member',
@@ -534,7 +540,6 @@ sub print_username_entry_form {
'nr' => "role name",
'cre' => "Next",
);
- $r->print($start_page."\n".$crumbs);
if ($env{'form.action'} eq 'custom') {
if (&Apache::lonnet::allowed('mcr','/')) {
my $newroletext = &mt('Define new custom role:');
@@ -587,7 +592,6 @@ sub print_username_entry_form {
}
$r->print(&entry_form($defdom,$srch,$forcenewuser,$context,$response,$crstype));
}
- $r->print(&Apache::loncommon::end_page());
}
sub customrole_javascript {
@@ -666,7 +670,7 @@ $userpicker
ENDBLOCK
if ($env{'form.phase'} eq '') {
my $defdom=$env{'request.role.domain'};
- my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain');
+ my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain','',1);
my %lt=&Apache::lonlocal::texthash(
'enro' => 'Enroll one student',
'enrm' => 'Enroll one member',
@@ -715,7 +719,7 @@ $showresponse
$lt{'usr'}:
-
+
$lt{'dom'}:
$domform
$sellink
@@ -757,9 +761,10 @@ END
# =================================================================== Phase two
sub print_user_selection_page {
- my ($r,$response,$srch,$srch_results,$srcharray,$context,$opener_elements,$crstype) = @_;
+ my ($r,$response,$srch,$srch_results,$srcharray,$context,$opener_elements,$crstype,$brcrum) = @_;
my @fields = ('username','domain','lastname','firstname','permanentemail');
my $sortby = $env{'form.sortby'};
+ my $is_custom = &Apache::loncommon::needs_gci_custom();
if (!grep(/^\Q$sortby\E$/,@fields)) {
$sortby = 'lastname';
@@ -800,29 +805,34 @@ ENDSCRIPT
} else {
my $title = 'User Management';
if ($context eq 'course') {
- if (&Apache::loncommon::needs_gci_custom()) {
+ if ($is_custom) {
$title = 'Enrollment and Student Activity';
}
}
- $r->print(&Apache::loncommon::start_page($title,$jscript));
-
my %breadcrumb_text = &singleuser_breadcrumb($crstype);
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.usersrchform,'','')",
- text=>$breadcrumb_text{'search'},
- faq=>282,bug=>'Instructor Interface',},
- {href=>"javascript:backPage(document.usersrchform,'get_user_info','select')",
- text=>$breadcrumb_text{'userpicked'},
- faq=>282,bug=>'Instructor Interface',});
+ my $helpitem;
+ if ($env{'form.action'} eq 'singleuser') {
+ $helpitem = 'Course_Change_Privileges';
+ } elsif ($env{'form.action'} eq 'singlestudent') {
+ $helpitem = 'Course_Add_Student';
+ }
+ push (@{$brcrum},
+ {href => "javascript:backPage(document.usersrchform,'','')",
+ text => $breadcrumb_text{'search'},
+ faq => 282,
+ bug => 'Instructor Interface',},
+ {href => "javascript:backPage(document.usersrchform,'get_user_info','select')",
+ text => $breadcrumb_text{'userpicked'},
+ faq => 282,
+ bug => 'Instructor Interface',
+ help => $helpitem}
+ );
+ $r->print(&Apache::loncommon::start_page($title,$jscript,{bread_crumbs => $brcrum}));
if ($env{'form.action'} eq 'singleuser') {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title,
- 'Course_Change_Privileges'));
$r->print("$lt{'usrch'} ");
$r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context,undef,$crstype));
$r->print('
'.$lt{'usel'}.'
');
} elsif ($env{'form.action'} eq 'singlestudent') {
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title,
- 'Course_Add_Student'));
$r->print($jscript."");
if ($crstype eq 'Community') {
$r->print($lt{'memsrch'});
@@ -904,7 +914,7 @@ ENDSCRIPT
}
sub print_user_query_page {
- my ($r,$caller) = @_;
+ my ($r,$caller,$brcrum) = @_;
# FIXME - this is for a network-wide name search (similar to catalog search)
# To use frames with similar behavior to catalog/portfolio search.
# To be implemented.
@@ -912,11 +922,11 @@ sub print_user_query_page {
}
sub print_user_modification_page {
- my ($r,$ccuname,$ccdomain,$srch,$response,$context,$permission,$crstype) = @_;
+ my ($r,$ccuname,$ccdomain,$srch,$response,$context,$permission,$crstype,$brcrum) = @_;
if (($ccuname eq '') || ($ccdomain eq '')) {
my $usermsg = &mt('No username and/or domain provided.');
$env{'form.phase'} = '';
- &print_username_entry_form($r,$context,$usermsg,'','',$crstype);
+ &print_username_entry_form($r,$context,$usermsg,'','',$crstype,$brcrum);
return;
}
my ($form,$formname);
@@ -930,12 +940,21 @@ 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');
- $usertype =
- &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules);
+ my $usertype =
+ &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules);
my $cancreate =
&Apache::lonuserutils::can_create_user($ccdomain,$context,
$usertype);
@@ -945,19 +964,28 @@ 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') {
- $response = ''.&mt('No match was found for the username ([_1]) in LON-CAPA domain: [_2]',$ccuname,$ccdomain).
- ' ';
+ 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("You are not authorized to create new $usertypetext{$usertype} users in this domain.")
- .' '
- .&mt('Please contact the [_1]helpdesk[_2] for assistance.'
- ,'','')
- .'
';
+ .' ';
+ 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.'
+ ,'','')
+ .' ';
+ }
$env{'form.phase'} = '';
- &print_username_entry_form($r,$context,$response,undef,undef,$crstype);
+ &print_username_entry_form($r,$context,$response,undef,undef,$crstype,$brcrum);
return;
}
$newuser = 1;
@@ -981,7 +1009,7 @@ sub print_user_modification_page {
'username');
}
$env{'form.phase'} = '';
- &print_username_entry_form($r,$context,$userchkmsg,undef,undef,$crstype);
+ &print_username_entry_form($r,$context,$userchkmsg,undef,undef,$crstype,$brcrum);
return;
}
}
@@ -1002,40 +1030,43 @@ sub print_user_modification_page {
my $js = &validation_javascript($context,$ccdomain,$pjump_def,
$groupslist,$newuser,$formname,\%loaditem);
- my $args = {'add_entries' => \%loaditem};
- if ($env{'form.popup'}) {
- $args->{'no_nav_bar'} = 1;
- }
my $title = 'User Management';
if ($context eq 'course') {
- if (&Apache::loncommon::needs_gci_custom()) {
+ if ($is_custom) {
$title = 'Enrollment and Student Activity';
}
}
- my $start_page =
- &Apache::loncommon::start_page($title,$js,$args);
my %breadcrumb_text = &singleuser_breadcrumb($crstype);
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage($form)",
- text=>$breadcrumb_text{'search'},
- faq=>282,bug=>'Instructor Interface',});
-
- if ($env{'form.phase'} eq 'userpicked') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage($form,'get_user_info','select')",
- text=>$breadcrumb_text{'userpicked'},
- faq=>282,bug=>'Instructor Interface',});
- }
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage($form,'$env{'form.phase'}','modify')",
- text=>$breadcrumb_text{'modify'},
- faq=>282,bug=>'Instructor Interface',});
my $helpitem = 'Course_Change_Privileges';
if ($env{'form.action'} eq 'singlestudent') {
$helpitem = 'Course_Add_Student';
}
- my $crumbs = &Apache::lonhtmlcommon::breadcrumbs($title,
- $helpitem);
+ push (@{$brcrum},
+ {href => "javascript:backPage($form)",
+ text => $breadcrumb_text{'search'},
+ faq => 282,
+ bug => 'Instructor Interface',});
+ if ($env{'form.phase'} eq 'userpicked') {
+ push(@{$brcrum},
+ {href => "javascript:backPage($form,'get_user_info','select')",
+ text => $breadcrumb_text{'userpicked'},
+ faq => 282,
+ bug => 'Instructor Interface',});
+ }
+ push(@{$brcrum},
+ {href => "javascript:backPage($form,'$env{'form.phase'}','modify')",
+ text => $breadcrumb_text{'modify'},
+ faq => 282,
+ bug => 'Instructor Interface',
+ help => $helpitem});
+ my $args = {'add_entries' => \%loaditem,
+ 'bread_crumbs' => $brcrum,
+ 'bread_crumbs_component' => 'User Management'};
+ if ($env{'form.popup'}) {
+ $args->{'no_nav_bar'} = 1;
+ }
+ my $start_page =
+ &Apache::loncommon::start_page($title,$js,$args);
my $forminfo =<<"ENDFORMINFO";
".&Apache::loncommon::end_page());
+ $r->print('');
return;
}
@@ -2169,7 +2197,8 @@ sub get_inststatuses {
# ================================================================= Phase Three
sub update_user_data {
- my ($r,$context,$crstype) = @_;
+ my ($r,$context,$crstype,$brcrum) = @_;
+ my $is_custom = &Apache::loncommon::needs_gci_custom();
my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'},
$env{'form.ccdomain'});
# Error messages
@@ -2194,42 +2223,33 @@ sub update_user_data {
'// ]]>'."\n".
''."\n";
my %breadcrumb_text = &singleuser_breadcrumb($crstype);
- my $args;
- if ($env{'form.popup'}) {
- $args->{'no_nav_bar'} = 1;
- } else {
- $args = undef;
- }
- $r->print(&Apache::loncommon::start_page($title,$jscript,$args));
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.userupdate)",
- text=>$breadcrumb_text{'search'},
- faq=>282,bug=>'Instructor Interface',});
- if ($env{'form.prevphase'} eq 'userpicked') {
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.userupdate,'get_user_info','select')",
- text=>$breadcrumb_text{'userpicked'},
- faq=>282,bug=>'Instructor Interface',});
- }
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.userupdate,'$env{'form.prevphase'}','modify')",
- text=>$breadcrumb_text{'modify'},
- faq=>282,bug=>'Instructor Interface',},
- {href=>"/adm/createuser",
- text=>"Result",
- faq=>282,bug=>'Instructor Interface',});
my $helpitem = 'Course_Change_Privileges';
if ($env{'form.action'} eq 'singlestudent') {
$helpitem = 'Course_Add_Student';
}
- my $title = 'User Management';
+ my $bread_crumbs_component = 'User Management';
if ($context eq 'course') {
- if (&Apache::loncommon::needs_gci_custom()) {
- $title = 'Enrollment and Student Activity';
+ if ($is_custom) {
+ $bread_crumbs_component = 'Enrollment and Student Activity';
}
}
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title,
- $helpitem));
+ push(@{$brcrum},
+ {href => "javascript:backPage(document.userupdate,'$env{'form.prevphase'}','modify')",
+ text => $breadcrumb_text{'modify'},
+ faq => 282,
+ bug => 'Instructor Interface',},
+ {href => "/adm/createuser",
+ text => "Result",
+ faq => 282,
+ bug => 'Instructor Interface',
+ help => $helpitem});
+ my $args = {bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ if ($env{'form.popup'}) {
+ $args->{'no_nav_bar'} = 1;
+ }
+ $r->print(&Apache::loncommon::start_page($title,$jscript,$args));
+
$r->print(&update_result_form($uhome));
# Check Inputs
if (! $env{'form.ccuname'} ) {
@@ -2719,7 +2739,8 @@ sub update_user_data {
$changeHash{'tools.'.$key};
} else {
$newenvhash{'environment.availabletools.'.$key} =
- &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'}, $key,'reload','tools');
+ &Apache::lonnet::usertools_access($env{'user.name'},$env{'user.domain'},
+ $key,'reload','tools');
}
}
}
@@ -3023,7 +3044,6 @@ END
.&mt('Create/Modify Another User').'');
}
}
- $r->print(&Apache::loncommon::end_page());
}
sub tool_changes {
@@ -3633,7 +3653,7 @@ sub build_roles {
# ========================================================== Custom Role Editor
sub custom_role_editor {
- my ($r) = @_;
+ my ($r,$brcrum) = @_;
my $action = $env{'form.customroleaction'};
my $rolename;
if ($action eq 'new') {
@@ -3642,11 +3662,6 @@ sub custom_role_editor {
$rolename=$env{'form.rolename'};
}
- $rolename=~s/[^A-Za-z0-9]//gs;
- if (!$rolename || $env{'form.phase'} eq 'pickrole') {
- &print_username_entry_form($r);
- return;
- }
my ($crstype,$context);
if ($env{'request.course.id'}) {
$crstype = &Apache::loncommon::course_type();
@@ -3655,9 +3670,16 @@ sub custom_role_editor {
$context = 'domain';
$crstype = $env{'form.templatecrstype'};
}
+
+ $rolename=~s/[^A-Za-z0-9]//gs;
+ if (!$rolename || $env{'form.phase'} eq 'pickrole') {
+ &print_username_entry_form($r,undef,undef,undef,undef,$crstype,$brcrum);
+ return;
+ }
+ my $is_custom = &Apache::loncommon::needs_gci_custom();
my $title = 'User Management';
if ($context eq 'course') {
- if (&Apache::loncommon::needs_gci_custom()) {
+ if ($is_custom) {
$title = 'Enrollment and Student Activity';
}
}
@@ -3768,25 +3790,28 @@ sub custom_role_editor {
$head_script .= "\n".$jsback."\n"
.'// ]]>'."\n"
.''."\n";
- $r->print(&Apache::loncommon::start_page('Custom Role Editor',$head_script));
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.form1,'pickrole','')",
- text=>"Pick custom role",
- faq=>282,bug=>'Instructor Interface',},
- {href=>"javascript:backPage(document.form1,'','')",
- text=>"Edit custom role",
- faq=>282,bug=>'Instructor Interface',});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title,
- 'Course_Editing_Custom_Roles'));
-
- $r->print($body_top);
+ push (@{$brcrum},
+ {href => "javascript:backPage(document.form1,'pickrole','')",
+ text => "Pick custom role",
+ faq => 282,bug=>'Instructor Interface',},
+ {href => "javascript:backPage(document.form1,'','')",
+ text => "Edit custom role",
+ faq => 282,
+ bug => 'Instructor Interface',
+ help => 'Course_Editing_Custom_Roles'}
+ );
+ my $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => 'User Management'};
+
+ $r->print(&Apache::loncommon::start_page('Custom Role Editor',
+ $head_script,$args).
+ $body_top);
my %lt=&Apache::lonlocal::texthash(
'prv' => "Privilege",
'crl' => "Course Level",
'dml' => "Domain Level",
'ssl' => "System Level");
-
$r->print('
'
.''.
- &Apache::loncommon::end_page());
+ '');
}
# --------------------------------------------------------
sub make_script_template {
@@ -3916,11 +3940,11 @@ sub make_button_code {
}
# ---------------------------------------------------------- Call to definerole
sub set_custom_role {
- my ($r,$context) = @_;
+ my ($r,$context,$brcrum) = @_;
my $rolename=$env{'form.rolename'};
$rolename=~s/[^A-Za-z0-9]//gs;
if (!$rolename) {
- &custom_role_editor($r);
+ &custom_role_editor($r,$brcrum);
return;
}
my ($jsback,$elements) = &crumb_utilities();
@@ -3929,25 +3953,32 @@ sub set_custom_role {
.$jsback."\n"
.'// ]]>'."\n"
.''."\n";
- my $title = 'User Management';
+ my $bread_crumbs_component = 'User Management';
+ my $is_custom = &Apache::loncommon::needs_gci_custom();
if ($context eq 'course') {
- if (&Apache::loncommon::needs_gci_custom()) {
- $title = 'Enrollment and Student Activity';
+ if ($is_custom) {
+ $bread_crumbs_component = 'Enrollment and Student Activity';
}
}
- $r->print(&Apache::loncommon::start_page('Save Custom Role'),$jscript);
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>"javascript:backPage(document.customresult,'pickrole','')",
- text=>"Pick custom role",
- faq=>282,bug=>'Instructor Interface',},
- {href=>"javascript:backPage(document.customresult,'selected_custom_edit','')",
- text=>"Edit custom role",
- faq=>282,bug=>'Instructor Interface',},
- {href=>"javascript:backPage(document.customresult,'set_custom_roles','')",
- text=>"Result",
- faq=>282,bug=>'Instructor Interface',});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title,
- 'Course_Editing_Custom_Roles'));
+
+ push(@{$brcrum},
+ {href => "javascript:backPage(document.customresult,'pickrole','')",
+ text => "Pick custom role",
+ faq => 282,
+ bug => 'Instructor Interface',},
+ {href => "javascript:backPage(document.customresult,'selected_custom_edit','')",
+ text => "Edit custom role",
+ faq => 282,
+ bug => 'Instructor Interface',},
+ {href => "javascript:backPage(document.customresult,'set_custom_roles','')",
+ text => "Result",
+ faq => 282,
+ bug => 'Instructor Interface',
+ help => 'Course_Editing_Custom_Roles'},
+ );
+ my $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component };
+ $r->print(&Apache::loncommon::start_page('Save Custom Role',$jscript,$args));
my ($rdummy,$roledef)=
&Apache::lonnet::get('roles',["rolesdef_$rolename"]);
@@ -4004,7 +4035,6 @@ sub set_custom_role {
}
$r->print('
'."\n");
$r->print(&Apache::loncoursequeueadmin::update_request_queue($context,
$cdom,$cnum,$coursedesc));
}
- $r->print(&Apache::loncommon::end_page());
} elsif ($env{'form.action'} eq 'changelogs') {
- $r->print(&header());
- &Apache::lonhtmlcommon::add_breadcrumb
- ({href=>'/adm/createuser?action=changelogs',
- text=>"User Management Logs"});
- $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Changes',
- 'Course_User_Logs'));
- &print_userchangelogs_display($r,$context,$permission);
- $r->print(&Apache::loncommon::end_page());
+ push (@{$brcrum},
+ {href => '/adm/createuser?action=changelogs',
+ text => 'User Management Logs',
+ help => 'Course_User_Logs'});
+ $bread_crumbs_component = 'User Changes';
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
+ &print_userchangelogs_display($r,$context,$permission);
} else {
- $r->print(&header());
- $r->print(&Apache::lonhtmlcommon::breadcrumbs($title));
+ $args = { bread_crumbs => $brcrum,
+ bread_crumbs_component => $bread_crumbs_component};
+ $r->print(&header(undef,$args));
$r->print(&print_main_menu($permission,$context,$crstype));
- $r->print(&Apache::loncommon::end_page());
}
+ $r->print(&Apache::loncommon::end_page());
return OK;
}
sub header {
- my ($jscript,$loaditems,$args) = @_;
+ my ($jscript,$args) = @_;
+ my $title = 'User Management';
+ my $is_custom = &Apache::loncommon::needs_gci_custom();
+ if ($env{'request.course.id'}) {
+ if ($is_custom) {
+ $title = 'Enrollment and Student Activity';
+ }
+ }
my $start_page;
- if (ref($loaditems) eq 'HASH') {
- $start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems});
+ if (ref($args) eq 'HASH') {
+ $start_page=&Apache::loncommon::start_page($title,$jscript,$args);
} else {
- $start_page=&Apache::loncommon::start_page('User Management',$jscript,$args);
+ $start_page=&Apache::loncommon::start_page($title,$jscript);
}
return $start_page;
}
@@ -4359,7 +4413,8 @@ END
# Menu Phase One
sub print_main_menu {
my ($permission,$context,$crstype) = @_;
- if (($context eq 'course') && (&Apache::loncommon::needs_gci_custom())) {
+ 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;
@@ -5673,7 +5728,7 @@ sub user_search_result {
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'instd')) {
if (($srch->{'srchdomain'} eq '') ||
! (&Apache::lonnet::domain($srch->{'srchdomain'}))) {
- $response = &mt('You must specify a valid domain when searching in a domain or institutional directory.')
+ $response = '
'.&mt('You must specify a valid domain when searching in a domain or institutional directory.').'
';
}
}
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'crs') ||
@@ -5686,7 +5741,7 @@ sub user_search_result {
}
}
if ($unamecheck !~ /^$match_username$/) {
- $response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @');
+ $response = '
'.&mt('You must specify a valid username. Only the following are allowed: letters numbers - . @').'
';
}
}
}
@@ -5861,7 +5916,8 @@ sub user_search_result {
($currstate,$response,$forcenewuser) =
&build_search_response($context,$srch,%srch_results);
} else {
- my $showdom = &display_domain_info($srch->{'srchdomain'}); $response = ''.
+ my $showdom = &display_domain_info($srch->{'srchdomain'});
+ $response = ''.
&mt('Institutional directory search is not available in domain: [_1]',$showdom).
' '.
&mt('You may want to search in the LON-CAPA domain instead of the institutional directory.').