version 1.383, 2013/12/17 06:41:44
|
version 1.390, 2014/02/11 17:34:41
|
Line 126 sub user_quotas {
|
Line 126 sub user_quotas {
|
my ($ccuname,$ccdomain) = @_; |
my ($ccuname,$ccdomain) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'usrt' => "User Tools", |
'usrt' => "User Tools", |
'cuqu' => "Current quota", |
|
'cust' => "Custom quota", |
'cust' => "Custom quota", |
'defa' => "Default", |
|
'chqu' => "Change quota", |
'chqu' => "Change quota", |
); |
); |
|
|
Line 168 END_SCRIPT
|
Line 166 END_SCRIPT
|
|
|
my %titles = &Apache::lonlocal::texthash ( |
my %titles = &Apache::lonlocal::texthash ( |
portfolio => "Disk space allocated to user's portfolio files", |
portfolio => "Disk space allocated to user's portfolio files", |
author => "Disk space allocated to user's authoring space (if role assigned)", |
author => "Disk space allocated to user's Authoring Space (if role assigned)", |
); |
); |
foreach my $name ('portfolio','author') { |
foreach my $name ('portfolio','author') { |
my ($currquota,$quotatype,$inststatus,$defquota) = |
my ($currquota,$quotatype,$inststatus,$defquota) = |
Line 211 END_SCRIPT
|
Line 209 END_SCRIPT
|
' <td>'.$titles{$name}.'</td>'."\n". |
' <td>'.$titles{$name}.'</td>'."\n". |
' </tr>'."\n". |
' </tr>'."\n". |
&Apache::loncommon::start_data_table_row()."\n". |
&Apache::loncommon::start_data_table_row()."\n". |
' <td>'.$lt{'cuqu'}.': '. |
' <td><span class="LC_nobreak">'. |
$currquota.' MB. '. |
&mt('Current quota: [_1] MB',$currquota).'</span> '. |
$defaultinfo.'</td>'."\n". |
$defaultinfo.'</td>'."\n". |
&Apache::loncommon::end_data_table_row()."\n". |
&Apache::loncommon::end_data_table_row()."\n". |
&Apache::loncommon::start_data_table_row()."\n". |
&Apache::loncommon::start_data_table_row()."\n". |
Line 220 END_SCRIPT
|
Line 218 END_SCRIPT
|
': <label>'. |
': <label>'. |
'<input type="radio" name="custom_'.$name.'quota" id="custom_'.$name.'quota_off" '. |
'<input type="radio" name="custom_'.$name.'quota" id="custom_'.$name.'quota_off" '. |
'value="0" '.$custom_off.' onchange="javascript:quota_changes('."'custom','$name'".');"'. |
'value="0" '.$custom_off.' onchange="javascript:quota_changes('."'custom','$name'".');"'. |
' />'.$lt{'defa'}.' ('.$defquota.' MB).</label> '. |
' /><span class="LC_nobreak">'. |
|
&mt('Default ([_1] MB)',$defquota).'</span></label> '. |
' <label><input type="radio" name="custom_'.$name.'quota" id="custom_'.$name.'quota_on" '. |
' <label><input type="radio" name="custom_'.$name.'quota" id="custom_'.$name.'quota_on" '. |
'value="1" '.$custom_on.' onchange="javascript:quota_changes('."'custom','$name'".');"'. |
'value="1" '.$custom_on.' onchange="javascript:quota_changes('."'custom','$name'".');"'. |
' />'.$lt{'cust'}.':</label> '. |
' />'.$lt{'cust'}.':</label> '. |
'<input type="text" name="'.$name.'quota" id="'.$name.'quota" size ="5" '. |
'<input type="text" name="'.$name.'quota" id="'.$name.'quota" size ="5" '. |
'value="'.$showquota.'" onfocus="javascript:quota_changes('."'quota','$name'".');"'. |
'value="'.$showquota.'" onfocus="javascript:quota_changes('."'quota','$name'".');"'. |
' /> MB</span></td>'."\n". |
' /> '.&mt('MB').'</span></td>'."\n". |
&Apache::loncommon::end_data_table_row()."\n"; |
&Apache::loncommon::end_data_table_row()."\n"; |
} |
} |
} |
} |
Line 241 sub build_tools_display {
|
Line 240 sub build_tools_display {
|
my %lt = &Apache::lonlocal::texthash ( |
my %lt = &Apache::lonlocal::texthash ( |
'blog' => "Personal User Blog", |
'blog' => "Personal User Blog", |
'aboutme' => "Personal Information Page", |
'aboutme' => "Personal Information Page", |
'webdav' => "WebDAV access to authoring spaces (if SSL and author/co-author)", |
'webdav' => "WebDAV access to Authoring Spaces (if SSL and author/co-author)", |
'portfolio' => "Personal User Portfolio", |
'portfolio' => "Personal User Portfolio", |
'avai' => "Available", |
'avai' => "Available", |
'cusa' => "availability", |
'cusa' => "availability", |
Line 251 sub build_tools_display {
|
Line 250 sub build_tools_display {
|
'official' => 'Can request creation of official courses', |
'official' => 'Can request creation of official courses', |
'unofficial' => 'Can request creation of unofficial courses', |
'unofficial' => 'Can request creation of unofficial courses', |
'community' => 'Can request creation of communities', |
'community' => 'Can request creation of communities', |
|
'textbook' => 'Can request creation of textbook courses', |
'requestauthor' => 'Can request author space', |
'requestauthor' => 'Can request author space', |
); |
); |
if ($context eq 'requestcourses') { |
if ($context eq 'requestcourses') { |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
'requestcourses.official','requestcourses.unofficial', |
'requestcourses.official','requestcourses.unofficial', |
'requestcourses.community'); |
'requestcourses.community','requestcourses.textbook'); |
@usertools = ('official','unofficial','community'); |
@usertools = ('official','unofficial','community','textbook'); |
@options =('norequest','approval','autolimit','validate'); |
@options =('norequest','approval','autolimit','validate'); |
%validations = &Apache::lonnet::auto_courserequest_checks($ccdomain); |
%validations = &Apache::lonnet::auto_courserequest_checks($ccdomain); |
%reqtitles = &courserequest_titles(); |
%reqtitles = &courserequest_titles(); |
Line 446 sub coursereq_externaluser {
|
Line 446 sub coursereq_externaluser {
|
'official' => 'Can request creation of official courses', |
'official' => 'Can request creation of official courses', |
'unofficial' => 'Can request creation of unofficial courses', |
'unofficial' => 'Can request creation of unofficial courses', |
'community' => 'Can request creation of communities', |
'community' => 'Can request creation of communities', |
|
'textbook' => 'Can request creation of textbook courses', |
); |
); |
|
|
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.community'); |
'reqcrsotherdom.community','reqcrsotherdom.textbook'); |
@usertools = ('official','unofficial','community'); |
@usertools = ('official','unofficial','community','textbook'); |
@options = ('approval','validate','autolimit'); |
@options = ('approval','validate','autolimit'); |
%validations = &Apache::lonnet::auto_courserequest_checks($cdom); |
%validations = &Apache::lonnet::auto_courserequest_checks($cdom); |
my $optregex = join('|',@options); |
my $optregex = join('|',@options); |
Line 531 sub courserequest_titles {
|
Line 532 sub courserequest_titles {
|
official => 'Official', |
official => 'Official', |
unofficial => 'Unofficial', |
unofficial => 'Unofficial', |
community => 'Communities', |
community => 'Communities', |
|
textbook => 'Textbook', |
norequest => 'Not allowed', |
norequest => 'Not allowed', |
approval => 'Approval by Dom. Coord.', |
approval => 'Approval by Dom. Coord.', |
validate => 'With validation', |
validate => 'With validation', |
Line 1227 ENDFORMINFO
|
Line 1229 ENDFORMINFO
|
} |
} |
} |
} |
} |
} |
|
my $title = ''; |
if ($newuser) { |
if ($newuser) { |
my ($portfolioform,$domroleform); |
my ($portfolioform,$domroleform); |
if ((&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) || |
if ((&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) || |
Line 1240 ENDFORMINFO
|
Line 1243 ENDFORMINFO
|
} |
} |
&initialize_authen_forms($ccdomain,$formname); |
&initialize_authen_forms($ccdomain,$formname); |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'cnu' => 'Create New User', |
|
'ast' => 'as a student', |
|
'ame' => 'as a member', |
|
'ind' => 'in domain', |
|
'lg' => 'Login Data', |
'lg' => 'Login Data', |
'hs' => "Home Server", |
'hs' => "Home Server", |
); |
); |
Line 1257 $loginscript
|
Line 1256 $loginscript
|
// ]]> |
// ]]> |
</script> |
</script> |
<input type='hidden' name='makeuser' value='1' /> |
<input type='hidden' name='makeuser' value='1' /> |
<h2>$lt{'cnu'} "$ccuname" $lt{'ind'} $ccdomain |
|
ENDTITLE |
ENDTITLE |
if ($env{'form.action'} eq 'singlestudent') { |
if ($env{'form.action'} eq 'singlestudent') { |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$r->print(' ('.$lt{'ame'}.')'); |
$title = &mt('Create New User [_1] in domain [_2] as a member', |
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
} else { |
} else { |
$r->print(' ('.$lt{'ast'}.')'); |
$title = &mt('Create New User [_1] in domain [_2] as a student', |
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
} |
} |
|
} else { |
|
$title = &mt('Create New User [_1] in domain [_2]', |
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
} |
} |
$r->print('</h2>'."\n".'<div class="LC_left_float">'); |
$r->print('<h2>'.$title.'</h2>'."\n"); |
|
$r->print('<div class="LC_left_float">'); |
my $personal_table = |
my $personal_table = |
&personal_data_display($ccuname,$ccdomain,$newuser,$context, |
&personal_data_display($ccuname,$ccdomain,$newuser,$context, |
$inst_results{$ccuname.':'.$ccdomain}); |
$inst_results{$ccuname.':'.$ccdomain}); |
|
# (Do not offer Disable Safeguard here) |
$r->print($personal_table); |
$r->print($personal_table); |
my ($home_server_pick,$numlib) = |
my ($home_server_pick,$numlib) = |
&Apache::loncommon::home_server_form_item($ccdomain,'hserver', |
&Apache::loncommon::home_server_form_item($ccdomain,'hserver', |
Line 1356 ENDAUTH
|
Line 1361 ENDAUTH
|
} |
} |
$r->print('</div><div class="LC_clear_float_footer"></div>'); |
$r->print('</div><div class="LC_clear_float_footer"></div>'); |
} else { # user already exists |
} else { # user already exists |
my %lt=&Apache::lonlocal::texthash( |
$r->print($start_page.$forminfo); |
'cup' => "Modify existing user: ", |
|
'ens' => "Enroll one student: ", |
|
'enm' => "Enroll one member: ", |
|
'id' => "in domain", |
|
); |
|
$r->print(<<ENDCHANGEUSER); |
|
$start_page |
|
$forminfo |
|
<h2> |
|
ENDCHANGEUSER |
|
if ($env{'form.action'} eq 'singlestudent') { |
if ($env{'form.action'} eq 'singlestudent') { |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$r->print($lt{'enm'}); |
$title = &mt('Enroll one member: [_1] in domain [_2]', |
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
} else { |
} else { |
$r->print($lt{'ens'}); |
$title = &mt('Enroll one student: [_1] in domain [_2]', |
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
} |
} |
} else { |
} else { |
$r->print($lt{'cup'}); |
$title = &mt('Modify existing user: [_1] in domain [_2]', |
|
'"'.$ccuname.'"','"'.$ccdomain.'"'); |
} |
} |
$r->print(' "'.$ccuname.'" '.$lt{'id'}.' "'.$ccdomain.'"</h2>'. |
$r->print('<h2>'.$title.'</h2>'."\n"); |
"\n".'<div class="LC_left_float">'); |
$r->print('<div class="LC_left_float">'); |
my ($personal_table,$showforceid) = |
my $personal_table = |
&personal_data_display($ccuname,$ccdomain,$newuser,$context, |
&personal_data_display($ccuname,$ccdomain,$newuser,$context, |
$inst_results{$ccuname.':'.$ccdomain}); |
$inst_results{$ccuname.':'.$ccdomain}); |
$r->print($personal_table); |
$r->print($personal_table); |
if ($showforceid) { |
|
$r->print('<table>'.&Apache::lonuserutils::forceid_change($context).'</table>'); |
|
} |
|
if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { |
if (&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) { |
$r->print('<br /><h3>'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'</h3>'. |
$r->print('<br /><h3>'.&mt('User Can Request Creation of Courses/Communities in this Domain?').'</h3>'. |
&Apache::loncommon::start_data_table()); |
&Apache::loncommon::start_data_table()); |
Line 1415 ENDCHANGEUSER
|
Line 1410 ENDCHANGEUSER
|
if (!&Apache::lonnet::allowed('mpq',$ccdomain)) { |
if (!&Apache::lonnet::allowed('mpq',$ccdomain)) { |
if (&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) { |
if (&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) { |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'dska' => "Disk quotas for user's portfolio and authoring space", |
'dska' => "Disk quotas for user's portfolio and Authoring Space", |
'youd' => "You do not have privileges to modify the portfolio and/or authoring space quotas for this user.", |
'youd' => "You do not have privileges to modify the portfolio and/or Authoring Space quotas for this user.", |
'ichr' => "If a change is required, contact a domain coordinator for the domain", |
'ichr' => "If a change is required, contact a domain coordinator for the domain", |
); |
); |
$user_text{'quota'} = <<ENDNOPORTPRIV; |
$user_text{'quota'} = <<ENDNOPORTPRIV; |
Line 2167 sub modify_login_block {
|
Line 2162 sub modify_login_block {
|
|
|
sub personal_data_display { |
sub personal_data_display { |
my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray) = @_; |
my ($ccuname,$ccdomain,$newuser,$context,$inst_results,$rolesarray) = @_; |
my ($output,$showforceid,%userenv,%canmodify,%canmodify_status); |
my ($output,%userenv,%canmodify,%canmodify_status); |
my @userinfo = ('firstname','middlename','lastname','generation', |
my @userinfo = ('firstname','middlename','lastname','generation', |
'permanentemail','id'); |
'permanentemail','id'); |
my $rowcount = 0; |
my $rowcount = 0; |
Line 2254 sub personal_data_display {
|
Line 2249 sub personal_data_display {
|
} else { |
} else { |
$row .= $userenv{$item}; |
$row .= $userenv{$item}; |
} |
} |
if ($item eq 'id') { |
if (($item eq 'id') && ($canmodify{$item})) { |
$showforceid = $canmodify{$item}; |
$row .= '<br />'.&Apache::lonuserutils::forceid_change($context); |
} |
} |
} |
} |
$row .= &Apache::lonhtmlcommon::row_closure(1); |
$row .= &Apache::lonhtmlcommon::row_closure(1); |
Line 2291 sub personal_data_display {
|
Line 2286 sub personal_data_display {
|
} |
} |
} |
} |
if (!$hiderow) { |
if (!$hiderow) { |
my $row = &Apache::lonhtmlcommon::row_title(&mt('Affliations'),undef,'LC_oddrow_value')."\n". |
my $row = &Apache::lonhtmlcommon::row_title(&mt('Affiliations'),undef,'LC_oddrow_value')."\n". |
$shown.&Apache::lonhtmlcommon::row_closure(1); |
$shown.&Apache::lonhtmlcommon::row_closure(1); |
if ($context eq 'selfcreate') { |
if ($context eq 'selfcreate') { |
$rowcount ++; |
$rowcount ++; |
Line 2306 sub personal_data_display {
|
Line 2301 sub personal_data_display {
|
if ($context eq 'selfcreate') { |
if ($context eq 'selfcreate') { |
return($output,$rowcount,$editable); |
return($output,$rowcount,$editable); |
} else { |
} else { |
return ($output,$showforceid); |
return $output; |
} |
} |
} else { |
} else { |
return $output; |
return $output; |
Line 2471 sub update_user_data {
|
Line 2466 sub update_user_data {
|
if (! exists($env{'form.makeuser'})) { |
if (! exists($env{'form.makeuser'})) { |
# Modifying an existing user, so check the validity of the name |
# Modifying an existing user, so check the validity of the name |
if ($uhome eq 'no_host') { |
if ($uhome eq 'no_host') { |
$r->print($error.&mt('Unable to determine home server for '). |
$r->print( |
$env{'form.ccuname'}.&mt(' in domain '). |
$error |
$env{'form.ccdomain'}.'.'); |
.'<p class="LC_error">' |
|
.&mt('Unable to determine home server for [_1] in domain [_2].', |
|
'"'.$env{'form.ccuname'}.'"','"'.$env{'form.ccdomain'}.'"') |
|
.'</p>'); |
return; |
return; |
} |
} |
} |
} |
Line 2513 sub update_user_data {
|
Line 2511 sub update_user_data {
|
my (%alerts,%rulematch,%inst_results,%curr_rules); |
my (%alerts,%rulematch,%inst_results,%curr_rules); |
my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id'); |
my @userinfo = ('firstname','middlename','lastname','generation','permanentemail','id'); |
my @usertools = ('aboutme','blog','webdav','portfolio'); |
my @usertools = ('aboutme','blog','webdav','portfolio'); |
my @requestcourses = ('official','unofficial','community'); |
my @requestcourses = ('official','unofficial','community','textbook'); |
my @requestauthor = ('requestauthor'); |
my @requestauthor = ('requestauthor'); |
my ($othertitle,$usertypes,$types) = |
my ($othertitle,$usertypes,$types) = |
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'}); |
&Apache::loncommon::sorted_inst_types($env{'form.ccdomain'}); |
Line 2683 sub update_user_data {
|
Line 2681 sub update_user_data {
|
'id','permanentemail','portfolioquota','authorquota','inststatus', |
'id','permanentemail','portfolioquota','authorquota','inststatus', |
'tools.aboutme','tools.blog','tools.webdav','tools.portfolio', |
'tools.aboutme','tools.blog','tools.webdav','tools.portfolio', |
'requestcourses.official','requestcourses.unofficial', |
'requestcourses.official','requestcourses.unofficial', |
'requestcourses.community','reqcrsotherdom.official', |
'requestcourses.community','requestcourses.textbook', |
'reqcrsotherdom.unofficial','reqcrsotherdom.community', |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
|
'reqcrsotherdom.community','reqcrsotherdom.textbook', |
'requestauthor'], |
'requestauthor'], |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
my ($tmp) = keys(%userenv); |
my ($tmp) = keys(%userenv); |
Line 2949 sub update_user_data {
|
Line 2948 sub update_user_data {
|
if ($env{'form.ccdomain'} eq $env{'request.role.domain'}) { |
if ($env{'form.ccdomain'} eq $env{'request.role.domain'}) { |
&tool_changes('requestcourses',\@requestcourses,\%oldsettings,\%oldsettingstext, |
&tool_changes('requestcourses',\@requestcourses,\%oldsettings,\%oldsettingstext, |
\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext); |
\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext); |
&tool_changes('requestauthor',\@requestauthor,\%oldsettings,\%oldsettingstext,\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext); |
&tool_changes('requestauthor',\@requestauthor,\%oldsettings,\%oldsettingstext, |
|
\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext); |
} else { |
} else { |
&tool_changes('reqcrsotherdom',\@requestcourses,\%oldsettings,\%oldsettingstext, |
&tool_changes('reqcrsotherdom',\@requestcourses,\%oldsettings,\%oldsettingstext, |
\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext); |
\%userenv,\%changeHash,\%changed,\%newsettings,\%newsettingstext); |
Line 2961 sub update_user_data {
|
Line 2961 sub update_user_data {
|
} |
} |
} |
} |
foreach my $name ('portfolio','author') { |
foreach my $name ('portfolio','author') { |
$oldsettings{'quota'}{$name} = $oldquota{$name}.' MB'; |
$oldsettings{'quota'}{$name} = &mt('[_1] MB',$oldquota{$name}); |
$newsettings{'quota'}{$name} = $newquota{$name}.' MB'; |
$newsettings{'quota'}{$name} = &mt('[_1] MB',$newquota{$name}); |
} |
} |
if ((keys(%namechanged) > 0) || (keys(%changed) > 0)) { |
if ((keys(%namechanged) > 0) || (keys(%changed) > 0)) { |
my ($chgresult,$namechgresult); |
my ($chgresult,$namechgresult); |
Line 3061 sub update_user_data {
|
Line 3061 sub update_user_data {
|
&Apache::lonnet::appenv(\%newenvhash); |
&Apache::lonnet::appenv(\%newenvhash); |
} |
} |
} else { # error occurred |
} else { # error occurred |
$r->print('<span class="LC_error">'.&mt('Unable to successfully change environment for').' '. |
$r->print( |
$env{'form.ccuname'}.' '.&mt('in domain').' '. |
'<p class="LC_error">' |
$env{'form.ccdomain'}.'</span><br />'); |
.&mt('Unable to successfully change environment for [_1] in domain [_2].', |
|
'"'.$env{'form.ccuname'}.'"', |
|
'"'.$env{'form.ccdomain'}.'"') |
|
.'</p>'); |
} |
} |
} else { # End of if ($env ... ) logic |
} else { # End of if ($env ... ) logic |
# They did not want to change the users name, quota, tool availability, |
# They did not want to change the users name, quota, tool availability, |
Line 3111 sub update_user_data {
|
Line 3114 sub update_user_data {
|
if ($env{'form.action'} eq 'singlestudent') { |
if ($env{'form.action'} eq 'singlestudent') { |
&enroll_single_student($r,$uhome,$amode,$genpwd,$now,$newuser,$context, |
&enroll_single_student($r,$uhome,$amode,$genpwd,$now,$newuser,$context, |
$crstype,$showcredits,$defaultcredits); |
$crstype,$showcredits,$defaultcredits); |
$r->print('<p><a href="javascript:backPage(document.userupdate)">'); |
my $linktext = ($crstype eq 'Community' ? |
if ($crstype eq 'Community') { |
&mt('Enroll Another Member') : &mt('Enroll Another Student')); |
$r->print(&mt('Enroll Another Member')); |
$r->print( |
} else { |
&Apache::lonhtmlcommon::actionbox([ |
$r->print(&mt('Enroll Another Student')); |
'<a href="javascript:backPage(document.userupdate)">' |
} |
.($crstype eq 'Community' ? |
$r->print('</a></p>'); |
&mt('Enroll Another Member') : &mt('Enroll Another Student')) |
|
.'</a>'])); |
} else { |
} else { |
my @rolechanges = &update_roles($r,$context,$showcredits); |
my @rolechanges = &update_roles($r,$context,$showcredits); |
if (keys(%namechanged) > 0) { |
if (keys(%namechanged) > 0) { |
Line 3172 sub display_userinfo {
|
Line 3176 sub display_userinfo {
|
'id' => 'Student/Employee ID', |
'id' => 'Student/Employee ID', |
'permanentemail' => 'Permanent e-mail address', |
'permanentemail' => 'Permanent e-mail address', |
'portfolioquota' => 'Disk space allocated to portfolio files', |
'portfolioquota' => 'Disk space allocated to portfolio files', |
'authorquota' => 'Disk space allocated to authoring space', |
'authorquota' => 'Disk space allocated to Authoring Space', |
'blog' => 'Blog Availability', |
'blog' => 'Blog Availability', |
'webdav' => 'WebDAV Availability', |
'webdav' => 'WebDAV Availability', |
'aboutme' => 'Personal Information Page Availability', |
'aboutme' => 'Personal Information Page Availability', |
Line 3180 sub display_userinfo {
|
Line 3184 sub display_userinfo {
|
'official' => 'Can Request Official Courses', |
'official' => 'Can Request Official Courses', |
'unofficial' => 'Can Request Unofficial Courses', |
'unofficial' => 'Can Request Unofficial Courses', |
'community' => 'Can Request Communities', |
'community' => 'Can Request Communities', |
|
'textbook' => 'Can Request Textbook Courses', |
'requestauthor' => 'Can Request Author Role', |
'requestauthor' => 'Can Request Author Role', |
'inststatus' => "Affiliation", |
'inststatus' => "Affiliation", |
'prvs' => 'Previous Value:', |
'prvs' => 'Previous Value:', |
Line 3214 sub display_userinfo {
|
Line 3219 sub display_userinfo {
|
@items = ($entry); |
@items = ($entry); |
} else { |
} else { |
@items = @{$requestcourses}; |
@items = @{$requestcourses}; |
} |
} |
foreach my $item (@items) { |
foreach my $item (@items) { |
if (($newsetting->{$item} ne $oldsetting->{$item}) || |
if (($newsetting->{$item} ne $oldsetting->{$item}) || |
($newsettingtext->{$item} ne $oldsettingtext->{$item})) { |
($newsettingtext->{$item} ne $oldsettingtext->{$item})) { |
Line 3938 sub enroll_single_student {
|
Line 3943 sub enroll_single_student {
|
} |
} |
$r->print('.<br />'.$showstart.'; '.$showend); |
$r->print('.<br />'.$showstart.'; '.$showend); |
if ($startdate <= $now && !$newuser) { |
if ($startdate <= $now && !$newuser) { |
$r->print('<p> '); |
$r->print('<p class="LC_info">'); |
if ($crstype eq 'Community') { |
if ($crstype eq 'Community') { |
$r->print(&mt('If the member is currently logged-in to LON-CAPA, the new role will be available when the member next logs in.')); |
$r->print(&mt('If the member is currently logged-in to LON-CAPA, the new role will be available when the member next logs in.')); |
} else { |
} else { |
Line 4429 sub set_custom_role {
|
Line 4434 sub set_custom_role {
|
$sysrole.=':'.$item; |
$sysrole.=':'.$item; |
} |
} |
} |
} |
$r->print('<br />Defining Role: '. |
# Assign role; Compile and show result |
&Apache::lonnet::definerole($rolename,$sysrole,$domrole,$courole)); |
my $errmsg; |
|
my $result = |
|
&Apache::lonnet::definerole($rolename,$sysrole,$domrole,$courole); |
|
if ($result ne 'ok') { |
|
$errmsg = ': '.$result; |
|
} |
|
my $message = |
|
&Apache::lonhtmlcommon::confirm_success( |
|
&mt('Defining Role').$errmsg, ($result eq 'ok' ? 0 : 1)); |
if ($env{'request.course.id'}) { |
if ($env{'request.course.id'}) { |
my $url='/'.$env{'request.course.id'}; |
my $url='/'.$env{'request.course.id'}; |
$url=~s/\_/\//g; |
$url=~s/\_/\//g; |
$r->print('<br />'.&mt('Assigning Role to Self').': '. |
$result = |
&Apache::lonnet::assigncustomrole($env{'user.domain'}, |
&Apache::lonnet::assigncustomrole( |
$env{'user.name'}, |
$env{'user.domain'},$env{'user.name'}, |
$url, |
$url, |
$env{'user.domain'}, |
$env{'user.domain'},$env{'user.name'}, |
$env{'user.name'}, |
$rolename,undef,undef,undef,$context); |
$rolename,undef,undef,undef,$context)); |
if ($result ne 'ok') { |
|
$errmsg = ': '.$result; |
|
} |
|
$message .= |
|
'<br />' |
|
.&Apache::lonhtmlcommon::confirm_success( |
|
&mt('Assigning Role to Self').$errmsg, ($result eq 'ok' ? 0 : 1)); |
} |
} |
$r->print( |
$r->print( |
'<p><a href="javascript:backPage(document.customresult,'."'pickrole'".')">' |
&Apache::loncommon::confirmwrapper($message) |
.&mt('Create or edit another custom role') |
.'<br />' |
.'</a></p>' |
.&Apache::lonhtmlcommon::actionbox([ |
|
'<a href="javascript:backPage(document.customresult,'."'pickrole'".')">' |
|
.&mt('Create or edit another custom role') |
|
.'</a>']) |
.'<form name="customresult" method="post" action="">' |
.'<form name="customresult" method="post" action="">' |
.&Apache::lonhtmlcommon::echo_form_input([]).'</form>' |
.&Apache::lonhtmlcommon::echo_form_input([]) |
|
.'</form>' |
); |
); |
} |
} |
|
|
Line 4631 sub handler {
|
Line 4654 sub handler {
|
(&Apache::lonnet::allowed('cau',$env{'request.role.domain'}))) { |
(&Apache::lonnet::allowed('cau',$env{'request.role.domain'}))) { |
push(@{$brcrum}, |
push(@{$brcrum}, |
{href => '/adm/createuser?action=processauthorreq', |
{href => '/adm/createuser?action=processauthorreq', |
text => 'Authoring space requests', |
text => 'Authoring Space requests', |
help => 'Domain_Role_Approvals'}); |
help => 'Domain_Role_Approvals'}); |
$bread_crumbs_component = 'Authoring requests'; |
$bread_crumbs_component = 'Authoring requests'; |
if ($env{'form.state'} eq 'done') { |
if ($env{'form.state'} eq 'done') { |
Line 6971 sub course_level_dc {
|
Line 6994 sub course_level_dc {
|
my $otheritems = &Apache::loncommon::start_data_table_row()."\n". |
my $otheritems = &Apache::loncommon::start_data_table_row()."\n". |
'<td><br /><span class="LC_nobreak"><input type="text" name="coursedesc" value="" onfocus="this.blur();opencrsbrowser('."'cu','dccourse','dcdomain','coursedesc','','','','crstype'".')" />'. |
'<td><br /><span class="LC_nobreak"><input type="text" name="coursedesc" value="" onfocus="this.blur();opencrsbrowser('."'cu','dccourse','dcdomain','coursedesc','','','','crstype'".')" />'. |
$courseform.(' ' x4).'</span></td>'."\n". |
$courseform.(' ' x4).'</span></td>'."\n". |
'<td valign><br /><select name="role">'."\n"; |
'<td valign="top"><br /><select name="role">'."\n"; |
foreach my $role (@roles) { |
foreach my $role (@roles) { |
my $plrole=&Apache::lonnet::plaintext($role); |
my $plrole=&Apache::lonnet::plaintext($role); |
$otheritems .= ' <option value="'.$role.'">'.$plrole; |
$otheritems .= ' <option value="'.$role.'">'.$plrole.'</option>'; |
} |
} |
if ( keys %customroles > 0) { |
if ( keys %customroles > 0) { |
foreach my $cust (sort keys %customroles) { |
foreach my $cust (sort keys %customroles) { |
my $custrole='cr_cr_'.$env{'user.domain'}. |
my $custrole='cr_cr_'.$env{'user.domain'}. |
'_'.$env{'user.name'}.'_'.$cust; |
'_'.$env{'user.name'}.'_'.$cust; |
$otheritems .= ' <option value="'.$custrole.'">'.$cust; |
$otheritems .= ' <option value="'.$custrole.'">'.$cust.'</option>'; |
} |
} |
} |
} |
$otheritems .= '</select></td><td>'. |
$otheritems .= '</select></td><td>'. |
'<table border="0" cellspacing="0" cellpadding="0">'. |
'<table border="0" cellspacing="0" cellpadding="0">'. |
'<tr><td valign="top"><b>'.$lt{'exs'}.'</b><br /><select name="currsec">'. |
'<tr><td valign="top"><b>'.$lt{'exs'}.'</b><br /><select name="currsec">'. |
' <option value=""><--'.&mt('Pick course first').'</select></td>'. |
' <option value=""><--'.&mt('Pick course first').'</option></select></td>'. |
'<td> </td>'. |
'<td> </td>'. |
'<td valign="top"> <b>'.$lt{'new'}.'</b><br />'. |
'<td valign="top"> <b>'.$lt{'new'}.'</b><br />'. |
'<input type="text" name="newsec" value="" />'. |
'<input type="text" name="newsec" value="" />'. |