version 1.171, 2007/08/14 16:53:15
|
version 1.176, 2007/08/25 17:46:24
|
Line 216 sub print_username_entry_form {
|
Line 216 sub print_username_entry_form {
|
$jscript,{'add_entries' => \%loaditems,}); |
$jscript,{'add_entries' => \%loaditems,}); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>"javascript:backPage(document.crtuser)", |
({href=>"javascript:backPage(document.crtuser)", |
text=>"User modify/custom role", |
text=>"User modify/custom role edit", |
faq=>282,bug=>'Instructor Interface',}); |
faq=>282,bug=>'Instructor Interface',}); |
|
|
my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management'); |
my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management'); |
Line 329 $jsback
|
Line 329 $jsback
|
ENDSCRIPT |
ENDSCRIPT |
|
|
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'srch' => "User Search to add/modify roles of", |
'srch' => "User Search to add/modify roles", |
'username' => "username", |
'username' => "username", |
'domain' => "domain", |
'domain' => "domain", |
'lastname' => "last name", |
'lastname' => "last name", |
Line 347 ENDSCRIPT
|
Line 347 ENDSCRIPT
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
$r->print("<b>$lt{'srch'}</b><br />"); |
$r->print("<b>$lt{'srch'}</b><br />"); |
$r->print(&entry_form($srch->{'srchdomain'},$srch)); |
$r->print(&entry_form($srch->{'srchdomain'},$srch)); |
$r->print('<h3>'.&mt('Select a user to add/modify roles of').'</h3>'); |
$r->print('<h3>'.&mt('Select a user to add/modify roles').'</h3>'); |
$r->print('<form name="usersrchform" method="post">'. |
$r->print('<form name="usersrchform" method="post">'. |
&Apache::loncommon::start_data_table()."\n". |
&Apache::loncommon::start_data_table()."\n". |
&Apache::loncommon::start_data_table_header_row()."\n". |
&Apache::loncommon::start_data_table_header_row()."\n". |
Line 783 ENDCHANGEUSER
|
Line 783 ENDCHANGEUSER
|
'<th>'.$lt{'fn'}.'</th><th>'.$lt{'mn'}.'</th><th>'.$lt{'ln'}.'</th><th>'.$lt{'gen'}.'</th><th>'.$lt{'email'}.'</th>'. |
'<th>'.$lt{'fn'}.'</th><th>'.$lt{'mn'}.'</th><th>'.$lt{'ln'}.'</th><th>'.$lt{'gen'}.'</th><th>'.$lt{'email'}.'</th>'. |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::start_data_table_row()); |
&Apache::loncommon::start_data_table_row()); |
foreach my $item ('firstname','middlename','lastname','generation','permenanentemail') { |
foreach my $item ('firstname','middlename','lastname','generation','permanentemail') { |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
$r->print(<<"END"); |
$r->print(<<"END"); |
<td><input type="text" name="c$item" value="$userenv{$item}" size="15" /></td> |
<td><input type="text" name="c$item" value="$userenv{$item}" size="15" /></td> |
Line 1446 sub update_user_data {
|
Line 1446 sub update_user_data {
|
$changeHash{'middlename'} = $env{'form.cmiddlename'}; |
$changeHash{'middlename'} = $env{'form.cmiddlename'}; |
$changeHash{'lastname'} = $env{'form.clastname'}; |
$changeHash{'lastname'} = $env{'form.clastname'}; |
$changeHash{'generation'} = $env{'form.cgeneration'}; |
$changeHash{'generation'} = $env{'form.cgeneration'}; |
$changeHash{'permanentemail'} = $env{'form.permanentemail'}; |
$changeHash{'permanentemail'} = $env{'form.cpermanentemail'}; |
my $putresult = &Apache::lonnet::put |
my $putresult = &Apache::lonnet::put |
('environment',\%changeHash, |
('environment',\%changeHash, |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
Line 1471 sub update_user_data {
|
Line 1471 sub update_user_data {
|
<th>$lt{'mddl'}</th> |
<th>$lt{'mddl'}</th> |
<th>$lt{'lst'}</th> |
<th>$lt{'lst'}</th> |
<th>$lt{'gen'}</th> |
<th>$lt{'gen'}</th> |
<th>$lt{'disk'}<th></tr> |
<th>$lt{'mail'}</th> |
|
<th>$lt{'disk'}</th></tr> |
<tr><td>$lt{'prvs'}</td> |
<tr><td>$lt{'prvs'}</td> |
<td>$userenv{'firstname'} </td> |
<td>$userenv{'firstname'} </td> |
<td>$userenv{'middlename'} </td> |
<td>$userenv{'middlename'} </td> |
Line 2193 sub user_search_result {
|
Line 2194 sub user_search_result {
|
my %inst_matches; |
my %inst_matches; |
my %srch_results; |
my %srch_results; |
my ($response,$state,$forcenewuser); |
my ($response,$state,$forcenewuser); |
|
$srch->{'srchterm'} =~ s/^\s+//; |
|
$srch->{'srchterm'} =~ s/\s+$//; |
|
|
if ($srch->{'srchby'} !~ /^(uname|lastname|lastfirst)$/) { |
if ($srch->{'srchby'} !~ /^(uname|lastname|lastfirst)$/) { |
$response = &mt('Invalid search.'); |
$response = &mt('Invalid search.'); |
} |
} |
if ($srch->{'srchin'} !~ /^(crs|dom|alc|instd)$/) { |
if ($srch->{'srchin'} !~ /^(crs|dom|alc|instd)$/) { |
Line 2214 sub user_search_result {
|
Line 2217 sub user_search_result {
|
} |
} |
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'crs') || |
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'crs') || |
($srch->{'srchin'} eq 'alc')) { |
($srch->{'srchin'} eq 'alc')) { |
if ($srch->{'srchterm'} !~ /^$match_username$/) { |
if ($srch->{'srchby'} eq 'uname') { |
$response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @'); |
if ($srch->{'srchterm'} !~ /^$match_username$/) { |
|
$response = &mt('You must specify a valid username. Only the following are allowed: letters numbers - . @'); |
|
} |
} |
} |
} |
} |
if ($srch->{'srchin'} eq 'instd') { |
if ($srch->{'srchin'} eq 'instd') { |
Line 2391 sub directorysrch_check {
|
Line 2396 sub directorysrch_check {
|
uname => 'username', |
uname => 'username', |
lastfirst => 'last name, first name', |
lastfirst => 'last name, first name', |
lastname => 'last name', |
lastname => 'last name', |
contains => 'is contained in', |
contains => 'contains', |
exact => 'as exact match to' |
exact => 'as exact match to' |
); |
); |
if ($can_search) { |
if ($can_search) { |
if (ref($dom_inst_srch{'directorysrch'}{'searchby'}) eq 'ARRAY') { |
if (ref($dom_inst_srch{'directorysrch'}{'searchby'}) eq 'ARRAY') { |
if (!grep(/^\Q$srch->{'srchby'}\E$/,@{$dom_inst_srch{'directorysrch'}{'searchby'}})) { |
if (!grep(/^\Q$srch->{'srchby'}\E$/,@{$dom_inst_srch{'directorysrch'}{'searchby'}})) { |
return &mt('Directory search in domain: [_1] is not available for searching by [_2]',$srch->{'srchdomain'},$longtext{$srch->{'srchby'}}); |
return &mt('Directory search in domain: [_1] is not available for searching by "[_2]"',$srch->{'srchdomain'},$longtext{$srch->{'srchby'}}); |
} |
} |
} else { |
} else { |
return &mt('Directory search in domain: [_1] is not available.', $srch->{'srchdomain'}); |
return &mt('Directory search in domain: [_1] is not available.', $srch->{'srchdomain'}); |
Line 2408 sub directorysrch_check {
|
Line 2413 sub directorysrch_check {
|
($dom_inst_srch{'directorysrch'}{'searchtypes'} eq $srch->{'srchtype'})) { |
($dom_inst_srch{'directorysrch'}{'searchtypes'} eq $srch->{'srchtype'})) { |
return 'ok'; |
return 'ok'; |
} else { |
} else { |
return &mt('Directory search in domain [_1] is not available for the requested search type: [_2]',$srch->{'srchdomain'},$longtext{$srch->{'srchtype'}}); |
return &mt('Directory search in domain [_1] is not available for the requested search type: "[_2]"',$srch->{'srchdomain'},$longtext{$srch->{'srchtype'}}); |
} |
} |
} |
} |
} |
} |
Line 2487 sub crumb_utilities {
|
Line 2492 sub crumb_utilities {
|
my %elements = ( |
my %elements = ( |
crtuser => { |
crtuser => { |
srchterm => 'text', |
srchterm => 'text', |
srchin => 'radio', |
srchin => 'selectbox', |
srchby => 'selectbox', |
srchby => 'selectbox', |
srchtype => 'selectbox', |
srchtype => 'selectbox', |
srchdomain => 'selectbox', |
srchdomain => 'selectbox', |