version 1.147, 2007/03/03 01:40:28
|
version 1.160, 2007/07/28 21:38:29
|
Line 65 use Apache::lonnet;
|
Line 65 use Apache::lonnet;
|
use Apache::loncommon; |
use Apache::loncommon; |
use Apache::lonlocal; |
use Apache::lonlocal; |
use Apache::longroup; |
use Apache::longroup; |
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
|
my $loginscript; # piece of javascript used in two separate instances |
my $loginscript; # piece of javascript used in two separate instances |
Line 122 sub portfolio_quota {
|
Line 121 sub portfolio_quota {
|
my ($ccuname,$ccdomain) = @_; |
my ($ccuname,$ccdomain) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'disk' => "Disk space allocated to user's portfolio files", |
'disk' => "Disk space allocated to user's portfolio files", |
|
'cuqu' => "Current quota", |
|
'cust' => "Custom quota", |
|
'defa' => "Default", |
|
'chqu' => "Change quota", |
); |
); |
my $output = '<h3>'.$lt{'disk'}.'</h3>'. |
my ($currquota,$quotatype,$inststatus,$defquota) = |
|
&Apache::loncommon::get_user_quota($ccuname,$ccdomain); |
|
my ($usertypes,$order) = &Apache::lonnet::retrieve_inst_usertypes($ccdomain); |
|
my ($longinsttype,$showquota,$custom_on,$custom_off,$defaultinfo); |
|
if ($inststatus ne '') { |
|
if ($usertypes->{$inststatus} ne '') { |
|
$longinsttype = $usertypes->{$inststatus}; |
|
} |
|
} |
|
$custom_on = ' '; |
|
$custom_off = ' checked="checked" '; |
|
my $quota_javascript = <<"END_SCRIPT"; |
|
<script type="text/javascript"> |
|
function quota_changes(caller) { |
|
if (caller == "custom") { |
|
if (document.cu.customquota[0].checked) { |
|
document.cu.portfolioquota.value = ""; |
|
} |
|
} |
|
if (caller == "quota") { |
|
document.cu.customquota[1].checked = true; |
|
} |
|
} |
|
</script> |
|
END_SCRIPT |
|
if ($quotatype eq 'custom') { |
|
$custom_on = $custom_off; |
|
$custom_off = ' '; |
|
$showquota = $currquota; |
|
if ($longinsttype eq '') { |
|
$defaultinfo = &mt('For this user, the default quota would be [_1] |
|
Mb.',$defquota); |
|
} else { |
|
$defaultinfo = &mt("For this user, the default quota would be [_1] |
|
Mb, as determined by the user's institutional |
|
affiliation ([_2]).",$defquota,$longinsttype); |
|
} |
|
} else { |
|
if ($longinsttype eq '') { |
|
$defaultinfo = &mt('For this user, the default quota is [_1] |
|
Mb.',$defquota); |
|
} else { |
|
$defaultinfo = &mt("For this user, the default quota of [_1] |
|
Mb, is determined by the user's institutional |
|
affiliation ([_2]).",$defquota,$longinsttype); |
|
} |
|
} |
|
my $output = $quota_javascript. |
|
'<h3>'.$lt{'disk'}.'</h3>'. |
|
$lt{'cuqu'}.': '.$currquota.' Mb. '. |
|
$defaultinfo.'<br /><span class="LC_nobreak">'.$lt{'chqu'}. |
|
': <label>'. |
|
'<input type="radio" name="customquota" value="0" '. |
|
$custom_off.' onchange="javascript:quota_changes('."'custom'".')" |
|
/>'.$lt{'defa'}.' ('.$defquota.' Mb).</label> '. |
|
' <label><input type="radio" name="customquota" value="1" '. |
|
$custom_on.' onchange="javascript:quota_changes('."'custom'".')" />'. |
|
$lt{'cust'}.':</label> '. |
'<input type="text" name="portfolioquota" size ="5" value="'. |
'<input type="text" name="portfolioquota" size ="5" value="'. |
&Apache::loncommon::get_user_quota($ccuname,$ccdomain). |
$showquota.'" onfocus="javascript:quota_changes('."'quota'".')" '. |
'" /> Mb'; |
'/> Mb'; |
return $output; |
return $output; |
} |
} |
|
|
# =================================================================== Phase one |
# =================================================================== Phase one |
|
|
sub print_username_entry_form { |
sub print_username_entry_form { |
my ($r) = @_; |
my ($r,$response,$srch,$forcenewuser) = @_; |
my $defdom=$env{'request.role.domain'}; |
my $defdom=$env{'request.role.domain'}; |
my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain'); |
my $formtoset = 'crtuser'; |
my $selscript=&Apache::loncommon::studentbrowser_javascript(); |
if (exists($env{'form.startrolename'})) { |
|
$formtoset = 'docustom'; |
|
$env{'form.rolename'} = $env{'form.startrolename'}; |
|
} |
|
my ($newuserscript,$newuservalidate); |
|
|
|
if ($forcenewuser) { |
|
$newuserscript = <<"ENDSCRIPT"; |
|
|
|
function setSearch() { |
|
var createnew = 0; |
|
for (var i=0; i<document.crtuser.forcenew.length; i++) { |
|
if (document.crtuser.forcenew[i].checked) { |
|
if (document.crtuser.forcenew[i].value == 1) { |
|
createnew = 1; |
|
} |
|
} |
|
} |
|
if (createnew == 1) { |
|
for (var i=0; i<document.crtuser.srchby.length; i++) { |
|
if (document.crtuser.srchby.options[i].value == 'uname') { |
|
document.crtuser.srchby.selectedIndex = i; |
|
} |
|
} |
|
for (var i=0; i<document.crtuser.srchin.length; i++) { |
|
if (document.crtuser.srchin.options[i].value == 'dom') { |
|
document.crtuser.srchin.selectedIndex = i; |
|
} |
|
} |
|
for (var i=0; i<document.crtuser.srchtype.length; i++) { |
|
if (document.crtuser.srchtype.options[i].value == 'exact') { |
|
document.crtuser.srchtype.selectedIndex = i; |
|
} |
|
} |
|
for (var i=0; i<document.crtuser.srchdomain.length; i++) { |
|
if (document.crtuser.srchdomain.options[i].value == '$env{'request.role.domain'}') { |
|
document.crtuser.srchdomain.selectedIndex = i; |
|
} |
|
} |
|
} |
|
} |
|
ENDSCRIPT |
|
$newuservalidate = <<"ENDBLOCK"; |
|
setSearch(); |
|
ENDBLOCK |
|
} |
|
my $validatescript = <<"ENDSCRIPT"; |
|
|
|
function validateEntry() { |
|
var checkok = 1; |
|
var srchin = document.crtuser.srchin.options[document.crtuser.srchin.selectedIndex].value; |
|
var srchtype = document.crtuser.srchtype.options[document.crtuser.srchtype.selectedIndex].value; |
|
var srchby = document.crtuser.srchby.options[document.crtuser.srchby.selectedIndex].value; |
|
var srchdomain = document.crtuser.srchdomain.options[document.crtuser.srchdomain.selectedIndex].value; |
|
var srchterm = document.crtuser.srchterm.value; |
|
var msg = ""; |
|
|
|
if (srchterm == "") { |
|
checkok = 0; |
|
msg += "You must include some text to search for.\\n"; |
|
} |
|
|
|
$newuservalidate |
|
|
|
if (srchtype== 'contains') { |
|
if (srchterm.length < 3) { |
|
checkok = 0; |
|
msg += "The text you are searching for must contain at least three characters when using a 'contained in' type search.\\n"; |
|
} |
|
} |
|
if (srchin == 'instd') { |
|
if (srchdomain == '') { |
|
checkok = 0; |
|
msg += "You must choose a domain when using an institutional directory search.\\n"; |
|
} |
|
} |
|
if (srchin == 'dom') { |
|
if (srchdomain == '') { |
|
checkok = 0; |
|
msg += "You must choose a domain when using a domain search.\\n"; |
|
} |
|
} |
|
if (srchby == 'lastfirst') { |
|
if (srchterm.indexOf(",") == -1) { |
|
checkok = 0; |
|
msg += "When using searching by last,first you must include a comma as separator between last name and first name.\\n"; |
|
} |
|
if (srchterm.indexOf(",") == srchterm.length -1) { |
|
checkok = 0; |
|
msg += "When searching by last,first you must include at least one character in the first name.\\n"; |
|
} |
|
} |
|
if (checkok == 0) { |
|
alert("The following need to be corrected before the search can be run:\\n"+msg); |
|
return; |
|
} |
|
if (checkok == 1) { |
|
document.crtuser.submit(); |
|
} |
|
} |
|
|
|
ENDSCRIPT |
|
|
|
my ($jsback,$elements) = &crumb_utilities(); |
|
|
|
my $jscript = &Apache::loncommon::studentbrowser_javascript()."\n". |
|
'<script type"text/javascript">'."\n". |
|
&Apache::lonhtmlcommon::set_form_elements($elements->{$formtoset}). |
|
$newuserscript.$validatescript.'</script>'."\n"; |
|
|
|
my %loaditems = ( |
|
'onload' => "javascript:setFormElements(document.$formtoset)", |
|
); |
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Create Users, Change User Privileges', |
&Apache::loncommon::start_page('Create Users, Change User Privileges', |
$selscript); |
$jscript,{'add_entries' => \%loaditems,}); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.crtuser)", |
|
text=>"User/custom role search", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
|
my $sellink=&Apache::loncommon::selectstudent_link |
my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management'); |
('crtuser','ccuname','ccdomain'); |
|
my %existingroles=&my_custom_roles(); |
my %existingroles=&my_custom_roles(); |
my $choice=&Apache::loncommon::select_form('make new role','rolename', |
my $choice=&Apache::loncommon::select_form('make new role','rolename', |
('make new role' => 'Generate new role ...',%existingroles)); |
('make new role' => 'Generate new role ...',%existingroles)); |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'siur' => "Set Individual User Roles", |
'srch' => "User Search", |
|
or => "or", |
|
'siur' => "Set Individual User Roles", |
'usr' => "Username", |
'usr' => "Username", |
'dom' => "Domain", |
'dom' => "Domain", |
'usrr' => "User Roles", |
|
'ecrp' => "Edit Custom Role Privileges", |
'ecrp' => "Edit Custom Role Privileges", |
'nr' => "Name of Role", |
'nr' => "Name of Role", |
'cre' => "Custom Role Editor" |
'cre' => "Custom Role Editor", |
); |
); |
my $help = &Apache::loncommon::help_open_menu(undef,undef,282,'Instructor Interface'); |
my $help = &Apache::loncommon::help_open_menu(undef,undef,282,'Instructor Interface'); |
my $helpsiur=&Apache::loncommon::help_open_topic('Course_Change_Privileges'); |
my $helpsiur=&Apache::loncommon::help_open_topic('Course_Change_Privileges'); |
my $helpecpr=&Apache::loncommon::help_open_topic('Course_Editing_Custom_Roles'); |
my $helpecpr=&Apache::loncommon::help_open_topic('Course_Editing_Custom_Roles'); |
$r->print(<<"ENDDOCUMENT"); |
my $sellink=&Apache::loncommon::selectstudent_link('crtuser','srchterm','srchdomain'); |
|
if ($sellink) { |
|
$sellink = "$lt{'or'} ".$sellink; |
|
} |
|
$r->print(" |
$start_page |
$start_page |
<form action="/adm/createuser" method="post" name="crtuser"> |
$crumbs |
<input type="hidden" name="phase" value="get_user_info"> |
|
<h2>$lt{siur}$helpsiur</h2> |
<h2>$lt{siur}$helpsiur</h2> |
<table> |
<h3>$lt{'srch'} $sellink</h3> |
<tr><td>$lt{usr}:</td><td><input type="text" size="15" name="ccuname"> |
$response"); |
</td><td rowspan="2">$sellink</td></tr><tr><td> |
$r->print(&entry_form($defdom,$srch,$forcenewuser)); |
$lt{'dom'}:</td><td>$domform</td></tr> |
if (&Apache::lonnet::allowed('mcr','/')) { |
</table> |
$r->print(<<ENDCUSTOM); |
<input name="userrole" type="submit" value="$lt{usrr}" /> |
|
</form> |
|
ENDDOCUMENT |
|
if (&Apache::lonnet::allowed('mcr','/')) { |
|
$r->print(<<ENDCUSTOM); |
|
<form action="/adm/createuser" method="post" name="docustom"> |
<form action="/adm/createuser" method="post" name="docustom"> |
<input type="hidden" name="phase" value="selected_custom_edit"> |
<input type="hidden" name="phase" value="selected_custom_edit" /> |
<h2>$lt{'ecrp'}$helpecpr</h2> |
<h2>$lt{'ecrp'}$helpecpr</h2> |
$lt{'nr'}: $choice <input type="text" size="15" name="newrolename" /><br /> |
$lt{'nr'}: $choice <input type="text" size="15" name="newrolename" /><br /> |
<input name="customeditor" type="submit" value="$lt{'cre'}" /> |
<input name="customeditor" type="submit" value="$lt{'cre'}" /> |
Line 184 ENDCUSTOM
|
Line 358 ENDCUSTOM
|
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
|
sub entry_form { |
|
my ($dom,$srch,$forcenewuser) = @_; |
|
my $userpicker = |
|
&Apache::loncommon::user_picker($dom,$srch,$forcenewuser); |
|
my $srchbutton = &mt('Search'); |
|
my $output = <<"ENDDOCUMENT"; |
|
<form action="/adm/createuser" method="post" name="crtuser"> |
|
<input type="hidden" name="phase" value="get_user_info" /> |
|
$userpicker |
|
<input name="userrole" type="button" value="$srchbutton" onclick="javascript:validateEntry()" /> |
|
</form> |
|
ENDDOCUMENT |
|
return $output; |
|
} |
|
|
sub user_modification_js { |
sub user_modification_js { |
my ($pjump_def,$dc_setcourse_code,$nondc_setsection_code,$groupslist)=@_; |
my ($pjump_def,$dc_setcourse_code,$nondc_setsection_code,$groupslist)=@_; |
Line 213 END
|
Line 401 END
|
} |
} |
|
|
# =================================================================== Phase two |
# =================================================================== Phase two |
sub print_user_modification_page { |
sub print_user_selection_page { |
my $r=shift; |
my ($r,$response,$srch,$srch_results) = @_; |
my $ccuname =&LONCAPA::clean_username($env{'form.ccuname'}); |
my @fields = ('username','domain','lastname','firstname','permanentemail'); |
my $ccdomain=&LONCAPA::clean_domain($env{'form.ccdomain'}); |
my $sortby = $env{'form.sortby'}; |
|
|
|
if (!grep(/^\Q$sortby\E$/,@fields)) { |
|
$sortby = 'lastname'; |
|
} |
|
|
|
my ($jsback,$elements) = &crumb_utilities(); |
|
|
|
my $jscript = (<<ENDSCRIPT); |
|
<script type="text/javascript"> |
|
function pickuser(uname,udom) { |
|
document.usersrchform.seluname.value=uname; |
|
document.usersrchform.seludom.value=udom; |
|
document.usersrchform.phase.value="userpicked"; |
|
document.usersrchform.submit(); |
|
} |
|
|
|
$jsback |
|
</script> |
|
ENDSCRIPT |
|
|
|
my %lt=&Apache::lonlocal::texthash( |
|
'srch' => "User Search", |
|
'username' => "username", |
|
'domain' => "domain", |
|
'lastname' => "last name", |
|
'firstname' => "first name", |
|
'permanentemail' => "permanent e-mail", |
|
); |
|
$r->print(&Apache::loncommon::start_page('Create Users, Change User Privileges',$jscript)); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.usersrchform,'','')", |
|
text=>"User/custom role search", |
|
faq=>282,bug=>'Instructor Interface',}, |
|
{href=>"javascript:backPage(document.usersrchform,'get_user_info','select')", |
|
text=>"Select User", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
|
$r->print("<b>$lt{'srch'}</b><br />"); |
|
$r->print(&entry_form($srch->{'srchdomain'},$srch)); |
|
$r->print('<h3>'.&mt('Select a user').'</h3>'); |
|
$r->print('<form name="usersrchform" method="post">'. |
|
&Apache::loncommon::start_data_table()."\n". |
|
&Apache::loncommon::start_data_table_header_row()."\n". |
|
' <th> </th>'."\n"); |
|
foreach my $field (@fields) { |
|
$r->print(' <th><a href="javascript:document.usersrchform.sortby.value='. |
|
"'".$field."'".';document.usersrchform.submit();">'. |
|
$lt{$field}.'</a></th>'."\n"); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table_header_row()); |
|
|
|
my @sorted_users = sort { |
|
lc($srch_results->{$a}->{$sortby}) cmp lc($srch_results->{$b}->{$sortby}) |
|
|| |
|
lc($srch_results->{$a}->{lastname}) cmp lc($srch_results->{$b}->{lastname}) |
|
|| |
|
lc($srch_results->{$a}->{firstname}) cmp lc($srch_results->{$b}->{firstname}) |
|
} (keys(%$srch_results)); |
|
|
|
foreach my $user (@sorted_users) { |
|
my ($uname,$udom) = split(/:/,$user); |
|
$r->print(&Apache::loncommon::start_data_table_row(). |
|
'<td><input type="button" name="seluser" value="'.&mt('Select').'" onclick="javascript:pickuser('."'".$uname."'".','."'".$udom."'".')" /></td>'. |
|
'<td><tt>'.$uname.'</tt></td>'. |
|
'<td><tt>'.$udom.'</tt></td>'); |
|
foreach my $field ('lastname','firstname','permanentemail') { |
|
$r->print('<td>'.$srch_results->{$user}->{$field}.'</td>'); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table().'<br /><br />'); |
|
$r->print(&Apache::lonhtmlcommon::echo_form_input(['sortby','seluname','seludom','state','phase'])); |
|
$r->print(' <input type="hidden" name="sortby" value="'.$sortby.'" />'."\n". |
|
' <input type="hidden" name="seluname" value="" />'."\n". |
|
' <input type="hidden" name="seludom" value="" />'."\n". |
|
' <input type="hidden" name="state" value="select" />'."\n". |
|
' <input type="hidden" name="phase" value="get_user_info" />'."\n". |
|
'</form>'); |
|
$r->print($response); |
|
$r->print(&Apache::loncommon::end_page()); |
|
} |
|
|
|
sub print_user_query_page { |
|
my ($r) = @_; |
|
# 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. |
|
return; |
|
} |
|
|
|
sub print_user_modification_page { |
|
my ($r,$ccuname,$ccdomain,$srch,$response) = @_; |
unless (($ccuname) && ($ccdomain)) { |
unless (($ccuname) && ($ccdomain)) { |
&print_username_entry_form($r); |
&print_username_entry_form($r); |
return; |
return; |
} |
} |
|
if ($response) { |
|
$response = '<br />'.$response |
|
} |
my $defdom=$env{'request.role.domain'}; |
my $defdom=$env{'request.role.domain'}; |
|
|
my ($krbdef,$krbdefdom) = |
my ($krbdef,$krbdefdom) = |
Line 231 sub print_user_modification_page {
|
Line 512 sub print_user_modification_page {
|
my %param = ( formname => 'document.cu', |
my %param = ( formname => 'document.cu', |
kerb_def_dom => $krbdefdom, |
kerb_def_dom => $krbdefdom, |
kerb_def_auth => $krbdef |
kerb_def_auth => $krbdef |
); |
); |
$loginscript = &Apache::loncommon::authform_header(%param); |
$loginscript = &Apache::loncommon::authform_header(%param); |
$authformkrb = &Apache::loncommon::authform_kerberos(%param); |
$authformkrb = &Apache::loncommon::authform_kerberos(%param); |
|
|
$ccuname =&LONCAPA::clean_username($ccuname); |
$ccuname =&LONCAPA::clean_username($ccuname); |
$ccdomain=&LONCAPA::clean_domain($ccdomain); |
$ccdomain=&LONCAPA::clean_domain($ccdomain); |
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); |
my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); |
Line 368 ENDSCRIPT
|
Line 649 ENDSCRIPT
|
var checkcurr = str.match(re1); |
var checkcurr = str.match(re1); |
if (checkcurr != null) { |
if (checkcurr != null) { |
if (document.cu.elements[i-1].checked == true) { |
if (document.cu.elements[i-1].checked == true) { |
var re2 = /^currsec_[a-zA-Z0-9]+_[a-zA-Z0-9]+_(\\w+)\$/; |
var match = str.split('_'); |
match = re2.exec(str); |
var role = match[3]; |
var role = match[1]; |
|
if (role == 'cc') { |
if (role == 'cc') { |
alert("Section designations do not apply to Course Coordinator roles.\\nA course coordinator role will be added with access to all sections."); |
alert("Section designations do not apply to Course Coordinator roles.\\nA course coordinator role will be added with access to all sections."); |
} |
} |
Line 439 ENDSECCODE
|
Line 719 ENDSECCODE
|
} |
} |
my $js = &user_modification_js($pjump_def,$dc_setcourse_code, |
my $js = &user_modification_js($pjump_def,$dc_setcourse_code, |
$nondc_setsection_code,$groupslist); |
$nondc_setsection_code,$groupslist); |
|
|
|
my ($jsback,$elements) = &crumb_utilities(); |
|
|
|
$js .= "\n". |
|
'<script type="text/javascript">'."\n".$jsback."\n".'</script>'; |
|
|
my $start_page = |
my $start_page = |
&Apache::loncommon::start_page('Create Users, Change User Privileges', |
&Apache::loncommon::start_page('Create Users, Change User Privileges', |
$js,{'add_entries' => \%loaditem,}); |
$js,{'add_entries' => \%loaditem,}); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.cu)", |
|
text=>"User/custom role search", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
|
|
if ($env{'form.phase'} eq 'userpicked') { |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.cu,'get_user_info','select')", |
|
text=>"Select a user", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
} |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.cu,'$env{'form.phase'}','modify')", |
|
text=>"Set user role", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management'); |
|
|
my $forminfo =<<"ENDFORMINFO"; |
my $forminfo =<<"ENDFORMINFO"; |
<form action="/adm/createuser" method="post" name="cu"> |
<form action="/adm/createuser" method="post" name="cu"> |
<input type="hidden" name="phase" value="update_user_data"> |
<input type="hidden" name="phase" value="update_user_data" /> |
<input type="hidden" name="ccuname" value="$ccuname"> |
<input type="hidden" name="ccuname" value="$ccuname" /> |
<input type="hidden" name="ccdomain" value="$ccdomain"> |
<input type="hidden" name="ccdomain" value="$ccdomain" /> |
<input type="hidden" name="pres_value" value="" > |
<input type="hidden" name="pres_value" value="" /> |
<input type="hidden" name="pres_type" value="" > |
<input type="hidden" name="pres_type" value="" /> |
<input type="hidden" name="pres_marker" value="" > |
<input type="hidden" name="pres_marker" value="" /> |
ENDFORMINFO |
ENDFORMINFO |
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain); |
my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain); |
my %inccourses; |
my %inccourses; |
Line 460 ENDFORMINFO
|
Line 762 ENDFORMINFO
|
} |
} |
} |
} |
if ($uhome eq 'no_host') { |
if ($uhome eq 'no_host') { |
|
my $instsrch = { |
|
srchin => 'instd', |
|
srchterm => $env{'form.seluname'}, |
|
srchdomain => $env{'form.seludom'}, |
|
srchby => 'uname', |
|
srchtype => 'exact', |
|
}; |
|
my %inst_results; |
|
if (directorysrch_check($instsrch) eq 'ok') { |
|
%inst_results = &Apache::lonnet::inst_directory_query($instsrch); |
|
} |
my $home_server_list= |
my $home_server_list= |
'<option value="default" selected>default</option>'."\n". |
'<option value="default" selected>default</option>'."\n". |
&Apache::loncommon::home_server_option_list($ccdomain); |
&Apache::loncommon::home_server_option_list($ccdomain); |
Line 473 ENDFORMINFO
|
Line 786 ENDFORMINFO
|
'mn' => "Middle Name", |
'mn' => "Middle Name", |
'ln' => "Last Name", |
'ln' => "Last Name", |
'gen' => "Generation", |
'gen' => "Generation", |
|
'mail' => "Permanent e-mail address", |
'idsn' => "ID/Student Number", |
'idsn' => "ID/Student Number", |
'hs' => "Home Server", |
'hs' => "Home Server", |
'lg' => "Login Data" |
'lg' => "Login Data" |
Line 486 ENDFORMINFO
|
Line 800 ENDFORMINFO
|
&initialize_authen_forms(); |
&initialize_authen_forms(); |
$r->print(<<ENDNEWUSER); |
$r->print(<<ENDNEWUSER); |
$start_page |
$start_page |
|
$crumbs |
<h1>$lt{'cnu'}</h1> |
<h1>$lt{'cnu'}</h1> |
|
$response |
$forminfo |
$forminfo |
<h2>$lt{'nu'} "$ccuname" $lt{'id'} $ccdomain</h2> |
<h2>$lt{'nu'} "$ccuname" $lt{'id'} $ccdomain</h2> |
<script type="text/javascript" language="Javascript"> |
<script type="text/javascript" language="Javascript"> |
Line 497 $loginscript
|
Line 813 $loginscript
|
<p> |
<p> |
<table> |
<table> |
<tr><td>$lt{'fn'} </td> |
<tr><td>$lt{'fn'} </td> |
<td><input type='text' name='cfirst' size='15' /></td></tr> |
<td><input type="text" name="cfirst" size="15" value="$inst_results{'firstname'}" /></td></tr> |
<tr><td>$lt{'mn'} </td> |
<tr><td>$lt{'mn'} </td> |
<td><input type='text' name='cmiddle' size='15' /></td></tr> |
<td><input type="text" name="cmiddle" size="15" value="$inst_results{'middlename'}" /></td></tr> |
<tr><td>$lt{'ln'} </td> |
<tr><td>$lt{'ln'} </td> |
<td><input type='text' name='clast' size='15' /></td></tr> |
<td><input type="text" name="clast" size="15" value="$inst_results{'lastname'}" /></td></tr> |
<tr><td>$lt{'gen'}$genhelp</td> |
<tr><td>$lt{'gen'}$genhelp</td> |
<td><input type='text' name='cgen' size='5' /></td></tr> |
<td><input type="text" name="cgen" size="5" value="$inst_results{'generation'}" /></td></tr> |
|
<tr><td>$lt{'mail'}</td> |
|
<td><input type="text" name="cemail" size="20" value="$inst_results{'permanentemail'}" /></td></tr> |
</table> |
</table> |
$lt{'idsn'} <input type='text' name='cstid' size='15' /></p> |
$lt{'idsn'} <input type="text" name="cstid" size="15" value="$inst_results{'id'}" /></p> |
$lt{'hs'}: <select name="hserver" size="1"> $home_server_list </select> |
$lt{'hs'}: <select name="hserver" size="1"> $home_server_list </select> |
<hr /> |
<hr /> |
<h3>$lt{'lg'}</h3> |
<h3>$lt{'lg'}</h3> |
Line 525 ENDNEWUSER
|
Line 843 ENDNEWUSER
|
'fn' => "first name", |
'fn' => "first name", |
'mn' => "middle name", |
'mn' => "middle name", |
'ln' => "last name", |
'ln' => "last name", |
'gen' => "generation" |
'gen' => "generation", |
|
'email' => "permanent e-mail", |
); |
); |
$r->print(<<ENDCHANGEUSER); |
$r->print(<<ENDCHANGEUSER); |
$start_page |
$start_page |
|
$crumbs |
<h1>$lt{'cup'}</h1> |
<h1>$lt{'cup'}</h1> |
$forminfo |
$forminfo |
<h2>$lt{'usr'} "$ccuname" $lt{'id'} "$ccdomain"</h2> |
<h2>$lt{'usr'} "$ccuname" $lt{'id'} "$ccdomain"</h2> |
ENDCHANGEUSER |
ENDCHANGEUSER |
# Get the users information |
# Get the users information |
my %userenv = &Apache::lonnet::get('environment', |
my %userenv = |
['firstname','middlename','lastname','generation', |
&Apache::lonnet::get('environment', |
'portfolioquota'],$ccdomain,$ccuname); |
['firstname','middlename','lastname','generation', |
|
'permanentemail','portfolioquota'],$ccdomain,$ccuname); |
my %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname); |
my %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname); |
$r->print(' |
$r->print(' |
<hr />'. |
<hr />'. |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table_header_row(). |
&Apache::loncommon::start_data_table_header_row(). |
'<th>'.$lt{'fn'}.'</th><th>'.$lt{'mn'}.'</th><th>'.$lt{'ln'}.'</th><th>'.$lt{'gen'}.'</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') { |
foreach my $item ('firstname','middlename','lastname','generation','permenanentemail') { |
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 669 END
|
Line 990 END
|
my $active=1; |
my $active=1; |
$active=0 if (($role_end_time) && ($now>$role_end_time)); |
$active=0 if (($role_end_time) && ($now>$role_end_time)); |
if (($active) && ($allowed)) { |
if (($active) && ($allowed)) { |
$row.= '<input type="checkbox" name="rev:'.$thisrole.'">'; |
$row.= '<input type="checkbox" name="rev:'.$thisrole.'" />'; |
} else { |
} else { |
if ($active) { |
if ($active) { |
$row.=' '; |
$row.=' '; |
Line 679 END
|
Line 1000 END
|
} |
} |
$row.='</td><td>'; |
$row.='</td><td>'; |
if ($allowed && !$active) { |
if ($allowed && !$active) { |
$row.= '<input type="checkbox" name="ren:'.$thisrole.'">'; |
$row.= '<input type="checkbox" name="ren:'.$thisrole.'" />'; |
} else { |
} else { |
$row.=' '; |
$row.=' '; |
} |
} |
$row.='</td><td>'; |
$row.='</td><td>'; |
if ($delallowed) { |
if ($delallowed) { |
$row.= '<input type="checkbox" name="del:'.$thisrole.'">'; |
$row.= '<input type="checkbox" name="del:'.$thisrole.'" />'; |
} else { |
} else { |
$row.=' '; |
$row.=' '; |
} |
} |
my $plaintext=''; |
my $plaintext=''; |
unless ($croletitle) { |
if (!$croletitle) { |
$plaintext=&Apache::lonnet::plaintext($role_code,$class) |
$plaintext=&Apache::lonnet::plaintext($role_code,$class) |
} else { |
} else { |
$plaintext= |
$plaintext= |
Line 938 ENDNOPRIV
|
Line 1259 ENDNOPRIV
|
$num_domain_level ++; |
$num_domain_level ++; |
$domaintext .= |
$domaintext .= |
&Apache::loncommon::start_data_table_row(). |
&Apache::loncommon::start_data_table_row(). |
'<td><input type=checkbox name="act_'.$thisdomain.'_'.$role.'"></td> |
'<td><input type=checkbox name="act_'.$thisdomain.'_'.$role.'" /></td> |
<td>'.$plrole.'</td> |
<td>'.$plrole.'</td> |
<td>'.$thisdomain.'</td> |
<td>'.$thisdomain.'</td> |
<td><input type=hidden name="start_'.$thisdomain.'_'.$role.'" value=""> |
<td><input type=hidden name="start_'.$thisdomain.'_'.$role.'" value="" /> |
<a href= |
<a href= |
"javascript:pjump('."'date_start','Start Date $plrole',document.cu.start_$thisdomain\_$role.value,'start_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'ssd'}.'</a></td> |
"javascript:pjump('."'date_start','Start Date $plrole',document.cu.start_$thisdomain\_$role.value,'start_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'ssd'}.'</a></td> |
<td><input type=hidden name="end_'.$thisdomain.'_'.$role.'" value=""> |
<td><input type=hidden name="end_'.$thisdomain.'_'.$role.'" value="" /> |
<a href= |
<a href= |
"javascript:pjump('."'date_end','End Date $plrole',document.cu.end_$thisdomain\_$role.value,'end_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'sed'}.'</a></td>'. |
"javascript:pjump('."'date_end','End Date $plrole',document.cu.end_$thisdomain\_$role.value,'end_$thisdomain\_$role','cu.pres','dateset'".')">'.$lt{'sed'}.'</a></td>'. |
&Apache::loncommon::end_data_table_row(); |
&Apache::loncommon::end_data_table_row(); |
Line 961 ENDNOPRIV
|
Line 1282 ENDNOPRIV
|
|
|
if ($env{'request.role'} =~ m{^dc\./($match_domain)/$}) { |
if ($env{'request.role'} =~ m{^dc\./($match_domain)/$}) { |
$r->print(&course_level_dc($1,'Course')); |
$r->print(&course_level_dc($1,'Course')); |
$r->print('<hr /><input type="button" value="'.&mt('Modify User').'" onClick="setCourse()">'."\n"); |
$r->print('<hr /><input type="button" value="'.&mt('Modify User').'" onClick="setCourse()" />'."\n"); |
} else { |
} else { |
$r->print(&course_level_table(%inccourses)); |
$r->print(&course_level_table(%inccourses)); |
$r->print('<hr /><input type="button" value="'.&mt('Modify User').'" onClick="setSections()">'."\n"); |
$r->print('<hr /><input type="button" value="'.&mt('Modify User').'" onClick="setSections()" />'."\n"); |
} |
} |
|
$r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','userrole','ccdomain','prevphase','state'])); |
|
$r->print('<input type="hidden" name="state" value="" />'); |
|
$r->print('<input type="hidden" name="prevphase" value="'.$env{'form.phase'}.'" />'); |
$r->print("</form>".&Apache::loncommon::end_page()); |
$r->print("</form>".&Apache::loncommon::end_page()); |
} |
} |
|
|
# ================================================================= Phase Three |
# ================================================================= Phase Three |
sub update_user_data { |
sub update_user_data { |
my $r=shift; |
my ($r) = @_; |
my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'}, |
my $uhome=&Apache::lonnet::homeserver($env{'form.ccuname'}, |
$env{'form.ccdomain'}); |
$env{'form.ccdomain'}); |
# Error messages |
# Error messages |
Line 984 sub update_user_data {
|
Line 1308 sub update_user_data {
|
} else { |
} else { |
$title='Modify User Privileges'; |
$title='Modify User Privileges'; |
} |
} |
$r->print(&Apache::loncommon::start_page($title)); |
|
|
my ($jsback,$elements) = &crumb_utilities(); |
|
my $jscript = '<script type="text/javascript">'."\n". |
|
$jsback."\n".'</script>'."\n"; |
|
|
|
$r->print(&Apache::loncommon::start_page($title,$jscript)); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.userupdate)", |
|
text=>"User/custom role 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=>"Select a user", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
} |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.userupdate,'$env{'form.prevphase'}','modify')", |
|
text=>"Set user role", |
|
faq=>282,bug=>'Instructor Interface',}, |
|
{href=>"/adm/createuser", |
|
text=>"Result", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
|
|
my %disallowed; |
my %disallowed; |
# Check Inputs |
# Check Inputs |
if (! $env{'form.ccuname'} ) { |
if (! $env{'form.ccuname'} ) { |
Line 994 sub update_user_data {
|
Line 1342 sub update_user_data {
|
if ( $env{'form.ccuname'} ne |
if ( $env{'form.ccuname'} ne |
&LONCAPA::clean_username($env{'form.ccuname'}) ) { |
&LONCAPA::clean_username($env{'form.ccuname'}) ) { |
$r->print($error.&mt('Invalid login name').'. '. |
$r->print($error.&mt('Invalid login name').'. '. |
&mt('Only letters, numbers, and underscores are valid').'.'. |
&mt('Only letters, numbers, periods, dashes, @, and underscores are valid').'.'. |
$end); |
$end); |
return; |
return; |
} |
} |
Line 1082 ENDNEWUSERHEAD
|
Line 1430 ENDNEWUSERHEAD
|
my $home = &Apache::lonnet::homeserver($env{'form.ccuname'}, |
my $home = &Apache::lonnet::homeserver($env{'form.ccuname'}, |
$env{'form.ccdomain'}); |
$env{'form.ccdomain'}); |
$r->print('<br />'.&mt('Home server').': '.$home.' '. |
$r->print('<br />'.&mt('Home server').': '.$home.' '. |
$Apache::lonnet::libserv{$home}); |
&Apache::lonnet::hostname($home)); |
} elsif (($env{'form.login'} ne 'nochange') && |
} elsif (($env{'form.login'} ne 'nochange') && |
($env{'form.login'} ne '' )) { |
($env{'form.login'} ne '' )) { |
# Modify user privileges |
# Modify user privileges |
Line 1115 ENDMODIFYUSERHEAD
|
Line 1463 ENDMODIFYUSERHEAD
|
# Check for need to change |
# Check for need to change |
my %userenv = &Apache::lonnet::get |
my %userenv = &Apache::lonnet::get |
('environment',['firstname','middlename','lastname','generation', |
('environment',['firstname','middlename','lastname','generation', |
'portfolioquota'],$env{'form.ccdomain'},$env{'form.ccuname'}); |
'permanentemail','portfolioquota','inststatus'], |
|
$env{'form.ccdomain'},$env{'form.ccuname'}); |
my ($tmp) = keys(%userenv); |
my ($tmp) = keys(%userenv); |
if ($tmp =~ /^(con_lost|error)/i) { |
if ($tmp =~ /^(con_lost|error)/i) { |
%userenv = (); |
%userenv = (); |
} |
} |
# Check to see if we need to change user information |
# Check to see if we need to change user information |
foreach my $item ('firstname','middlename','lastname','generation') { |
foreach my $item ('firstname','middlename','lastname','generation','permanentemail') { |
# Strip leading and trailing whitespace |
# Strip leading and trailing whitespace |
$env{'form.c'.$item} =~ s/(\s+$|^\s+)//g; |
$env{'form.c'.$item} =~ s/(\s+$|^\s+)//g; |
} |
} |
my ($quotachanged,$namechanged,$oldportfolioquota); |
my ($quotachanged,$namechanged,$oldportfolioquota,$newportfolioquota, |
|
$inststatus,$isdefault,$defquotatext); |
|
my ($defquota,$settingstatus) = |
|
&Apache::loncommon::default_quota($env{'form.ccdomain'},$inststatus); |
my %changeHash; |
my %changeHash; |
if (exists($userenv{'portfolioquota'})) { |
if ($userenv{'portfolioquota'} ne '') { |
$oldportfolioquota = $userenv{'portfolioquota'}; |
$oldportfolioquota = $userenv{'portfolioquota'}; |
if (exists($env{'form.portfolioquota'})) { |
if ($env{'form.customquota'} == 1) { |
if ($env{'form.portfolioquota'} ne $userenv{'portfolioquota'}) { |
if ($env{'form.portfolioquota'} eq '') { |
if (&Apache::lonnet::allowed('mpq',$env{'form.ccdomain'})) { |
$newportfolioquota = 0; |
# Current user has quota modification privileges |
} else { |
$quotachanged = 1; |
$newportfolioquota = $env{'form.portfolioquota'}; |
$changeHash{'portfolioquota'} = $env{'form.portfolioquota'}; |
$newportfolioquota =~ s/[^\d\.]//g; |
} |
} |
|
if ($newportfolioquota != $userenv{'portfolioquota'}) { |
|
$quotachanged = "a_admin($newportfolioquota,\%changeHash); |
} |
} |
|
} else { |
|
$quotachanged = "a_admin('',\%changeHash); |
|
$newportfolioquota = $defquota; |
|
$isdefault = 1; |
} |
} |
} else { |
} else { |
$oldportfolioquota = |
$oldportfolioquota = $defquota; |
&Apache::loncommon::default_quota($env{'form.ccdomain'}); |
if ($env{'form.customquota'} == 1) { |
|
if ($env{'form.portfolioquota'} eq '') { |
|
$newportfolioquota = 0; |
|
} else { |
|
$newportfolioquota = $env{'form.portfolioquota'}; |
|
$newportfolioquota =~ s/[^\d\.]//g; |
|
} |
|
$quotachanged = "a_admin($newportfolioquota,\%changeHash); |
|
} else { |
|
$newportfolioquota = $defquota; |
|
$isdefault = 1; |
|
} |
|
} |
|
if ($isdefault) { |
|
if ($settingstatus eq '') { |
|
$defquotatext = &mt('(default)'); |
|
} else { |
|
my ($usertypes,$order) = |
|
&Apache::lonnet::retrieve_inst_usertypes($env{'form.ccdomain'}); |
|
if ($usertypes->{$settingstatus} eq '') { |
|
$defquotatext = &mt('(default)'); |
|
} else { |
|
$defquotatext = &mt('(default for [_1])',$usertypes->{$settingstatus}); |
|
} |
|
} |
} |
} |
if (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}) && |
if (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}) && |
($env{'form.cfirstname'} ne $userenv{'firstname'} || |
($env{'form.cfirstname'} ne $userenv{'firstname'} || |
$env{'form.cmiddlename'} ne $userenv{'middlename'} || |
$env{'form.cmiddlename'} ne $userenv{'middlename'} || |
$env{'form.clastname'} ne $userenv{'lastname'} || |
$env{'form.clastname'} ne $userenv{'lastname'} || |
$env{'form.cgeneration'} ne $userenv{'generation'} )) { |
$env{'form.cgeneration'} ne $userenv{'generation'} || |
|
$env{'form.cpermanentemail'} ne $userenv{'permanentemail'} )) { |
$namechanged = 1; |
$namechanged = 1; |
} |
} |
if ($namechanged) { |
if ($namechanged) { |
Line 1155 ENDMODIFYUSERHEAD
|
Line 1538 ENDMODIFYUSERHEAD
|
$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'}; |
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 1166 ENDMODIFYUSERHEAD
|
Line 1550 ENDMODIFYUSERHEAD
|
'mddl' => "middle", |
'mddl' => "middle", |
'lst' => "last", |
'lst' => "last", |
'gen' => "generation", |
'gen' => "generation", |
|
'mail' => "permanent e-mail", |
'disk' => "disk space allocated to portfolio files", |
'disk' => "disk space allocated to portfolio files", |
'prvs' => "Previous", |
'prvs' => "Previous", |
'chto' => "Changed To" |
'chto' => "Changed To" |
Line 1184 ENDMODIFYUSERHEAD
|
Line 1569 ENDMODIFYUSERHEAD
|
<td>$userenv{'middlename'} </td> |
<td>$userenv{'middlename'} </td> |
<td>$userenv{'lastname'} </td> |
<td>$userenv{'lastname'} </td> |
<td>$userenv{'generation'} </td> |
<td>$userenv{'generation'} </td> |
<td>$oldportfolioquota</td> |
<td>$userenv{'permanentemail'} </td> |
|
<td>$oldportfolioquota Mb</td> |
</tr> |
</tr> |
<tr><td>$lt{'chto'}</td> |
<tr><td>$lt{'chto'}</td> |
<td>$env{'form.cfirstname'} </td> |
<td>$env{'form.cfirstname'} </td> |
<td>$env{'form.cmiddlename'} </td> |
<td>$env{'form.cmiddlename'} </td> |
<td>$env{'form.clastname'} </td> |
<td>$env{'form.clastname'} </td> |
<td>$env{'form.cgeneration'} </td> |
<td>$env{'form.cgeneration'} </td> |
<td>$env{'form.portfolioquota'} Mb</td></tr> |
<td>$env{'form.cpermanentemail'} </td> |
|
<td>$newportfolioquota Mb $defquotatext </td></tr> |
</table> |
</table> |
END |
END |
|
if (($env{'form.ccdomain'} eq $env{'user.domain'}) && |
|
($env{'form.ccuname'} eq $env{'user.name'})) { |
|
my %newenvhash; |
|
foreach my $key (keys(%changeHash)) { |
|
$newenvhash{'environment.'.$key} = $changeHash{$key}; |
|
} |
|
&Apache::lonnet::appenv(%newenvhash); |
|
} |
} else { # error occurred |
} else { # error occurred |
$r->print("<h2>".&mt('Unable to successfully change environment for')." ". |
$r->print("<h2>".&mt('Unable to successfully change environment for')." ". |
$env{'form.ccuname'}." ".&mt('in domain')." ". |
$env{'form.ccuname'}." ".&mt('in domain')." ". |
Line 1212 END
|
Line 1607 END
|
'usr' => "User", |
'usr' => "User", |
'id' => "in domain", |
'id' => "in domain", |
'gen' => "Generation", |
'gen' => "Generation", |
|
'mail' => "Permanent e-mail", |
'disk' => "Disk space allocated to user's portfolio files", |
'disk' => "Disk space allocated to user's portfolio files", |
); |
); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<h2>$lt{'usr'} "$env{'form.ccuname'}" $lt{'id'} "$env{'form.ccdomain'}"</h2> |
<h2>$lt{'usr'} "$env{'form.ccuname'}" $lt{'id'} "$env{'form.ccdomain'}"</h2> |
<h4>$userenv{'firstname'} $userenv{'middlename'} $userenv{'lastname'} </h4> |
<h4>$userenv{'firstname'} $userenv{'middlename'} $userenv{'lastname'} </h4> |
<h4>$lt{'gen'}: $userenv{'generation'}</h4> |
<h4>$lt{'gen'}: $userenv{'generation'}</h4> |
|
<h4>$lt{'mail'}: $userenv{'permanentemail'}</h4> |
END |
END |
if ($putresult eq 'ok') { |
if ($putresult eq 'ok') { |
if ($oldportfolioquota ne $env{'form.portfolioquota'}) { |
if ($oldportfolioquota != $newportfolioquota) { |
$r->print('<h4>'.$lt{'disk'}.': '.$env{'form.portfolioquota'}.' Mb</h4>'); |
$r->print('<h4>'.$lt{'disk'}.': '.$newportfolioquota.' Mb '. |
|
$defquotatext.'</h4>'); |
|
&Apache::lonnet::appenv('environment.portfolioquota' => $changeHash{'portfolioquota'}); |
} |
} |
} |
} |
} |
} |
Line 1241 END
|
Line 1640 END
|
if ($2 eq 'st') { |
if ($2 eq 'st') { |
$1=~m{^/($match_domain)/($match_courseid)}; |
$1=~m{^/($match_domain)/($match_courseid)}; |
my $cid=$1.'_'.$2; |
my $cid=$1.'_'.$2; |
$r->print(&mt('Drop from classlist').': <b>'. |
my $user = $env{'form.ccuname'}.':'.$env{'form.ccdomain'}; |
&Apache::lonnet::critical('put:'. |
my $result = |
$env{'course.'.$cid.'.domain'}.':'. |
&Apache::lonnet::cput('classlist', |
$env{'course.'.$cid.'.num'}.':classlist:'. |
{ $user => $now }, |
&escape($env{'form.ccuname'}.':'. |
$env{'course.'.$cid.'.domain'}, |
$env{'form.ccdomain'}).'='. |
$env{'course.'.$cid.'.num'}); |
&escape($now.':'), |
$r->print(&mt('Drop from classlist: [_1]', |
$env{'course.'.$cid.'.home'}).'</b><br />'); |
'<b>'.$result.'</b>').'<br />'); |
} |
} |
} |
} |
if ($key=~m{^form\.rev\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
if ($key=~m{^form\.rev\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
Line 1268 END
|
Line 1667 END
|
if ($2 eq 'st') { |
if ($2 eq 'st') { |
$1=~m{^/($match_domain)/($match_courseid)}; |
$1=~m{^/($match_domain)/($match_courseid)}; |
my $cid=$1.'_'.$2; |
my $cid=$1.'_'.$2; |
$r->print(&mt('Drop from classlist').': <b>'. |
my $user = $env{'form.ccuname'}.':'.$env{'form.ccdomain'}; |
&Apache::lonnet::critical('put:'. |
my $result = |
$env{'course.'.$cid.'.domain'}.':'. |
&Apache::lonnet::cput('classlist', |
$env{'course.'.$cid.'.num'}.':classlist:'. |
{ $user => $now }, |
&escape($env{'form.ccuname'}.':'. |
$env{'course.'.$cid.'.domain'}, |
$env{'form.ccdomain'}).'='. |
$env{'course.'.$cid.'.num'}); |
&escape($now.':'), |
$r->print(&mt('Drop from classlist: [_1]', |
$env{'course.'.$cid.'.home'}).'</b><br />'); |
'<b>'.$result.'</b>').'<br />'); |
} |
} |
} |
} |
if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
if ($key=~m{^form\.del\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
Line 1443 END
|
Line 1842 END
|
# Flush the course logs so reverse user roles immediately updated |
# Flush the course logs so reverse user roles immediately updated |
&Apache::lonnet::flushcourselogs(); |
&Apache::lonnet::flushcourselogs(); |
$r->print('<p><a href="/adm/createuser">Create/Modify Another User</a></p>'); |
$r->print('<p><a href="/adm/createuser">Create/Modify Another User</a></p>'); |
|
$r->print('<form name="userupdate" method="post" />'."\n"); |
|
foreach my $item ('srchby','srchin','srchtype','srchterm','srchdomain','ccuname','ccdomain') { |
|
$r->print('<input type="hidden" name="'.$item.'" value="'.$env{'form.'.$item}.'" />'."\n"); |
|
} |
|
foreach my $item ('sortby','seluname','seludom') { |
|
if (exists($env{'form.'.$item})) { |
|
$r->print('<input type="hidden" name="'.$item.'" value="'.$env{'form.'.$item}.'" />'."\n"); |
|
} |
|
} |
|
$r->print('<input type="hidden" name="phase" value="" />'."\n". |
|
'<input type ="hidden" name="state" value="" />'."\n". |
|
'</form>'); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
|
sub quota_admin { |
|
my ($setquota,$changeHash) = @_; |
|
my $quotachanged; |
|
if (&Apache::lonnet::allowed('mpq',$env{'form.ccdomain'})) { |
|
# Current user has quota modification privileges |
|
$quotachanged = 1; |
|
$changeHash->{'portfolioquota'} = $setquota; |
|
} |
|
return $quotachanged; |
|
} |
|
|
sub build_roles { |
sub build_roles { |
my ($sectionstr,$sections,$role) = @_; |
my ($sectionstr,$sections,$role) = @_; |
my $num_sections = 0; |
my $num_sections = 0; |
Line 1458 sub build_roles {
|
Line 1880 sub build_roles {
|
} else { |
} else { |
foreach my $sec (@secnums) { |
foreach my $sec (@secnums) { |
$sec =~ ~s/\W//g; |
$sec =~ ~s/\W//g; |
unless ($sec eq "") { |
if (!($sec eq "")) { |
if (exists($$sections{$sec})) { |
if (exists($$sections{$sec})) { |
$$sections{$sec} ++; |
$$sections{$sec} ++; |
} else { |
} else { |
Line 1482 sub build_roles {
|
Line 1904 sub build_roles {
|
# ========================================================== Custom Role Editor |
# ========================================================== Custom Role Editor |
|
|
sub custom_role_editor { |
sub custom_role_editor { |
my $r=shift; |
my ($r) = @_; |
my $rolename=$env{'form.rolename'}; |
my $rolename=$env{'form.rolename'}; |
|
|
if ($rolename eq 'make new role') { |
if ($rolename eq 'make new role') { |
Line 1491 sub custom_role_editor {
|
Line 1913 sub custom_role_editor {
|
|
|
$rolename=~s/[^A-Za-z0-9]//gs; |
$rolename=~s/[^A-Za-z0-9]//gs; |
|
|
unless ($rolename) { |
if (!$rolename) { |
&print_username_entry_form($r); |
&print_username_entry_form($r); |
return; |
return; |
} |
} |
|
# ------------------------------------------------------- What can be assigned? |
$r->print(&Apache::loncommon::start_page('Custom Role Editor')); |
my %full=(); |
|
my %courselevel=(); |
|
my %courselevelcurrent=(); |
my $syspriv=''; |
my $syspriv=''; |
my $dompriv=''; |
my $dompriv=''; |
my $coursepriv=''; |
my $coursepriv=''; |
|
my $body_top; |
|
my ($disp_dummy,$disp_roles) = &Apache::lonnet::get('roles',["st"]); |
my ($rdummy,$roledef)= |
my ($rdummy,$roledef)= |
&Apache::lonnet::get('roles',["rolesdef_$rolename"]); |
&Apache::lonnet::get('roles',["rolesdef_$rolename"]); |
# ------------------------------------------------------- Does this role exist? |
# ------------------------------------------------------- Does this role exist? |
$r->print('<h2>'); |
$body_top .= '<h2>'; |
if (($rdummy ne 'con_lost') && ($roledef ne '')) { |
if (($rdummy ne 'con_lost') && ($roledef ne '')) { |
$r->print(&mt('Existing Role').' "'); |
$body_top .= &mt('Existing Role').' "'; |
# ------------------------------------------------- Get current role privileges |
# ------------------------------------------------- Get current role privileges |
($syspriv,$dompriv,$coursepriv)=split(/\_/,$roledef); |
($syspriv,$dompriv,$coursepriv)=split(/\_/,$roledef); |
} else { |
} else { |
$r->print(&mt('New Role').' "'); |
$body_top .= &mt('New Role').' "'; |
$roledef=''; |
$roledef=''; |
} |
} |
$r->print($rolename.'"</h2>'); |
$body_top .= $rolename.'"</h2>'; |
# ------------------------------------------------------- What can be assigned? |
|
my %full=(); |
|
my %courselevel=(); |
|
my %courselevelcurrent=(); |
|
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:c'})) { |
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:c'})) { |
my ($priv,$restrict)=split(/\&/,$item); |
my ($priv,$restrict)=split(/\&/,$item); |
unless ($restrict) { $restrict='F'; } |
if (!$restrict) { $restrict='F'; } |
$courselevel{$priv}=$restrict; |
$courselevel{$priv}=$restrict; |
if ($coursepriv=~/\:$priv/) { |
if ($coursepriv=~/\:$priv/) { |
$courselevelcurrent{$priv}=1; |
$courselevelcurrent{$priv}=1; |
Line 1530 sub custom_role_editor {
|
Line 1952 sub custom_role_editor {
|
my %domainlevelcurrent=(); |
my %domainlevelcurrent=(); |
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:d'})) { |
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:d'})) { |
my ($priv,$restrict)=split(/\&/,$item); |
my ($priv,$restrict)=split(/\&/,$item); |
unless ($restrict) { $restrict='F'; } |
if (!$restrict) { $restrict='F'; } |
$domainlevel{$priv}=$restrict; |
$domainlevel{$priv}=$restrict; |
if ($dompriv=~/\:$priv/) { |
if ($dompriv=~/\:$priv/) { |
$domainlevelcurrent{$priv}=1; |
$domainlevelcurrent{$priv}=1; |
Line 1541 sub custom_role_editor {
|
Line 1963 sub custom_role_editor {
|
my %systemlevelcurrent=(); |
my %systemlevelcurrent=(); |
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:s'})) { |
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:s'})) { |
my ($priv,$restrict)=split(/\&/,$item); |
my ($priv,$restrict)=split(/\&/,$item); |
unless ($restrict) { $restrict='F'; } |
if (!$restrict) { $restrict='F'; } |
$systemlevel{$priv}=$restrict; |
$systemlevel{$priv}=$restrict; |
if ($syspriv=~/\:$priv/) { |
if ($syspriv=~/\:$priv/) { |
$systemlevelcurrent{$priv}=1; |
$systemlevelcurrent{$priv}=1; |
} |
} |
$full{$priv}=1; |
$full{$priv}=1; |
} |
} |
|
my ($jsback,$elements) = &crumb_utilities(); |
|
my $button_code = "\n"; |
|
my $head_script = "\n"; |
|
$head_script .= '<script type="text/javascript">'."\n"; |
|
my @template_roles = ("cc","in","ta","ep","st"); |
|
foreach my $role (@template_roles) { |
|
$head_script .= &make_script_template($role); |
|
$button_code .= &make_button_code($role); |
|
} |
|
$head_script .= "\n".$jsback."\n".'</script>'."\n"; |
|
$r->print(&Apache::loncommon::start_page('Custom Role Editor',$head_script)); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.form1,'','')", |
|
text=>"User/custom role search", |
|
faq=>282,bug=>'Instructor Interface',}, |
|
{href=>"javascript:backPage(document.form1,'','')", |
|
text=>"Edit custom role", |
|
faq=>282,bug=>'Instructor Interface',}); |
|
$r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management')); |
|
|
|
$r->print($body_top); |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'prv' => "Privilege", |
'prv' => "Privilege", |
'crl' => "Course Level", |
'crl' => "Course Level", |
'dml' => "Domain Level", |
'dml' => "Domain Level", |
'ssl' => "System Level" |
'ssl' => "System Level"); |
); |
$r->print('Select a Template<br />'); |
|
$r->print('<form action="">'); |
|
$r->print($button_code); |
|
$r->print('</form>'); |
$r->print(<<ENDCCF); |
$r->print(<<ENDCCF); |
<form method="post"> |
<form name="form1" method="post"> |
<input type="hidden" name="phase" value="set_custom_roles" /> |
<input type="hidden" name="phase" value="set_custom_roles" /> |
<input type="hidden" name="rolename" value="$rolename" /> |
<input type="hidden" name="rolename" value="$rolename" /> |
ENDCCF |
ENDCCF |
Line 1568 ENDCCF
|
Line 2014 ENDCCF
|
my $privtext = &Apache::lonnet::plaintext($priv); |
my $privtext = &Apache::lonnet::plaintext($priv); |
$r->print(&Apache::loncommon::start_data_table_row(). |
$r->print(&Apache::loncommon::start_data_table_row(). |
'<td>'.$privtext.'</td><td>'. |
'<td>'.$privtext.'</td><td>'. |
($courselevel{$priv}?'<input type="checkbox" name="'.$priv.':c" '. |
($courselevel{$priv}?'<input type="checkbox" name="'.$priv.'_c" '. |
($courselevelcurrent{$priv}?'checked="1"':'').' />':' '). |
($courselevelcurrent{$priv}?'checked="1"':'').' />':' '). |
'</td><td>'. |
'</td><td>'. |
($domainlevel{$priv}?'<input type="checkbox" name="'.$priv.':d" '. |
($domainlevel{$priv}?'<input type="checkbox" name="'.$priv.'_d" '. |
($domainlevelcurrent{$priv}?'checked="1"':'').' />':' '). |
($domainlevelcurrent{$priv}?'checked="1"':'').' />':' '). |
'</td><td>'. |
'</td><td>'. |
($systemlevel{$priv}?'<input type="checkbox" name="'.$priv.':s" '. |
($systemlevel{$priv}?'<input type="checkbox" name="'.$priv.'_s" '. |
($systemlevelcurrent{$priv}?'checked="1"':'').' />':' '). |
($systemlevelcurrent{$priv}?'checked="1"':'').' />':' '). |
'</td>'. |
'</td>'. |
&Apache::loncommon::end_data_table_row()); |
&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print(&Apache::loncommon::end_data_table(). |
$r->print(&Apache::loncommon::end_data_table(). |
|
'<input type="hidden" name="startrolename" value="'.$env{'form.rolename'}. |
|
'" />'."\n".'<input type="hidden" name="state" value="" />'."\n". |
|
'<input type="reset" value="'.&mt("Reset").'" />'."\n". |
'<input type="submit" value="'.&mt('Define Role').'" /></form>'. |
'<input type="submit" value="'.&mt('Define Role').'" /></form>'. |
&Apache::loncommon::end_page()); |
&Apache::loncommon::end_page()); |
} |
} |
|
# -------------------------------------------------------- |
|
sub make_script_template { |
|
my ($role) = @_; |
|
my %full_c=(); |
|
my %full_d=(); |
|
my %full_s=(); |
|
my $return_script; |
|
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:c'})) { |
|
my ($priv,$restrict)=split(/\&/,$item); |
|
$full_c{$priv}=1; |
|
} |
|
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:d'})) { |
|
my ($priv,$restrict)=split(/\&/,$item); |
|
$full_d{$priv}=1; |
|
} |
|
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:s'})) { |
|
my ($priv,$restrict)=split(/\&/,$item); |
|
$full_s{$priv}=1; |
|
} |
|
$return_script .= 'function set_'.$role.'() {'."\n"; |
|
my @temp = split(/:/,$Apache::lonnet::pr{$role.':c'}); |
|
my %role_c; |
|
foreach my $priv (@temp) { |
|
my ($priv_item, $dummy) = split(/\&/,$priv); |
|
$role_c{$priv_item} = 1; |
|
} |
|
foreach my $priv_item (keys(%full_c)) { |
|
my ($priv, $dummy) = split(/\&/,$priv_item); |
|
if (exists($role_c{$priv})) { |
|
$return_script .= "document.form1.$priv"."_c.checked = true;\n"; |
|
} else { |
|
$return_script .= "document.form1.$priv"."_c.checked = false;\n"; |
|
} |
|
} |
|
my %role_d; |
|
@temp = split(/:/,$Apache::lonnet::pr{$role.':d'}); |
|
foreach my $priv(@temp) { |
|
my ($priv_item, $dummy) = split(/\&/,$priv); |
|
$role_d{$priv_item} = 1; |
|
} |
|
foreach my $priv_item (keys(%full_d)) { |
|
my ($priv, $dummy) = split(/\&/,$priv_item); |
|
if (exists($role_d{$priv})) { |
|
$return_script .= "document.form1.$priv"."_d.checked = true;\n"; |
|
} else { |
|
$return_script .= "document.form1.$priv"."_d.checked = false;\n"; |
|
} |
|
} |
|
my %role_s; |
|
@temp = split(/:/,$Apache::lonnet::pr{$role.':s'}); |
|
foreach my $priv(@temp) { |
|
my ($priv_item, $dummy) = split(/\&/,$priv); |
|
$role_s{$priv_item} = 1; |
|
} |
|
foreach my $priv_item (keys(%full_s)) { |
|
my ($priv, $dummy) = split(/\&/,$priv_item); |
|
if (exists($role_s{$priv})) { |
|
$return_script .= "document.form1.$priv"."_s.checked = true;\n"; |
|
} else { |
|
$return_script .= "document.form1.$priv"."_s.checked = false;\n"; |
|
} |
|
} |
|
$return_script .= '}'."\n"; |
|
return ($return_script); |
|
} |
|
# ---------------------------------------------------------- |
|
sub make_button_code { |
|
my ($role) = @_; |
|
my $label = &Apache::lonnet::plaintext($role); |
|
my $button_code = '<input type="button" onClick="set_'.$role.'()" value="'.$label.'" />'; |
|
return ($button_code); |
|
} |
# ---------------------------------------------------------- Call to definerole |
# ---------------------------------------------------------- Call to definerole |
sub set_custom_role { |
sub set_custom_role { |
my ($r) = @_; |
my ($r) = @_; |
Line 1592 sub set_custom_role {
|
Line 2112 sub set_custom_role {
|
|
|
$rolename=~s/[^A-Za-z0-9]//gs; |
$rolename=~s/[^A-Za-z0-9]//gs; |
|
|
unless ($rolename) { |
if (!$rolename) { |
&print_username_entry_form($r); |
&print_username_entry_form($r); |
return; |
return; |
} |
} |
|
|
$r->print(&Apache::loncommon::start_page('Save Custom Role').'<h2>'); |
my ($jsback,$elements) = &crumb_utilities(); |
|
my $jscript = '<script type="text/javascript">'.$jsback."\n".'</script>'; |
|
|
|
$r->print(&Apache::loncommon::start_page('Save Custom Role'),$jscript); |
|
&Apache::lonhtmlcommon::add_breadcrumb |
|
({href=>"javascript:backPage(document.customresult,'','')", |
|
text=>"User/custom role search", |
|
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('User Management')); |
|
|
my ($rdummy,$roledef)= |
my ($rdummy,$roledef)= |
&Apache::lonnet::get('roles',["rolesdef_$rolename"]); |
&Apache::lonnet::get('roles',["rolesdef_$rolename"]); |
|
|
# ------------------------------------------------------- Does this role exist? |
# ------------------------------------------------------- Does this role exist? |
|
$r->print('<h2>'); |
if (($rdummy ne 'con_lost') && ($roledef ne '')) { |
if (($rdummy ne 'con_lost') && ($roledef ne '')) { |
$r->print(&mt('Existing Role').' "'); |
$r->print(&mt('Existing Role').' "'); |
} else { |
} else { |
Line 1616 sub set_custom_role {
|
Line 2152 sub set_custom_role {
|
|
|
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:c'})) { |
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:c'})) { |
my ($priv,$restrict)=split(/\&/,$item); |
my ($priv,$restrict)=split(/\&/,$item); |
unless ($restrict) { $restrict=''; } |
if (!$restrict) { $restrict=''; } |
if ($env{'form.'.$priv.':c'}) { |
if ($env{'form.'.$priv.'_c'}) { |
$courole.=':'.$item; |
$courole.=':'.$item; |
} |
} |
} |
} |
|
|
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:d'})) { |
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:d'})) { |
my ($priv,$restrict)=split(/\&/,$item); |
my ($priv,$restrict)=split(/\&/,$item); |
unless ($restrict) { $restrict=''; } |
if (!$restrict) { $restrict=''; } |
if ($env{'form.'.$priv.':d'}) { |
if ($env{'form.'.$priv.'_d'}) { |
$domrole.=':'.$item; |
$domrole.=':'.$item; |
} |
} |
} |
} |
|
|
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:s'})) { |
foreach my $item (split(/\:/,$Apache::lonnet::pr{'cr:s'})) { |
my ($priv,$restrict)=split(/\&/,$item); |
my ($priv,$restrict)=split(/\&/,$item); |
unless ($restrict) { $restrict=''; } |
if (!$restrict) { $restrict=''; } |
if ($env{'form.'.$priv.':s'}) { |
if ($env{'form.'.$priv.'_s'}) { |
$sysrole.=':'.$item; |
$sysrole.=':'.$item; |
} |
} |
} |
} |
Line 1650 sub set_custom_role {
|
Line 2186 sub set_custom_role {
|
$env{'user.name'}, |
$env{'user.name'}, |
$rolename)); |
$rolename)); |
} |
} |
$r->print('<p><a href="/adm/createuser">Create another role, or Create/Modify a user.</a></p>'); |
$r->print('<p><a href="/adm/createuser">Create another role, or Create/Modify a user.</a></p><form name="customresult" method="post">'); |
|
$r->print(&Apache::lonhtmlcommon::echo_form_input([]).'</form>'); |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
} |
} |
|
|
Line 1672 sub handler {
|
Line 2209 sub handler {
|
(&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))) { |
(&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
unless ($env{'form.phase'}) { |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&print_username_entry_form($r); |
|
} |
my $phase = $env{'form.phase'}; |
if ($env{'form.phase'} eq 'get_user_info') { |
my @search = ('srchterm','srchby','srchin','srchtype','srchdomain'); |
&print_user_modification_page($r); |
|
|
if (($phase eq 'get_user_info') || ($phase eq 'userpicked')) { |
|
my $srch; |
|
foreach my $item (@search) { |
|
$srch->{$item} = $env{'form.'.$item}; |
|
} |
|
if ($env{'form.phase'} eq 'get_user_info') { |
|
my ($state,$response,$forcenewuser,$results) = |
|
&user_search_result($srch); |
|
if ($state eq 'select') { |
|
&print_user_selection_page($r,$response,$srch,$results); |
|
} elsif ($state eq 'modify') { |
|
my ($ccuname,$ccdomain); |
|
if ($srch->{'srchby'} eq 'uname') { |
|
$ccuname = $srch->{'srchterm'}; |
|
$ccdomain= $srch->{'srchdomain'}; |
|
} else { |
|
my @matchedunames = keys(%{$results}); |
|
($ccuname,$ccdomain) = split(/:/,$matchedunames[0]); |
|
} |
|
$ccuname =&LONCAPA::clean_username($ccuname); |
|
$ccdomain=&LONCAPA::clean_domain($ccdomain); |
|
&print_user_modification_page($r,$ccuname,$ccdomain,$srch, |
|
$response); |
|
} elsif ($state eq 'query') { |
|
&print_user_query_page($r); |
|
} else { |
|
&print_username_entry_form($r,$response,$srch,$forcenewuser); |
|
} |
|
} elsif ($env{'form.phase'} eq 'userpicked') { |
|
my $ccuname = &LONCAPA::clean_username($env{'form.seluname'}); |
|
my $ccdomain = &LONCAPA::clean_domain($env{'form.seludom'}); |
|
&print_user_modification_page($r,$ccuname,$ccdomain,$srch); |
|
} |
} elsif ($env{'form.phase'} eq 'update_user_data') { |
} elsif ($env{'form.phase'} eq 'update_user_data') { |
&update_user_data($r); |
&update_user_data($r); |
} elsif ($env{'form.phase'} eq 'selected_custom_edit') { |
} elsif ($env{'form.phase'} eq 'selected_custom_edit') { |
&custom_role_editor($r); |
&custom_role_editor($r); |
} elsif ($env{'form.phase'} eq 'set_custom_roles') { |
} elsif ($env{'form.phase'} eq 'set_custom_roles') { |
&set_custom_role($r); |
&set_custom_role($r); |
|
} else { |
|
&print_username_entry_form($r); |
} |
} |
} else { |
} else { |
$env{'user.error.msg'}= |
$env{'user.error.msg'}= |
Line 1690 sub handler {
|
Line 2262 sub handler {
|
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
return OK; |
return OK; |
} |
} |
|
|
#-------------------------------------------------- functions for &phase_two |
#-------------------------------------------------- functions for &phase_two |
|
sub user_search_result { |
|
my ($srch) = @_; |
|
my @alldomains = sort(&Apache::lonnet::all_domains()); |
|
my %allhomes; |
|
my %inst_matches; |
|
my %srch_results; |
|
my ($response,$state,$forcenewuser); |
|
|
|
if ($srch->{'srchby'} !~ /^(uname|lastname|lastfirst)$/) { |
|
$response = &mt('Invalid search.'); |
|
} |
|
if ($srch->{'srchin'} !~ /^(crs|dom|alc|instd)$/) { |
|
$response = &mt('Invalid search.'); |
|
} |
|
if ($srch->{'srchtype'} !~ /^(exact|contains)$/) { |
|
$response = &mt('Invalid search.'); |
|
} |
|
if ($srch->{'srchterm'} eq '') { |
|
$response = &mt('You must enter a search term.'); |
|
} |
|
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'instd')) { |
|
if (($srch->{'srchdomain'} eq '') || |
|
(!(grep/^\Q$srch->{'srchdomain'}\E$/,@alldomains))) { |
|
$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') || |
|
($srch->{'srchin'} eq 'alc')) { |
|
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') { |
|
my $instd_chk = &directorysrch_check($srch); |
|
if ($instd_chk ne 'ok') { |
|
$response = $instd_chk; |
|
} |
|
} |
|
if ($response ne '') { |
|
return ($state,$response); |
|
} |
|
if ($srch->{'srchby'} eq 'uname') { |
|
if (($srch->{'srchin'} eq 'dom') || ($srch->{'srchin'} eq 'crs')) { |
|
if ($env{'form.forcenew'}) { |
|
if ($srch->{'srchdomain'} ne $env{'request.role.domain'}) { |
|
my $uhome=&Apache::lonnet::homeserver($srch->{'srchterm'},$srch->{'srchdomain'}); |
|
if ($uhome eq 'no_host') { |
|
my $domdesc = &Apache::lonnet::domain($env{'request.role.domain'},'description'); |
|
$response = &mt('New users can only be created in the domain to which you current role belongs - [_1].',$env{'request.role.domain'}.' ('.$domdesc.')'); |
|
} else { |
|
$state = 'modify'; |
|
} |
|
} else { |
|
$state = 'modify'; |
|
} |
|
} else { |
|
if ($srch->{'srchin'} eq 'dom') { |
|
my $uhome=&Apache::lonnet::homeserver($srch->{'srchterm'},$srch->{'srchdomain'}); |
|
if ($uhome eq 'no_host') { |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} else { |
|
$state = 'modify'; |
|
} |
|
} else { |
|
my %courseusers = &get_courseusers(); |
|
if (exists($courseusers{$srch->{'srchterm'}.':'.$srch->{'srchdomain'}})) { |
|
$state = 'modify'; |
|
} else { |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} |
|
} |
|
} |
|
} elsif ($srch->{'srchin'} eq 'alc') { |
|
$state = 'query'; |
|
} elsif ($srch->{'srchin'} eq 'instd') { |
|
%srch_results = &Apache::lonnet::inst_directory_query($srch); |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} |
|
} else { |
|
if ($srch->{'srchin'} eq 'dom') { |
|
%srch_results = &Apache::lonnet::usersearch($srch); |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} elsif ($srch->{'srchin'} eq 'crs') { |
|
my %courseusers = &get_courseusers(); |
|
foreach my $user (keys(%courseusers)) { |
|
my ($uname,$udom) = split(/:/,$user); |
|
my %names = &Apache::loncommon::getnames($uname,$udom); |
|
my %emails = &Apache::loncommon::getemails($uname,$udom); |
|
if ($srch->{'srchby'} eq 'lastname') { |
|
if ((($srch->{'srchtype'} eq 'exact') && |
|
($names{'lastname'} eq $srch->{'srchterm'})) || |
|
(($srch->{'srchtype'} eq 'contains') && |
|
($names{'lastname'} =~ /\Q$srch->{'srchterm'}\E/i))) { |
|
$srch_results{$user} = {firstname => $names{'firstname'}, |
|
lastname => $names{'lastname'}, |
|
permanentemail => $emails{'permanentemail'}, |
|
}; |
|
} |
|
} elsif ($srch->{'srchby'} eq 'lastfirst') { |
|
my ($srchlast,$srchfirst) = split(/,/,$srch->{'srchterm'}); |
|
if ($srch->{'srchtype'} eq 'exact') { |
|
if (($names{'lastname'} eq $srchlast) && |
|
($names{'firstname'} eq $srchfirst)) { |
|
$srch_results{$user} = {firstname => $names{'firstname'}, |
|
lastname => $names{'lastname'}, |
|
permanentemail => $emails{'permanentemail'}, |
|
|
|
}; |
|
} |
|
} elsif ($srch->{'srchtype'} eq 'contains') { |
|
if (($names{'lastname'} =~ /\Q$srchlast\E/i) && |
|
($names{'firstname'} =~ /\Q$srchfirst\E/i)) { |
|
$srch_results{$user} = {firstname => $names{'firstname'}, |
|
lastname => $names{'lastname'}, |
|
permanentemail => $emails{'permanentemail'}, |
|
}; |
|
} |
|
} |
|
} |
|
} |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} elsif ($srch->{'srchin'} eq 'alc') { |
|
$state = 'query'; |
|
} elsif ($srch->{'srchin'} eq 'instd') { |
|
%srch_results = &Apache::lonnet::inst_directory_query($srch); |
|
($state,$response,$forcenewuser) = |
|
&build_search_response($srch,%srch_results); |
|
} |
|
} |
|
return ($state,$response,$forcenewuser,\%srch_results); |
|
} |
|
|
|
sub directorysrch_check { |
|
my ($srch) = @_; |
|
my $can_search = 0; |
|
my $response; |
|
my %dom_inst_srch = &Apache::lonnet::get_dom('configuration', |
|
['directorysrch'],$srch->{'srchdomain'}); |
|
if (ref($dom_inst_srch{'directorysrch'}) eq 'HASH') { |
|
if (!$dom_inst_srch{'directorysrch'}{'available'}) { |
|
return &mt('Directory search unavailable in domain: [_1]',$srch->{'srchdomain'}); |
|
} |
|
if ($dom_inst_srch{'directorysrch'}{'localonly'}) { |
|
if ($env{'request.role.domain'} ne $srch->{'srchdomain'}) { |
|
return &mt('Directory search in domain: [_1] is only allowed for users with a current role in the domain.',$srch->{'srchdomain'}); |
|
} |
|
my @usertypes = split(/:/,$env{'environment.inststatus'}); |
|
if (!@usertypes) { |
|
push(@usertypes,'default'); |
|
} |
|
if (ref($dom_inst_srch{'directorysrch'}{'cansearch'}) eq 'ARRAY') { |
|
foreach my $type (@usertypes) { |
|
if (grep(/^\Q$type\E$/,@{$dom_inst_srch{'directorysrch'}{'cansearch'}})) { |
|
$can_search = 1; |
|
last; |
|
} |
|
} |
|
} |
|
if (!$can_search) { |
|
my ($insttypes,$order) = &Apache::lonnet::retrieve_inst_usertypes($srch->{'srchdomain'}); |
|
my @longtypes; |
|
foreach my $item (@usertypes) { |
|
push (@longtypes,$insttypes->{$item}); |
|
} |
|
my $insttype_str = join(', ',@longtypes); |
|
return &mt('Directory search in domain: [_1] is unavailable to your user type: ',$srch->{'srchdomain'}).$insttype_str; |
|
} |
|
} else { |
|
$can_search = 1; |
|
} |
|
} else { |
|
return &mt('Directory search has not been configured for domain: [_1]',$srch->{'srchdomain'}); |
|
} |
|
my %longtext = &Apache::lonlocal::texthash ( |
|
uname => 'username', |
|
lastfirst => 'last name, first name', |
|
lastname => 'last name', |
|
contains => 'is contained in', |
|
exact => 'as exact match to' |
|
); |
|
if ($can_search) { |
|
if (ref($dom_inst_srch{'directorysrch'}{'searchby'}) eq 'ARRAY') { |
|
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'}}); |
|
} |
|
} else { |
|
return &mt('Directory search in domain: [_1] is not available.', $srch->{'srchdomain'}); |
|
} |
|
} |
|
if ($can_search) { |
|
if (($dom_inst_srch{'directorysrch'}{'searchtypes'} eq 'specify') || |
|
($dom_inst_srch{'directorysrch'}{'searchtypes'} eq $srch->{'srchtype'})) { |
|
return 'ok'; |
|
} else { |
|
return &mt('Directory search in domain [_1] is not available for the requested search type: [_2]',$srch->{'srchdomain'},$longtext{$srch->{'srchtype'}}); |
|
} |
|
} |
|
} |
|
|
|
|
|
sub get_courseusers { |
|
my %advhash; |
|
my %coursepersonnel=&Apache::lonnet::get_course_adv_roles(); |
|
foreach my $role (sort(keys(%coursepersonnel))) { |
|
foreach my $user (split(/\,/,$coursepersonnel{$role})) { |
|
$advhash{$user} = ''; |
|
} |
|
} |
|
my $classlist = &Apache::loncoursedata::get_classlist(); |
|
my %combined = (%advhash, %{$classlist}); |
|
return %combined; |
|
} |
|
|
|
sub build_search_response { |
|
my ($srch,%srch_results) = @_; |
|
my ($state,$response,$forcenewuser); |
|
my %names = ( |
|
'uname' => 'username', |
|
'lastname' => 'last name', |
|
'lastfirst' => 'last name, first name', |
|
'crs' => 'this course', |
|
'dom' => 'this domain', |
|
'instd' => "your institution's directory", |
|
); |
|
|
|
my %single = ( |
|
contains => 'A match', |
|
exact => 'An exact match', |
|
); |
|
my %nomatch = ( |
|
contains => 'No match', |
|
exact => 'No exact match', |
|
); |
|
if (keys(%srch_results) > 1) { |
|
$state = 'select'; |
|
} else { |
|
if (keys(%srch_results) == 1) { |
|
$state = 'modify'; |
|
$response = &mt("$single{$srch->{'srchtype'}} was found for this $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'}); |
|
} else { |
|
$response = &mt("$nomatch{$srch->{'srchtype'}} found for this $names{$srch->{'srchby'}} ([_1]) in $names{$srch->{'srchin'}}.",$srch->{'srchterm'}); |
|
if ($srch->{'srchin'} ne 'alc') { |
|
$forcenewuser = 1; |
|
my $cansrchinst = 0; |
|
if ($srch->{'srchdomain'}) { |
|
my %domconfig = &Apache::lonnet::get_dom('configuration',['directorysrch'],$srch->{'srchdomain'}); |
|
if (ref($domconfig{'directorysrch'}) eq 'HASH') { |
|
if ($domconfig{'directorysrch'}{'available'}) { |
|
$cansrchinst = 1; |
|
} |
|
} |
|
} |
|
if (($srch->{'srchby'} eq 'lastfirst') || |
|
($srch->{'srchby'} eq 'lastname')) { |
|
if ($srch->{'srchin'} eq 'crs') { |
|
$response .= '<br />'.&mt('You may want to broaden your search to the whole domain.'); |
|
} elsif ($srch->{'srchin'} eq 'dom') { |
|
if ($cansrchinst) { |
|
$response .= '<br />'.&mt('You may want to broaden your search to a search of the institutional directory for this domain.'); |
|
} |
|
} |
|
} |
|
$response .= '<br />'.&mt("To add as a new user:").'<ul><li>'.&mt("Enter the proposed username in the <i>'Search for'</i> box").'</li><li>'.&mt("Set <i>'Make new user if no match found</i>' to <b>Yes</b>").'</li><li>'.&mt("Click <i>'Search'</i>").'</li></ul>'.&mt("Note: you can only create new users in the domain of your current role -".$env{'request.role.domain'}).'<br /><br />'; |
|
} |
|
} |
|
} |
|
return ($state,$response,$forcenewuser); |
|
} |
|
|
|
sub crumb_utilities { |
|
my %elements = ( |
|
crtuser => { |
|
srchterm => 'text', |
|
srchin => 'selectbox', |
|
srchby => 'selectbox', |
|
srchtype => 'selectbox', |
|
srchdomain => 'selectbox', |
|
}, |
|
docustom => { |
|
rolename => 'selectbox', |
|
newrolename => 'textbox', |
|
}, |
|
); |
|
|
|
my $jsback .= qq| |
|
function backPage(formname,prevphase,prevstate) { |
|
formname.phase.value = prevphase; |
|
formname.state.value = prevstate; |
|
formname.submit(); |
|
} |
|
|; |
|
return ($jsback,\%elements); |
|
} |
|
|
sub course_level_table { |
sub course_level_table { |
my (%inccourses) = @_; |
my (%inccourses) = @_; |
my $table = ''; |
my $table = ''; |
Line 1732 sub course_level_table {
|
Line 2603 sub course_level_table {
|
if (&Apache::lonnet::allowed('c'.$role,$thiscourse)) { |
if (&Apache::lonnet::allowed('c'.$role,$thiscourse)) { |
my $plrole=&Apache::lonnet::plaintext($role); |
my $plrole=&Apache::lonnet::plaintext($role); |
$table .= &Apache::loncommon::start_data_table_row(). |
$table .= &Apache::loncommon::start_data_table_row(). |
'<td><input type="checkbox" name="act_'.$protectedcourse.'_'.$role.'"></td> |
'<td><input type="checkbox" name="act_'.$protectedcourse.'_'.$role.'" /></td> |
<td>'.$plrole.'</td> |
<td>'.$plrole.'</td> |
<td>'.$area.'<br />Domain: '.$domain.'</td>'."\n"; |
<td>'.$area.'<br />Domain: '.$domain.'</td>'."\n"; |
if ($role ne 'cc') { |
if ($role ne 'cc') { |
Line 1745 sub course_level_table {
|
Line 2616 sub course_level_table {
|
$currsec.'</td>'. |
$currsec.'</td>'. |
'<td> </td>'. |
'<td> </td>'. |
'<td valign="top"> '.$lt{'new'}.'<br />'. |
'<td valign="top"> '.$lt{'new'}.'<br />'. |
'<input type="text" name="newsec_'.$protectedcourse.'_'.$role.'" value="" /></td>'. |
'<input type="text" name="newsec_'.$protectedcourse.'_'.$role.'" value="" />'. |
'<input type="hidden" '. |
'<input type="hidden" '. |
'name="sec_'.$protectedcourse.'_'.$role.'"></td>'. |
'name="sec_'.$protectedcourse.'_'.$role.'" /></td>'. |
'</tr></table></td>'; |
'</tr></table></td>'; |
} else { |
} else { |
$table .= '<td><input type="text" size="10" '. |
$table .= '<td><input type="text" size="10" '. |
'name="sec_'.$protectedcourse.'_'.$role.'"></td>'; |
'name="sec_'.$protectedcourse.'_'.$role.'" /></td>'; |
} |
} |
} else { |
} else { |
$table .= '<td> </td>'; |
$table .= '<td> </td>'; |
} |
} |
$table .= <<ENDTIMEENTRY; |
$table .= <<ENDTIMEENTRY; |
<td><input type=hidden name="start_$protectedcourse\_$role" value=''> |
<td><input type=hidden name="start_$protectedcourse\_$role" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$role.value,'start_$protectedcourse\_$role','cu.pres','dateset')">$lt{'ssd'}</a></td> |
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$role.value,'start_$protectedcourse\_$role','cu.pres','dateset')">$lt{'ssd'}</a></td> |
<td><input type=hidden name="end_$protectedcourse\_$role" value=''> |
<td><input type=hidden name="end_$protectedcourse\_$role" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$role.value,'end_$protectedcourse\_$role','cu.pres','dateset')">$lt{'sed'}</a></td> |
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$role.value,'end_$protectedcourse\_$role','cu.pres','dateset')">$lt{'sed'}</a></td> |
ENDTIMEENTRY |
ENDTIMEENTRY |
Line 1773 ENDTIMEENTRY
|
Line 2644 ENDTIMEENTRY
|
my $customrole=$protectedcourse.'_cr_cr_'.$env{'user.domain'}. |
my $customrole=$protectedcourse.'_cr_cr_'.$env{'user.domain'}. |
'_'.$env{'user.name'}.'_'.$plrole; |
'_'.$env{'user.name'}.'_'.$plrole; |
$table .= &Apache::loncommon::start_data_table_row(). |
$table .= &Apache::loncommon::start_data_table_row(). |
'<td><input type="checkbox" name="act_'.$customrole.'"></td> |
'<td><input type="checkbox" name="act_'.$customrole.'" /></td> |
<td>'.$plrole.'</td> |
<td>'.$plrole.'</td> |
<td>'.$area.'</td>'."\n"; |
<td>'.$area.'</td>'."\n"; |
if (%sections_count) { |
if (%sections_count) { |
Line 1786 ENDTIMEENTRY
|
Line 2657 ENDTIMEENTRY
|
'<td valign="top"> '.$lt{'new'}.'<br />'. |
'<td valign="top"> '.$lt{'new'}.'<br />'. |
'<input type="text" name="newsec_'.$customrole.'" value="" /></td>'. |
'<input type="text" name="newsec_'.$customrole.'" value="" /></td>'. |
'<input type="hidden" '. |
'<input type="hidden" '. |
'name="sec_'.$customrole.'"></td>'. |
'name="sec_'.$customrole.'" /></td>'. |
'</tr></table></td>'; |
'</tr></table></td>'; |
} else { |
} else { |
$table .= '<td><input type="text" size="10" '. |
$table .= '<td><input type="text" size="10" '. |
'name="sec_'.$customrole.'"></td>'; |
'name="sec_'.$customrole.'" /></td>'; |
} |
} |
$table .= <<ENDENTRY; |
$table .= <<ENDENTRY; |
<td><input type=hidden name="start_$customrole" value=''> |
<td><input type=hidden name="start_$customrole" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$customrole.value,'start_$customrole','cu.pres','dateset')">$lt{'ssd'}</a></td> |
"javascript:pjump('date_start','Start Date $plrole',document.cu.start_$customrole.value,'start_$customrole','cu.pres','dateset')">$lt{'ssd'}</a></td> |
<td><input type=hidden name="end_$customrole" value=''> |
<td><input type=hidden name="end_$customrole" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$customrole.value,'end_$customrole','cu.pres','dateset')">$lt{'sed'}</a></td> |
"javascript:pjump('date_end','End Date $plrole',document.cu.end_$customrole.value,'end_$customrole','cu.pres','dateset')">$lt{'sed'}</a></td> |
ENDENTRY |
ENDENTRY |
Line 1813 ENDENTRY
|
Line 2684 ENDENTRY
|
'<th>'.$lt{'act'}.'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'ext'}.'</th> |
'<th>'.$lt{'act'}.'</th><th>'.$lt{'rol'}.'</th><th>'.$lt{'ext'}.'</th> |
<th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'. |
<th>'.$lt{'grs'}.'</th><th>'.$lt{'sta'}.'</th><th>'.$lt{'end'}.'</th>'. |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::end_data_table_header_row(). |
&Apache::loncommon::start_data_table_row(). |
|
$table. |
$table. |
&Apache::loncommon::end_data_table_row(). |
|
&Apache::loncommon::end_data_table(); |
&Apache::loncommon::end_data_table(); |
return $result; |
return $result; |
} |
} |
Line 1890 sub course_level_dc {
|
Line 2759 sub course_level_dc {
|
'<input type="hidden" name="groups" value="" /></td>'. |
'<input type="hidden" name="groups" value="" /></td>'. |
'</tr></table></td>'; |
'</tr></table></td>'; |
$otheritems .= <<ENDTIMEENTRY; |
$otheritems .= <<ENDTIMEENTRY; |
<td><input type=hidden name="start" value=''> |
<td><input type=hidden name="start" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_start','Start Date',document.cu.start.value,'start','cu.pres','dateset')">$lt{'ssd'}</a></td> |
"javascript:pjump('date_start','Start Date',document.cu.start.value,'start','cu.pres','dateset')">$lt{'ssd'}</a></td> |
<td><input type=hidden name="end" value=''> |
<td><input type=hidden name="end" value='' /> |
<a href= |
<a href= |
"javascript:pjump('date_end','End Date',document.cu.end.value,'end','cu.pres','dateset')">$lt{'sed'}</a></td> |
"javascript:pjump('date_end','End Date',document.cu.end.value,'end','cu.pres','dateset')">$lt{'sed'}</a></td> |
ENDTIMEENTRY |
ENDTIMEENTRY |