version 1.406.2.17, 2019/08/27 14:45:04
|
version 1.466, 2022/12/01 01:28:26
|
Line 71 use Apache::longroup;
|
Line 71 use Apache::longroup;
|
use Apache::lonuserutils; |
use Apache::lonuserutils; |
use Apache::loncoursequeueadmin; |
use Apache::loncoursequeueadmin; |
use LONCAPA qw(:DEFAULT :match); |
use LONCAPA qw(:DEFAULT :match); |
|
use HTML::Entities; |
|
|
my $loginscript; # piece of javascript used in two separate instances |
my $loginscript; # piece of javascript used in two separate instances |
my $authformnop; |
my $authformnop; |
Line 78 my $authformkrb;
|
Line 79 my $authformkrb;
|
my $authformint; |
my $authformint; |
my $authformfsys; |
my $authformfsys; |
my $authformloc; |
my $authformloc; |
|
my $authformlti; |
|
|
sub initialize_authen_forms { |
sub initialize_authen_forms { |
my ($dom,$formname,$curr_authtype,$mode) = @_; |
my ($dom,$formname,$curr_authtype,$mode) = @_; |
Line 88 sub initialize_authen_forms {
|
Line 90 sub initialize_authen_forms {
|
domain => $dom, |
domain => $dom, |
); |
); |
my %abv_auth = &auth_abbrev(); |
my %abv_auth = &auth_abbrev(); |
if ($curr_authtype =~ /^(krb4|krb5|internal|localauth|unix):(.*)$/) { |
if ($curr_authtype =~ /^(krb4|krb5|internal|localauth|unix|lti):(.*)$/) { |
my $long_auth = $1; |
my $long_auth = $1; |
my $curr_autharg = $2; |
my $curr_autharg = $2; |
my %abv_auth = &auth_abbrev(); |
my %abv_auth = &auth_abbrev(); |
Line 107 sub initialize_authen_forms {
|
Line 109 sub initialize_authen_forms {
|
$authformint = &Apache::loncommon::authform_internal(%param); |
$authformint = &Apache::loncommon::authform_internal(%param); |
$authformfsys = &Apache::loncommon::authform_filesystem(%param); |
$authformfsys = &Apache::loncommon::authform_filesystem(%param); |
$authformloc = &Apache::loncommon::authform_local(%param); |
$authformloc = &Apache::loncommon::authform_local(%param); |
|
$authformlti = &Apache::loncommon::authform_lti(%param); |
} |
} |
|
|
sub auth_abbrev { |
sub auth_abbrev { |
Line 116 sub auth_abbrev {
|
Line 119 sub auth_abbrev {
|
internal => 'int', |
internal => 'int', |
localauth => 'loc', |
localauth => 'loc', |
unix => 'fsys', |
unix => 'fsys', |
|
lti => 'lti', |
); |
); |
return %abv_auth; |
return %abv_auth; |
} |
} |
Line 243 sub build_tools_display {
|
Line 247 sub build_tools_display {
|
'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", |
|
'timezone' => "Can set Time Zone", |
'avai' => "Available", |
'avai' => "Available", |
'cusa' => "availability", |
'cusa' => "availability", |
'chse' => "Change setting", |
'chse' => "Change setting", |
Line 252 sub build_tools_display {
|
Line 257 sub build_tools_display {
|
'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', |
'textbook' => 'Can request creation of textbook courses', |
|
'placement' => 'Can request creation of placement tests', |
|
'lti' => 'Can request creation of LTI courses', |
'requestauthor' => 'Can request author space', |
'requestauthor' => 'Can request author space', |
); |
); |
|
$isadv = &Apache::lonnet::is_advanced_user($ccdomain,$ccuname); |
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.textbook'); |
'requestcourses.community','requestcourses.textbook', |
@usertools = ('official','unofficial','community','textbook'); |
'requestcourses.placement','requestcourses.lti'); |
|
@usertools = ('official','unofficial','community','textbook','placement','lti'); |
@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 266 sub build_tools_display {
|
Line 275 sub build_tools_display {
|
$colspan = ' colspan="2"'; |
$colspan = ' colspan="2"'; |
%domconfig = |
%domconfig = |
&Apache::lonnet::get_dom('configuration',['requestcourses'],$ccdomain); |
&Apache::lonnet::get_dom('configuration',['requestcourses'],$ccdomain); |
$isadv = &Apache::lonnet::is_advanced_user($ccdomain,$ccuname); |
|
} elsif ($context eq 'requestauthor') { |
} elsif ($context eq 'requestauthor') { |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
'requestauthor'); |
'requestauthor'); |
Line 280 sub build_tools_display {
|
Line 288 sub build_tools_display {
|
} else { |
} else { |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
'tools.aboutme','tools.portfolio','tools.blog', |
'tools.aboutme','tools.portfolio','tools.blog', |
'tools.webdav'); |
'tools.webdav','tools.timezone'); |
@usertools = ('aboutme','blog','webdav','portfolio'); |
@usertools = ('aboutme','blog','webdav','portfolio','timezone'); |
} |
} |
foreach my $item (@usertools) { |
foreach my $item (@usertools) { |
my ($custom_access,$curr_access,$cust_on,$cust_off,$tool_on,$tool_off, |
my ($custom_access,$curr_access,$cust_on,$cust_off,$tool_on,$tool_off, |
$currdisp,$custdisp,$custradio); |
$currdisp,$custdisp,$custradio); |
$cust_off = 'checked="checked" '; |
$cust_off = 'checked="checked" '; |
$tool_on = 'checked="checked" '; |
$tool_on = 'checked="checked" '; |
$curr_access = |
$curr_access = |
&Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef, |
&Apache::lonnet::usertools_access($ccuname,$ccdomain,$item,undef, |
$context); |
$context,\%userenv,'', |
|
{'is_adv' => $isadv}); |
if ($context eq 'requestauthor') { |
if ($context eq 'requestauthor') { |
if ($userenv{$context} ne '') { |
if ($userenv{$context} ne '') { |
$cust_on = ' checked="checked" '; |
$cust_on = ' checked="checked" '; |
Line 333 sub build_tools_display {
|
Line 342 sub build_tools_display {
|
' <td'.$colspan.'>'.$lt{$item}.'</td>'."\n". |
' <td'.$colspan.'>'.$lt{$item}.'</td>'."\n". |
' </tr>'."\n". |
' </tr>'."\n". |
&Apache::loncommon::start_data_table_row()."\n"; |
&Apache::loncommon::start_data_table_row()."\n"; |
|
|
if (($context eq 'requestcourses') || ($context eq 'requestauthor')) { |
if (($context eq 'requestcourses') || ($context eq 'requestauthor')) { |
my ($curroption,$currlimit); |
my ($curroption,$currlimit); |
my $envkey = $context.'.'.$item; |
my $envkey = $context.'.'.$item; |
Line 451 sub coursereq_externaluser {
|
Line 461 sub coursereq_externaluser {
|
'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', |
'textbook' => 'Can request creation of textbook courses', |
|
'placement' => 'Can request creation of placement tests', |
); |
); |
|
|
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
%userenv = &Apache::lonnet::userenvironment($ccdomain,$ccuname, |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.community','reqcrsotherdom.textbook'); |
'reqcrsotherdom.community','reqcrsotherdom.textbook', |
@usertools = ('official','unofficial','community','textbook'); |
'reqcrsotherdom.placement'); |
|
@usertools = ('official','unofficial','community','textbook','placement'); |
@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 537 sub courserequest_titles {
|
Line 549 sub courserequest_titles {
|
unofficial => 'Unofficial', |
unofficial => 'Unofficial', |
community => 'Communities', |
community => 'Communities', |
textbook => 'Textbook', |
textbook => 'Textbook', |
|
placement => 'Placement Tests', |
|
lti => 'LTI Provider', |
norequest => 'Not allowed', |
norequest => 'Not allowed', |
approval => 'Approval by Dom. Coord.', |
approval => 'Approval by Dom. Coord.', |
validate => 'With validation', |
validate => 'With validation', |
Line 880 ENDBLOCK
|
Line 894 ENDBLOCK
|
(!(($env{'form.action'} eq 'singleuser') && ($context eq 'domain') && |
(!(($env{'form.action'} eq 'singleuser') && ($context eq 'domain') && |
(!&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))))) { |
(!&Apache::lonnet::allowed('mau',$env{'request.role.domain'}))))) { |
my $defdom=$env{'request.role.domain'}; |
my $defdom=$env{'request.role.domain'}; |
my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain'); |
my ($trusted,$untrusted); |
|
if ($context eq 'course') { |
|
($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$defdom); |
|
} elsif ($context eq 'author') { |
|
($trusted,$untrusted) = &Apache::lonnet::trusted_domains('othcoau',$defdom); |
|
} elsif ($context eq 'domain') { |
|
($trusted,$untrusted) = &Apache::lonnet::trusted_domains('domroles',$defdom); |
|
} |
|
my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain',undef,undef,undef,$trusted,$untrusted); |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'enro' => 'Enroll one student', |
'enro' => 'Enroll one student', |
'enrm' => 'Enroll one member', |
'enrm' => 'Enroll one member', |
Line 1465 ENDAUTH
|
Line 1487 ENDAUTH
|
$inst_results{$ccuname.':'.$ccdomain})); |
$inst_results{$ccuname.':'.$ccdomain})); |
if ((&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) || |
if ((&Apache::lonnet::allowed('ccc',$env{'request.role.domain'})) || |
(&Apache::lonnet::allowed('udp',$env{'request.role.domain'}))) { |
(&Apache::lonnet::allowed('udp',$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>'."\n"); |
&Apache::loncommon::start_data_table()); |
if (($env{'request.role.domain'} eq $ccdomain) || |
if ($env{'request.role.domain'} eq $ccdomain) { |
(&Apache::lonnet::will_trust('reqcrs',$ccdomain,$env{'request.role.domain'}))) { |
$r->print(&build_tools_display($ccuname,$ccdomain,'requestcourses')); |
$r->print(&Apache::loncommon::start_data_table()); |
|
if ($env{'request.role.domain'} eq $ccdomain) { |
|
$r->print(&build_tools_display($ccuname,$ccdomain,'requestcourses')); |
|
} else { |
|
$r->print(&coursereq_externaluser($ccuname,$ccdomain, |
|
$env{'request.role.domain'})); |
|
} |
|
$r->print(&Apache::loncommon::end_data_table()); |
} else { |
} else { |
$r->print(&coursereq_externaluser($ccuname,$ccdomain, |
$r->print(&mt('Domain configuration for this domain prohibits course creation by users from domain: "[_1]"', |
$env{'request.role.domain'})); |
&Apache::lonnet::domain($ccdomain,'description'))); |
} |
} |
$r->print(&Apache::loncommon::end_data_table()); |
|
} |
} |
$r->print('</div>'); |
$r->print('</div>'); |
my @order = ('auth','quota','tools','requestauthor'); |
my @order = ('auth','quota','tools','requestauthor'); |
Line 1591 ENDNOTOOLSPRIV
|
Line 1619 ENDNOTOOLSPRIV
|
if ($newuser) { |
if ($newuser) { |
$r->print(' onclick="auth_check()" \>'."\n"); |
$r->print(' onclick="auth_check()" \>'."\n"); |
} else { |
} else { |
$r->print('onclick="this.form.submit()" \>'."\n"); |
$r->print(' onclick="this.form.submit()" \>'."\n"); |
} |
} |
} else { |
} else { |
$r->print('</fieldset></div>'. |
$r->print('</fieldset></div>'. |
Line 2129 sub new_domain_roles {
|
Line 2157 sub new_domain_roles {
|
'<th>'.&mt('Start').'</th><th>'.&mt('End').'</th>'. |
'<th>'.&mt('Start').'</th><th>'.&mt('End').'</th>'. |
&Apache::loncommon::end_data_table_header_row(); |
&Apache::loncommon::end_data_table_header_row(); |
my @allroles = &Apache::lonuserutils::roles_by_context('domain'); |
my @allroles = &Apache::lonuserutils::roles_by_context('domain'); |
|
my $uprimary = &Apache::lonnet::domain($env{'request.role.domain'},'primary'); |
|
my $uintdom = &Apache::lonnet::internet_dom($uprimary); |
foreach my $thisdomain (sort(&Apache::lonnet::all_domains())) { |
foreach my $thisdomain (sort(&Apache::lonnet::all_domains())) { |
foreach my $role (@allroles) { |
foreach my $role (@allroles) { |
next if ($role eq 'ad'); |
next if ($role eq 'ad'); |
next if (($role eq 'au') && ($ccdomain ne $thisdomain)); |
next if (($role eq 'au') && ($ccdomain ne $thisdomain)); |
if (&Apache::lonnet::allowed('c'.$role,$thisdomain)) { |
if (&Apache::lonnet::allowed('c'.$role,$thisdomain)) { |
|
if ($role eq 'dc') { |
|
unless ($thisdomain eq $env{'request.role.domain'}) { |
|
my $domprim = &Apache::lonnet::domain($thisdomain,'primary'); |
|
my $intdom = &Apache::lonnet::internet_dom($domprim); |
|
next unless ($uintdom eq $intdom); |
|
} |
|
} |
my $plrole=&Apache::lonnet::plaintext($role); |
my $plrole=&Apache::lonnet::plaintext($role); |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash( |
'ssd' => "Set Start Date", |
'ssd' => "Set Start Date", |
Line 2175 sub user_authentication {
|
Line 2212 sub user_authentication {
|
'ld' => "Login Data" |
'ld' => "Login Data" |
); |
); |
# Check for a bad authentication type |
# Check for a bad authentication type |
if ($currentauth !~ /^(krb4|krb5|unix|internal|localauth):/) { |
if ($currentauth !~ /^(krb4|krb5|unix|internal|localauth|lti):/) { |
# bad authentication scheme |
# bad authentication scheme |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
if (&Apache::lonnet::allowed('mau',$ccdomain)) { |
&initialize_authen_forms($ccdomain,$formname); |
&initialize_authen_forms($ccdomain,$formname); |
Line 2202 $lt{'uuas'} ($currentauth). $lt{'adcs'}.
|
Line 2239 $lt{'uuas'} ($currentauth). $lt{'adcs'}.
|
ENDBADAUTH |
ENDBADAUTH |
} |
} |
} else { # Authentication type is valid |
} else { # Authentication type is valid |
|
|
&initialize_authen_forms($ccdomain,$formname,$currentauth,'modifyuser'); |
&initialize_authen_forms($ccdomain,$formname,$currentauth,'modifyuser'); |
my ($authformcurrent,$can_modify,@authform_others) = |
my ($authformcurrent,$can_modify,@authform_others) = |
&modify_login_block($ccdomain,$currentauth); |
&modify_login_block($ccdomain,$currentauth); |
Line 2290 ENDJS
|
Line 2328 ENDJS
|
$result = &mt('Currently using local (institutional) authentication.'); |
$result = &mt('Currently using local (institutional) authentication.'); |
} elsif ($currentauth =~ /^unix:/) { |
} elsif ($currentauth =~ /^unix:/) { |
$result = &mt('Currently Filesystem Authenticated.'); |
$result = &mt('Currently Filesystem Authenticated.'); |
|
} elsif ($currentauth =~ /^lti:/) { |
|
$result = &mt('Currently LTI authenticated.'); |
} |
} |
$outcome = '<h3>'.$lt{'ld'}.'</h3>'. |
$outcome = '<h3>'.$lt{'ld'}.'</h3>'. |
&Apache::loncommon::start_data_table(). |
&Apache::loncommon::start_data_table(). |
Line 2328 sub modify_login_block {
|
Line 2368 sub modify_login_block {
|
if ($can_assign{'loc'}) { |
if ($can_assign{'loc'}) { |
push(@authform_others,$authformloc); |
push(@authform_others,$authformloc); |
} |
} |
|
if ($can_assign{'lti'}) { |
|
push(@authform_others,$authformlti); |
|
} |
if (($can_assign{'krb4'}) || ($can_assign{'krb5'})) { |
if (($can_assign{'krb4'}) || ($can_assign{'krb5'})) { |
$show_override_msg = 1; |
$show_override_msg = 1; |
} |
} |
Line 2339 sub modify_login_block {
|
Line 2382 sub modify_login_block {
|
if ($can_assign{'loc'}) { |
if ($can_assign{'loc'}) { |
push(@authform_others,$authformloc); |
push(@authform_others,$authformloc); |
} |
} |
|
if ($can_assign{'lti'}) { |
|
push(@authform_others,$authformlti); |
|
} |
if ($can_assign{'int'}) { |
if ($can_assign{'int'}) { |
$show_override_msg = 1; |
$show_override_msg = 1; |
} |
} |
Line 2353 sub modify_login_block {
|
Line 2399 sub modify_login_block {
|
if ($can_assign{'loc'}) { |
if ($can_assign{'loc'}) { |
push(@authform_others,$authformloc); |
push(@authform_others,$authformloc); |
} |
} |
|
if ($can_assign{'lti'}) { |
|
push(@authform_others,$authformlti); |
|
} |
if ($can_assign{'fsys'}) { |
if ($can_assign{'fsys'}) { |
$show_override_msg = 1; |
$show_override_msg = 1; |
} |
} |
Line 2364 sub modify_login_block {
|
Line 2413 sub modify_login_block {
|
if ($can_assign{'int'}) { |
if ($can_assign{'int'}) { |
push(@authform_others,$authformint); |
push(@authform_others,$authformint); |
} |
} |
|
if ($can_assign{'lti'}) { |
|
push(@authform_others,$authformlti); |
|
} |
if ($can_assign{'loc'}) { |
if ($can_assign{'loc'}) { |
$show_override_msg = 1; |
$show_override_msg = 1; |
} |
} |
|
} elsif ($currentauth=~/^lti:/) { |
|
$authformcurrent=$authformlti; |
|
if (($can_assign{'krb4'}) || ($can_assign{'krb5'})) { |
|
push(@authform_others,$authformkrb); |
|
} |
|
if ($can_assign{'int'}) { |
|
push(@authform_others,$authformint); |
|
} |
|
if ($can_assign{'loc'}) { |
|
push(@authform_others,$authformloc); |
|
} |
} |
} |
if ($show_override_msg) { |
if ($show_override_msg) { |
$authformcurrent = '<table><tr><td colspan="3">'.$authformcurrent. |
$authformcurrent = '<table><tr><td colspan="3">'.$authformcurrent. |
Line 2381 sub modify_login_block {
|
Line 2444 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,$now, |
$now,$captchaform,$emailusername,$usertype,$usernameset,$condition,$excluded) = @_; |
$captchaform,$emailusername,$usertype,$usernameset,$condition,$excluded,$showsubmit) = @_; |
my ($output,%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'); |
Line 2465 sub personal_data_display {
|
Line 2528 sub personal_data_display {
|
} else { |
} else { |
undef($condition); |
undef($condition); |
} |
} |
} |
} |
if ($excluded) { |
if ($excluded) { |
unless ($excluded =~ /^\@[^\@]+$/) { |
unless ($excluded =~ /^\@[^\@]+$/) { |
undef($condition); |
undef($condition); |
Line 2492 sub personal_data_display {
|
Line 2555 sub personal_data_display {
|
} |
} |
$rowcount ++; |
$rowcount ++; |
$output .= &Apache::lonhtmlcommon::row_closure(1); |
$output .= &Apache::lonhtmlcommon::row_closure(1); |
my $upassone = '<input type="password" name="upass'.$now.'" size="20" autocomplete="off" />'; |
my $upassone = '<input type="password" name="upass'.$now.'" size="20" autocomplete="new-password" />'; |
my $upasstwo = '<input type="password" name="upasscheck'.$now.'" size="20" autocomplete="off" />'; |
my $upasstwo = '<input type="password" name="upasscheck'.$now.'" size="20" autocomplete="new-password" />'; |
$output .= &Apache::lonhtmlcommon::row_title(&mt('Password').'<b>*</b>', |
$output .= &Apache::lonhtmlcommon::row_title(&mt('Password').'<b>*</b>', |
'LC_pick_box_title', |
'LC_pick_box_title', |
'LC_oddrow_value')."\n". |
'LC_oddrow_value')."\n". |
Line 2505 sub personal_data_display {
|
Line 2568 sub personal_data_display {
|
$upasstwo. |
$upasstwo. |
&Apache::lonhtmlcommon::row_closure()."\n"; |
&Apache::lonhtmlcommon::row_closure()."\n"; |
if ($usernameset eq 'free') { |
if ($usernameset eq 'free') { |
my $onclick = "toggleUsernameDisp(this,'selfcreateusername');"; |
my $onclick = "toggleUsernameDisp(this,'selfcreateusername');"; |
$output .= &Apache::lonhtmlcommon::row_title($lt{'username'},undef,'LC_oddrow_value')."\n". |
$output .= &Apache::lonhtmlcommon::row_title($lt{'username'},undef,'LC_oddrow_value')."\n". |
&mt('Use e-mail address: '). |
'<span class="LC_nobreak">'.&mt('Use e-mail address: '). |
'<label><input type="radio" name="emailused" value="1" checked="checked" onclick="'.$onclick.'" />'.&mt('Yes').'</label>'."\n". |
'<label><input type="radio" name="emailused" value="1" checked="checked" onclick="'.$onclick.'" />'. |
(' 'x2). |
&mt('Yes').'</label>'.(' 'x2). |
'<label><input type="radio" name="emailused" value="0" onclick="'.$onclick.'" />'.&mt('No').'</label>'."\n". |
'<label><input type="radio" name="emailused" value="0" onclick="'.$onclick.'" />'. |
|
&mt('No').'</label></span>'."\n". |
'<div id="selfcreateusername" style="display: none; font-size: smaller">'. |
'<div id="selfcreateusername" style="display: none; font-size: smaller">'. |
'<br /><span class="LC_nobreak">'.&mt('Preferred username'). |
'<br /><span class="LC_nobreak">'.&mt('Preferred username'). |
' <input type="text" name="username" value="" size="20" autocomplete="off"/>'. |
' <input type="text" name="username" value="" size="20" autocomplete="off"/>'. |
Line 2618 sub personal_data_display {
|
Line 2682 sub personal_data_display {
|
&Apache::lonhtmlcommon::row_closure(1); |
&Apache::lonhtmlcommon::row_closure(1); |
$rowcount ++; |
$rowcount ++; |
} |
} |
my $submit_text = &mt('Create account'); |
if ($showsubmit) { |
$output .= &Apache::lonhtmlcommon::row_title()."\n". |
my $submit_text = &mt('Create account'); |
'<br /><input type="submit" name="createaccount" value="'. |
$output .= &Apache::lonhtmlcommon::row_title()."\n". |
$submit_text.'" />'. |
'<br /><input type="submit" name="createaccount" value="'. |
'<input type="hidden" name="type" value="'.$usertype.'" />'. |
$submit_text.'" />'; |
&Apache::lonhtmlcommon::row_closure(1); |
if ($usertype ne '') { |
|
$output .= '<input type="hidden" name="type" value="'. |
|
&HTML::Entities::encode($usertype,'\'<>"&').'" />'; |
|
} |
|
$output .= &Apache::lonhtmlcommon::row_closure(1); |
|
} |
} |
} |
$output .= &Apache::lonhtmlcommon::end_pick_box(); |
$output .= &Apache::lonhtmlcommon::end_pick_box(); |
if (wantarray) { |
if (wantarray) { |
Line 2825 sub update_user_data {
|
Line 2894 sub update_user_data {
|
$amode='localauth'; |
$amode='localauth'; |
$genpwd=$env{'form.locarg'}; |
$genpwd=$env{'form.locarg'}; |
$genpwd=" " if (!$genpwd); |
$genpwd=" " if (!$genpwd); |
|
} elsif ($env{'form.login'} eq 'lti') { |
|
$amode='lti'; |
|
$genpwd=" "; |
} elsif (($env{'form.login'} eq 'nochange') || |
} elsif (($env{'form.login'} eq 'nochange') || |
($env{'form.login'} eq '' )) { |
($env{'form.login'} eq '' )) { |
# There is no need to tell the user we did not change what they |
# There is no need to tell the user we did not change what they |
Line 2843 sub update_user_data {
|
Line 2915 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','timezone'); |
my @requestcourses = ('official','unofficial','community','textbook'); |
my @requestcourses = ('official','unofficial','community','textbook','placement','lti'); |
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 2973 sub update_user_data {
|
Line 3045 sub update_user_data {
|
$env{'form.ccdomain'},$env{'form.ccuname'}); |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
} |
} |
} |
} |
$r->print('<br />'.&mt('Home server').': '.$uhome.' '. |
$r->print('<br />'.&mt('Home Server').': '.$uhome.' '. |
&Apache::lonnet::hostname($uhome)); |
&Apache::lonnet::hostname($uhome)); |
} elsif (($env{'form.login'} ne 'nochange') && |
} elsif (($env{'form.login'} ne 'nochange') && |
($env{'form.login'} ne '' )) { |
($env{'form.login'} ne '' )) { |
Line 2988 sub update_user_data {
|
Line 3060 sub update_user_data {
|
&Apache::lonnet::modifyuserauth( |
&Apache::lonnet::modifyuserauth( |
$env{'form.ccdomain'},$env{'form.ccuname'}, |
$env{'form.ccdomain'},$env{'form.ccuname'}, |
$amode,$genpwd)); |
$amode,$genpwd)); |
$r->print('<br />'.&mt('Home server').': '.&Apache::lonnet::homeserver |
$r->print('<br />'.&mt('Home Server').': '.&Apache::lonnet::homeserver |
($env{'form.ccuname'},$env{'form.ccdomain'})); |
($env{'form.ccuname'},$env{'form.ccdomain'})); |
} else { |
} else { |
# Okay, this is a non-fatal error. |
# Okay, this is a non-fatal error. |
$r->print($error.&mt('You do not have privileges to modify the authentication configuration for this user.').$end); |
$r->print($error.&mt('You do not have privileges to modify the authentication configuration for this user.').$end); |
} |
} |
} elsif (($env{'form.intarg'} ne '') && |
} elsif (($env{'form.intarg'} ne '') && |
(&Apache::lonnet::queryauthenticate($env{'form.ccuname'},$env{'form.ccdomain'}) =~ /^internal:/) && |
(&Apache::lonnet::queryauthenticate($env{'form.ccuname'},$env{'form.ccdomain'}) =~ /^internal:/) && |
Line 3019 sub update_user_data {
|
Line 3091 sub update_user_data {
|
my %userenv = &Apache::lonnet::get |
my %userenv = &Apache::lonnet::get |
('environment',['firstname','middlename','lastname','generation', |
('environment',['firstname','middlename','lastname','generation', |
'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','tools.timezone', |
'requestcourses.official','requestcourses.unofficial', |
'requestcourses.official','requestcourses.unofficial', |
'requestcourses.community','requestcourses.textbook', |
'requestcourses.community','requestcourses.textbook', |
|
'requestcourses.lti','requestauthor', |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.official','reqcrsotherdom.unofficial', |
'reqcrsotherdom.community','reqcrsotherdom.textbook', |
'reqcrsotherdom.community','reqcrsotherdom.textbook', |
'requestauthor'], |
'reqcrsotherdom.placement'], |
$env{'form.ccdomain'},$env{'form.ccuname'}); |
$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) { |
Line 3054 sub update_user_data {
|
Line 3128 sub update_user_data {
|
} |
} |
} elsif ($context eq 'author') { |
} elsif ($context eq 'author') { |
if ($rolenum eq $auname && $roledom eq $audom) { |
if ($rolenum eq $auname && $roledom eq $audom) { |
if (!grep(/^\Q$role\E$/,@userroles)) { |
if (!grep(/^\Q$role\E$/,@userroles)) { |
push(@userroles,$role); |
push(@userroles,$role); |
} |
} |
} |
} |
Line 3315 sub update_user_data {
|
Line 3389 sub update_user_data {
|
($env{'user.domain'} eq $env{'form.ccdomain'})) { |
($env{'user.domain'} eq $env{'form.ccdomain'})) { |
my %newenvhash; |
my %newenvhash; |
foreach my $key (keys(%changed)) { |
foreach my $key (keys(%changed)) { |
if (($key eq 'official') || ($key eq 'unofficial') |
if (($key eq 'official') || ($key eq 'unofficial') || |
|| ($key eq 'community') || ($key eq 'textbook')) { |
($key eq 'community') || ($key eq 'textbook') || |
|
($key eq 'placement') || ($key eq 'lti')) { |
$newenvhash{'environment.requestcourses.'.$key} = |
$newenvhash{'environment.requestcourses.'.$key} = |
$changeHash{'requestcourses.'.$key}; |
$changeHash{'requestcourses.'.$key}; |
if ($changeHash{'requestcourses.'.$key}) { |
if ($changeHash{'requestcourses.'.$key}) { |
Line 3352 sub update_user_data {
|
Line 3427 sub update_user_data {
|
&Apache::lonnet::appenv(\%newenvhash); |
&Apache::lonnet::appenv(\%newenvhash); |
} |
} |
} |
} |
|
if ($changed{'aboutme'}) { |
|
&Apache::loncommon::devalidate_aboutme_cache($env{'form.ccuname'}, |
|
$env{'form.ccdomain'}); |
|
} |
} |
} |
} |
} |
if (keys(%namechanged) > 0) { |
if (keys(%namechanged) > 0) { |
Line 3382 sub update_user_data {
|
Line 3461 sub update_user_data {
|
\%newsettingstext); |
\%newsettingstext); |
if ($env{'form.cid'} ne $userenv{'id'}) { |
if ($env{'form.cid'} ne $userenv{'id'}) { |
&Apache::lonnet::idput($env{'form.ccdomain'}, |
&Apache::lonnet::idput($env{'form.ccdomain'}, |
{$env{'form.ccuname'} => $env{'form.cid'}}); |
{$env{'form.ccuname'} => $env{'form.cid'}},$uhome,'ids'); |
if (($recurseid) && |
if (($recurseid) && |
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { |
(&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) { |
my $idresult = |
my $idresult = |
Line 3521 sub display_userinfo {
|
Line 3600 sub display_userinfo {
|
'webdav' => 'WebDAV Availability', |
'webdav' => 'WebDAV Availability', |
'aboutme' => 'Personal Information Page Availability', |
'aboutme' => 'Personal Information Page Availability', |
'portfolio' => 'Portfolio Availability', |
'portfolio' => 'Portfolio Availability', |
|
'timezone' => 'Can set own Time Zone', |
'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', |
'textbook' => 'Can Request Textbook Courses', |
|
'placement' => 'Can Request Placement Tests', |
|
'lti' => 'Can Request LTI Courses', |
'requestauthor' => 'Can Request Author Role', |
'requestauthor' => 'Can Request Author Role', |
'inststatus' => "Affiliation", |
'inststatus' => "Affiliation", |
'prvs' => 'Previous Value:', |
'prvs' => 'Previous Value:', |
Line 3895 sub update_roles {
|
Line 3977 sub update_roles {
|
my ($r,$context,$showcredits) = @_; |
my ($r,$context,$showcredits) = @_; |
my $now=time; |
my $now=time; |
my @rolechanges; |
my @rolechanges; |
my %disallowed; |
my (%disallowed,%got_role_approvals,%got_instdoms,%process_by,%instdoms, |
|
%pending,%reject,%notifydc,%status,%unauthorized,%currqueued); |
|
$got_role_approvals{$context} = ''; |
|
$process_by{$context} = {}; |
|
my @domroles = &Apache::lonuserutils::domain_roles(); |
|
my @cstrroles = &Apache::lonuserutils::construction_space_roles(); |
|
my @courseroles = &Apache::lonuserutils::roles_by_context('course',1); |
$r->print('<h3>'.&mt('Modifying Roles').'</h3>'); |
$r->print('<h3>'.&mt('Modifying Roles').'</h3>'); |
foreach my $key (keys(%env)) { |
foreach my $key (keys(%env)) { |
next if (! $env{$key}); |
next if (! $env{$key}); |
Line 3997 sub update_roles {
|
Line 4085 sub update_roles {
|
if ($key=~/^form\.ren\:([^\_]+)\_([^\_\.]+)$/) { |
if ($key=~/^form\.ren\:([^\_]+)\_([^\_\.]+)$/) { |
my $url = $1; |
my $url = $1; |
my $role = $2; |
my $role = $2; |
|
my $id = $url.'_'.$role; |
my $logmsg; |
my $logmsg; |
my $output; |
my $output; |
if ($role eq 'st') { |
if ($role eq 'st') { |
Line 4004 sub update_roles {
|
Line 4093 sub update_roles {
|
my ($cdom,$cnum,$csec) = ($1,$2,$3); |
my ($cdom,$cnum,$csec) = ($1,$2,$3); |
my $credits; |
my $credits; |
if ($showcredits) { |
if ($showcredits) { |
my $defaultcredits = |
my $defaultcredits = |
&Apache::lonuserutils::get_defaultcredits($cdom,$cnum); |
&Apache::lonuserutils::get_defaultcredits($cdom,$cnum); |
$credits = &get_user_credits($defaultcredits,$cdom,$cnum); |
$credits = &get_user_credits($defaultcredits,$cdom,$cnum); |
} |
} |
|
unless ($udom eq $cdom) { |
|
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
|
$uname,$role,$now,0,$cdom,$cnum,$csec,$credits, |
|
\%process_by,\%instdoms,\%got_role_approvals, |
|
\%got_instdoms,\%reject,\%pending,\%notifydc, |
|
\%status,\%unauthorized,\%currqueued)); |
|
} |
my $result = &Apache::loncommon::commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$cdom,$cnum,$csec,$context,$credits); |
my $result = &Apache::loncommon::commit_studentrole(\$logmsg,$udom,$uname,$url,$role,$now,0,$cdom,$cnum,$csec,$context,$credits); |
if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course') || ($result eq 'refused')) { |
if (($result =~ /^error/) || ($result eq 'not_in_class') || ($result eq 'unknown_course') || ($result eq 'refused')) { |
if ($result eq 'refused' && $logmsg) { |
if ($result eq 'refused' && $logmsg) { |
Line 4023 sub update_roles {
|
Line 4119 sub update_roles {
|
} |
} |
} |
} |
} else { |
} else { |
|
my ($cdom,$cnum,$csec); |
|
if (grep(/^\Q$role\E$/,@cstrroles)) { |
|
($cdom,$cnum) = ($url =~ m{^/($match_domain)/($match_username)$}); |
|
} elsif (grep(/^\Q$role\E$/,@domroles)) { |
|
($cdom) = ($url =~ m{^/($match_domain)/$}); |
|
} elsif ($url =~ m-^/($match_domain)/($match_courseid)/?(\w*)$-) { |
|
($cdom,$cnum,$csec) = ($1,$2,$3); |
|
} |
|
if ($cdom ne '') { |
|
unless ($udom eq $cdom) { |
|
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
|
$uname,$role,$now,0,$cdom,$cnum,$csec,'',\%process_by, |
|
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
|
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)); |
|
} |
|
} |
my $result=&Apache::lonnet::assignrole($env{'form.ccdomain'}, |
my $result=&Apache::lonnet::assignrole($env{'form.ccdomain'}, |
$env{'form.ccuname'},$url,$role,0,$now,'','', |
$env{'form.ccuname'},$url,$role,0,$now,'','', |
$context); |
$context); |
$output = &Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling [_1] in [_2]', |
$output = &Apache::lonhtmlcommon::confirm_success(&mt('Re-enabling [_1] in [_2]', |
&Apache::lonnet::plaintext($role), |
&Apache::lonnet::plaintext($role), |
&Apache::loncommon::show_role_extent($url,$context,$role)),$result ne "ok").'<br />'; |
&Apache::loncommon::show_role_extent($url,$context,$role)),$result ne "ok").'<br />'; |
if ($result ne "ok") { |
if ($result ne "ok") { |
$output .= &mt('Error: [_1]',$result).'<br />'; |
$output .= &mt('Error: [_1]',$result).'<br />'; |
} |
} |
Line 4041 sub update_roles {
|
Line 4153 sub update_roles {
|
# Re-enable custom role |
# Re-enable custom role |
if ($key=~m{^form\.ren\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
if ($key=~m{^form\.ren\:([^_]+)_cr\.cr/($match_domain)/($match_username)/(\w+)$}) { |
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4); |
my ($url,$rdom,$rnam,$rolename) = ($1,$2,$3,$4); |
|
my $id = $url.'_cr'."/$rdom/$rnam/$rolename"; |
|
my $role = "cr/$rdom/$rnam/$rolename"; |
|
if ($url =~ m-^/($match_domain)/($match_courseid)/?(\w*)$-) { |
|
my ($cdom,$cnum,$csec) = ($1,$2,$3); |
|
unless ($udom eq $cdom) { |
|
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
|
$uname,$role,$now,0,$cdom,$cnum,$csec,'',\%process_by, |
|
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
|
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)); |
|
} |
|
} |
my $result = &Apache::lonnet::assigncustomrole( |
my $result = &Apache::lonnet::assigncustomrole( |
$env{'form.ccdomain'}, $env{'form.ccuname'}, |
$env{'form.ccdomain'}, $env{'form.ccuname'}, |
$url,$rdom,$rnam,$rolename,0,$now,undef,$context); |
$url,$rdom,$rnam,$rolename,0,$now,undef,$context); |
Line 4062 sub update_roles {
|
Line 4185 sub update_roles {
|
# Activate a custom role |
# Activate a custom role |
my ($one,$two,$three,$four,$five)=($1,$2,$3,$4,$5); |
my ($one,$two,$three,$four,$five)=($1,$2,$3,$4,$5); |
my $url='/'.$one.'/'.$two; |
my $url='/'.$one.'/'.$two; |
|
my $id = $url.'_cr/'."$three/$four/$five"; |
|
my $role = "cr/$three/$four/$five"; |
my $full=$one.'_'.$two.'_cr_cr_'.$three.'_'.$four.'_'.$five; |
my $full=$one.'_'.$two.'_cr_cr_'.$three.'_'.$four.'_'.$five; |
|
|
my $start = ( $env{'form.start_'.$full} ? |
my $start = ( $env{'form.start_'.$full} ? |
Line 4070 sub update_roles {
|
Line 4195 sub update_roles {
|
my $end = ( $env{'form.end_'.$full} ? |
my $end = ( $env{'form.end_'.$full} ? |
$env{'form.end_'.$full} : |
$env{'form.end_'.$full} : |
0 ); |
0 ); |
|
|
# split multiple sections |
# split multiple sections |
my %sections = (); |
my %sections = (); |
my $num_sections = &build_roles($env{'form.sec_'.$full},\%sections,$5); |
my $num_sections = &build_roles($env{'form.sec_'.$full},\%sections,$five); |
if ($num_sections == 0) { |
if ($num_sections == 0) { |
|
unless ($udom eq $one) { |
|
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
|
$uname,$role,$start,$end,$one,$two,'','',\%process_by, |
|
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
|
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)); |
|
} |
$r->print(&Apache::loncommon::commit_customrole($udom,$uname,$url,$three,$four,$five,$start,$end,$context)); |
$r->print(&Apache::loncommon::commit_customrole($udom,$uname,$url,$three,$four,$five,$start,$end,$context)); |
} else { |
} else { |
my %curr_groups = |
my %curr_groups = |
&Apache::longroup::coursegroups($one,$two); |
&Apache::longroup::coursegroups($one,$two); |
|
my ($restricted,$numchanges); |
foreach my $sec (sort {$a cmp $b} keys(%sections)) { |
foreach my $sec (sort {$a cmp $b} keys(%sections)) { |
if (($sec eq 'none') || ($sec eq 'all') || |
if (($sec eq 'none') || ($sec eq 'all') || |
exists($curr_groups{$sec})) { |
exists($curr_groups{$sec})) { |
Line 4086 sub update_roles {
|
Line 4218 sub update_roles {
|
next; |
next; |
} |
} |
my $securl = $url.'/'.$sec; |
my $securl = $url.'/'.$sec; |
|
my $secid = $securl.'_cr'."/$three/$four/$five"; |
|
undef($restricted); |
|
unless ($udom eq $one) { |
|
next if (&Apache::lonuserutils::restricted_dom($context,$secid,$udom, |
|
$uname,$role,$start,$end,$one,$two,$sec,'',\%process_by, |
|
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
|
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)); |
|
} |
|
$numchanges ++; |
$r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end,$context)); |
$r->print(&Apache::loncommon::commit_customrole($udom,$uname,$securl,$three,$four,$five,$start,$end,$context)); |
} |
} |
|
next unless ($numchanges); |
} |
} |
if (!grep(/^cr$/,@rolechanges)) { |
if (!grep(/^cr$/,@rolechanges)) { |
push(@rolechanges,'cr'); |
push(@rolechanges,'cr'); |
Line 4096 sub update_roles {
|
Line 4238 sub update_roles {
|
# Activate roles for sections with 3 id numbers |
# Activate roles for sections with 3 id numbers |
# set start, end times, and the url for the class |
# set start, end times, and the url for the class |
my ($one,$two,$three)=($1,$2,$3); |
my ($one,$two,$three)=($1,$2,$3); |
my $start = ( $env{'form.start_'.$one.'_'.$two.'_'.$three} ? |
my $start = ( $env{'form.start_'.$one.'_'.$two.'_'.$three} ? |
$env{'form.start_'.$one.'_'.$two.'_'.$three} : |
$env{'form.start_'.$one.'_'.$two.'_'.$three} : |
$now ); |
$now ); |
my $end = ( $env{'form.end_'.$one.'_'.$two.'_'.$three} ? |
my $end = ( $env{'form.end_'.$one.'_'.$two.'_'.$three} ? |
$env{'form.end_'.$one.'_'.$two.'_'.$three} : |
$env{'form.end_'.$one.'_'.$two.'_'.$three} : |
0 ); |
0 ); |
my $url='/'.$one.'/'.$two; |
my $url='/'.$one.'/'.$two; |
|
my $id = $url.'_'.$three; |
my $type = 'three'; |
my $type = 'three'; |
# split multiple sections |
# split multiple sections |
my %sections = (); |
my %sections = (); |
my $num_sections = &build_roles($env{'form.sec_'.$one.'_'.$two.'_'.$three},\%sections,$three); |
my $num_sections = &build_roles($env{'form.sec_'.$one.'_'.$two.'_'.$three},\%sections,$three); |
my $credits; |
my ($credits,$numchanges); |
if ($three eq 'st') { |
if ($three eq 'st') { |
if ($showcredits) { |
if ($showcredits) { |
my $defaultcredits = |
my $defaultcredits = |
&Apache::lonuserutils::get_defaultcredits($one,$two); |
&Apache::lonuserutils::get_defaultcredits($one,$two); |
$credits = $env{'form.credits_'.$one.'_'.$two.'_'.$three}; |
$credits = $env{'form.credits_'.$one.'_'.$two.'_'.$three}; |
Line 4120 sub update_roles {
|
Line 4263 sub update_roles {
|
} |
} |
} |
} |
if ($num_sections == 0) { |
if ($num_sections == 0) { |
|
unless ($udom eq $one) { |
|
next if (&Apache::lonuserutils::restricted_dom($context,$id,$udom, |
|
$uname,$three,$start,$end,$one,$two,'',$credits,\%process_by, |
|
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
|
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)); |
|
} |
|
$numchanges ++; |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,'',$context,$credits)); |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,'',$context,$credits)); |
} else { |
} else { |
my %curr_groups = |
my %curr_groups = |
&Apache::longroup::coursegroups($one,$two); |
&Apache::longroup::coursegroups($one,$two); |
my $emptysec = 0; |
my $emptysec = 0; |
|
my $restricted; |
foreach my $sec (sort {$a cmp $b} keys(%sections)) { |
foreach my $sec (sort {$a cmp $b} keys(%sections)) { |
$sec =~ s/\W//g; |
$sec =~ s/\W//g; |
if ($sec ne '') { |
if ($sec ne '') { |
Line 4134 sub update_roles {
|
Line 4285 sub update_roles {
|
next; |
next; |
} |
} |
my $securl = $url.'/'.$sec; |
my $securl = $url.'/'.$sec; |
|
my $secid = $securl.'_'.$three; |
|
unless ($udom eq $one) { |
|
undef($restricted); |
|
$restricted = &Apache::lonuserutils::restricted_dom($context,$secid,$udom, |
|
$uname,$three,$start,$end,$one,$two,$sec,$credits,\%process_by, |
|
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
|
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued); |
|
next if ($restricted); |
|
} |
|
$numchanges ++; |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$three,$start,$end,$one,$two,$sec,$context,$credits)); |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$three,$start,$end,$one,$two,$sec,$context,$credits)); |
} else { |
} else { |
$emptysec = 1; |
$emptysec = 1; |
} |
} |
} |
} |
if ($emptysec) { |
if ($emptysec) { |
|
unless ($udom eq $one) { |
|
undef($restricted); |
|
$restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom, |
|
$uname,$three,$start,$end,$one,$two,'',$credits,\%process_by, |
|
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
|
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued); |
|
next if ($restricted); |
|
} |
|
$numchanges ++; |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,'',$context,$credits)); |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$three,$start,$end,$one,$two,'',$context,$credits)); |
} |
} |
|
next unless ($numchanges); |
} |
} |
if (!grep(/^\Q$three\E$/,@rolechanges)) { |
if (!grep(/^\Q$three\E$/,@rolechanges)) { |
push(@rolechanges,$three); |
push(@rolechanges,$three); |
Line 4149 sub update_roles {
|
Line 4320 sub update_roles {
|
} elsif ($key=~/^form\.act\_([^\_]+)\_([^\_]+)$/) { |
} elsif ($key=~/^form\.act\_([^\_]+)\_([^\_]+)$/) { |
# Activate roles for sections with two id numbers |
# Activate roles for sections with two id numbers |
# set start, end times, and the url for the class |
# set start, end times, and the url for the class |
my $start = ( $env{'form.start_'.$1.'_'.$2} ? |
my $start = ( $env{'form.start_'.$1.'_'.$2} ? |
$env{'form.start_'.$1.'_'.$2} : |
$env{'form.start_'.$1.'_'.$2} : |
$now ); |
$now ); |
my $end = ( $env{'form.end_'.$1.'_'.$2} ? |
my $end = ( $env{'form.end_'.$1.'_'.$2} ? |
$env{'form.end_'.$1.'_'.$2} : |
$env{'form.end_'.$1.'_'.$2} : |
0 ); |
0 ); |
my $one = $1; |
my $one = $1; |
my $two = $2; |
my $two = $2; |
my $url='/'.$one.'/'; |
my $url='/'.$one.'/'; |
|
my $id = $url.'_'.$two; |
# split multiple sections |
# split multiple sections |
my %sections = (); |
my %sections = (); |
|
my ($restricted,$numchanges); |
my $num_sections = &build_roles($env{'form.sec_'.$one.'_'.$two},\%sections,$two); |
my $num_sections = &build_roles($env{'form.sec_'.$one.'_'.$two},\%sections,$two); |
if ($num_sections == 0) { |
if ($num_sections == 0) { |
|
unless ($udom eq $one) { |
|
$restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom, |
|
$uname,$two,$start,$end,$one,$two,'','',\%process_by, |
|
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
|
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued); |
|
next if ($restricted); |
|
} |
|
$numchanges ++; |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$two,$start,$end,$one,undef,'',$context)); |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$two,$start,$end,$one,undef,'',$context)); |
} else { |
} else { |
my $emptysec = 0; |
my $emptysec = 0; |
foreach my $sec (sort {$a cmp $b} keys(%sections)) { |
foreach my $sec (sort {$a cmp $b} keys(%sections)) { |
if ($sec ne '') { |
if ($sec ne '') { |
my $securl = $url.'/'.$sec; |
my $securl = $url.'/'.$sec; |
|
my $secid = $securl.'_'.$two; |
|
unless ($udom eq $one) { |
|
undef($restricted); |
|
$restricted = &Apache::lonuserutils::restricted_dom($context,$secid,$udom, |
|
$uname,$two,$start,$end,$one,$two,$sec,'',\%process_by, |
|
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
|
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued); |
|
next if ($restricted); |
|
} |
|
$numchanges ++; |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$two,$start,$end,$one,undef,$sec,$context)); |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$securl,$two,$start,$end,$one,undef,$sec,$context)); |
} else { |
} else { |
$emptysec = 1; |
$emptysec = 1; |
} |
} |
} |
} |
if ($emptysec) { |
if ($emptysec) { |
|
unless ($udom eq $one) { |
|
undef($restricted); |
|
$restricted = &Apache::lonuserutils::restricted_dom($context,$id,$udom, |
|
$uname,$two,$start,$end,$one,$two,'','',\%process_by, |
|
\%instdoms,\%got_role_approvals,\%got_instdoms,\%reject, |
|
\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued); |
|
next if ($restricted); |
|
} |
|
$numchanges ++; |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$two,$start,$end,$one,undef,'',$context)); |
$r->print(&Apache::loncommon::commit_standardrole($udom,$uname,$url,$two,$start,$end,$one,undef,'',$context)); |
} |
} |
|
next unless ($numchanges); |
} |
} |
if (!grep(/^\Q$two\E$/,@rolechanges)) { |
if (!grep(/^\Q$two\E$/,@rolechanges)) { |
push(@rolechanges,$two); |
push(@rolechanges,$two); |
Line 4199 sub update_roles {
|
Line 4400 sub update_roles {
|
} |
} |
} |
} |
} # End of foreach (keys(%env)) |
} # End of foreach (keys(%env)) |
|
if ((keys(%reject)) || (keys(%unauthorized))) { |
|
$r->print(&Apache::lonuserutils::print_roles_rejected($context,\%reject,\%unauthorized)); |
|
} |
|
if ((keys(%pending)) || (keys(%currqueued))) { |
|
$r->print(&Apache::lonuserutils::print_roles_queued($context,\%pending,\%notifydc,\%currqueued)); |
|
} |
# Flush the course logs so reverse user roles immediately updated |
# Flush the course logs so reverse user roles immediately updated |
$r->register_cleanup(\&Apache::lonnet::flushcourselogs); |
$r->register_cleanup(\&Apache::lonnet::flushcourselogs); |
if (@rolechanges == 0) { |
if (@rolechanges == 0) { |
Line 4253 sub enroll_single_student {
|
Line 4460 sub enroll_single_student {
|
} |
} |
} |
} |
} |
} |
|
my ($startdate,$enddate) = &Apache::lonuserutils::get_dates_from_form(); |
|
my (%got_role_approvals,%got_instdoms,%process_by,%instdoms,%pending,%reject,%notifydc, |
|
%status,%unauthorized,%currqueued); |
|
unless ($env{'form.ccdomain'} eq $env{'course.'.$env{'request.course.id'}.'.domain'}) { |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $csec = $env{'form.sections'}; |
|
my $id = "/$cdom/$cnum"; |
|
if ($csec ne '') { |
|
$id .= "/$csec"; |
|
} |
|
$id .= '_st'; |
|
if (&Apache::lonuserutils::restricted_dom($context,$id,$env{'form.ccdomain'},$env{'form.ccuname'}, |
|
'st',$startdate,$enddate,$cdom,$cnum,$csec,$credits, |
|
\%process_by,\%instdoms,\%got_role_approvals,\%got_instdoms, |
|
\%reject,\%pending,\%notifydc,\%status,\%unauthorized,\%currqueued)) { |
|
if ((keys(%reject)) || (keys(%unauthorized))) { |
|
$r->print(&Apache::lonuserutils::print_roles_rejected($context,\%reject,\%unauthorized)); |
|
} |
|
if ((keys(%pending)) || (keys(%currqueued))) { |
|
$r->print(&Apache::lonuserutils::print_roles_queued($context,\%pending,\%notifydc,\%currqueued)); |
|
} |
|
return; |
|
} |
|
} |
|
|
# Clean out any old student roles the user has in this class. |
# Clean out any old student roles the user has in this class. |
&Apache::lonuserutils::modifystudent($env{'form.ccdomain'}, |
&Apache::lonuserutils::modifystudent($env{'form.ccdomain'}, |
$env{'form.ccuname'},$env{'request.course.id'},undef,$uhome); |
$env{'form.ccuname'},$env{'request.course.id'},undef,$uhome); |
my ($startdate,$enddate) = &Apache::lonuserutils::get_dates_from_form(); |
|
my $enroll_result = |
my $enroll_result = |
&Apache::lonnet::modify_student_enrollment($env{'form.ccdomain'}, |
&Apache::lonnet::modify_student_enrollment($env{'form.ccdomain'}, |
$env{'form.ccuname'},$env{'form.cid'},$env{'form.cfirstname'}, |
$env{'form.ccuname'},$env{'form.cid'},$env{'form.cfirstname'}, |
Line 4619 sub set_custom_role {
|
Line 4850 sub set_custom_role {
|
); |
); |
} |
} |
|
|
|
sub show_role_requests { |
|
my ($caller,$dom) = @_; |
|
my $showrolereqs; |
|
my %domconfig = &Apache::lonnet::get_dom('configuration',['privacy'],$dom); |
|
if (ref($domconfig{'privacy'}) eq 'HASH') { |
|
if (ref($domconfig{'privacy'}{'approval'}) eq 'HASH') { |
|
my %approvalconf = %{$domconfig{'privacy'}{'approval'}}; |
|
foreach my $key ('instdom','extdom') { |
|
if (ref($approvalconf{$key}) eq 'HASH') { |
|
if (keys(%{$approvalconf{$key}})) { |
|
foreach my $context ('domain','author','course','community') { |
|
if ($approvalconf{$key}{$context} eq $caller) { |
|
$showrolereqs = 1; |
|
last if ($showrolereqs); |
|
} |
|
} |
|
} |
|
} |
|
last if ($showrolereqs); |
|
} |
|
} |
|
} |
|
return $showrolereqs; |
|
} |
|
|
# ================================================================ Main Handler |
# ================================================================ Main Handler |
sub handler { |
sub handler { |
my $r = shift; |
my $r = shift; |
Line 4766 sub handler {
|
Line 5022 sub handler {
|
if (! exists($env{'form.state'})) { |
if (! exists($env{'form.state'})) { |
&Apache::lonuserutils::print_first_users_upload_form($r,$context); |
&Apache::lonuserutils::print_first_users_upload_form($r,$context); |
} elsif ($env{'form.state'} eq 'got_file') { |
} elsif ($env{'form.state'} eq 'got_file') { |
my $result = |
my $result = |
&Apache::lonuserutils::print_upload_manager_form($r,$context, |
&Apache::lonuserutils::print_upload_manager_form($r,$context, |
$permission, |
$permission, |
$crstype,$showcredits); |
$crstype,$showcredits); |
Line 5080 sub handler {
|
Line 5336 sub handler {
|
&Apache::lonhtmlcommon::row_closure(1)); |
&Apache::lonhtmlcommon::row_closure(1)); |
} |
} |
} |
} |
if ($pickstart) { |
if ($pickstart) { |
$r->print(&Apache::lonhtmlcommon::end_pick_box().'</div>'); |
$r->print(&Apache::lonhtmlcommon::end_pick_box().'</div>'); |
} else { |
} else { |
$r->print('<div>'.&mt('No information to display for this account request.').'</div>'); |
$r->print('<div>'.&mt('No information to display for this account request.').'</div>'); |
Line 5284 sub handler {
|
Line 5540 sub handler {
|
'<span class="LC_error">'.&mt('You do not have permission to view change logs').'</span>'); |
'<span class="LC_error">'.&mt('You do not have permission to view change logs').'</span>'); |
} |
} |
} elsif ($env{'form.action'} eq 'helpdesk') { |
} elsif ($env{'form.action'} eq 'helpdesk') { |
if (($permission->{'owner'}) || ($permission->{'co-owner'})) { |
if (($permission->{'owner'} || $permission->{'co-owner'}) && |
|
($permission->{'cusr'} || $permission->{'view'})) { |
if ($env{'form.state'} eq 'process') { |
if ($env{'form.state'} eq 'process') { |
if ($permission->{'owner'}) { |
if ($permission->{'owner'}) { |
&update_helpdeskaccess($r,$permission,$brcrum); |
&update_helpdeskaccess($r,$permission,$brcrum); |
Line 5298 sub handler {
|
Line 5555 sub handler {
|
$r->print(&header(undef,{'no_nav_bar' => 1}). |
$r->print(&header(undef,{'no_nav_bar' => 1}). |
'<span class="LC_error">'.&mt('You do not have permission to view helpdesk access').'</span>'); |
'<span class="LC_error">'.&mt('You do not have permission to view helpdesk access').'</span>'); |
} |
} |
|
} elsif ($env{'form.action'} eq 'rolerequests') { |
|
if ($permission->{cusr} || $permission->{view}) { |
|
&print_queued_roles($r,$context,$permission,$brcrum); |
|
} |
|
} elsif ($env{'form.action'} eq 'queuedroles') { |
|
if (($permission->{cusr}) && ($context eq 'domain')) { |
|
if (&show_role_requests($context,$env{'request.role.domain'})) { |
|
if ($env{'form.state'} eq 'done') { |
|
&process_pendingroles($r,$context,$permission,$brcrum); |
|
} else { |
|
&print_pendingroles($r,$context,$permission,$brcrum); |
|
} |
|
} else { |
|
$r->print(&header(undef,{'no_nav_bar' => 1}). |
|
'<span class="LC_info">'.&mt('Domain coordinator approval of requests from other domains for assignment of roles to users from this domain not in use.').'</span>'); |
|
} |
|
} else { |
|
$r->print(&header(undef,{'no_nav_bar' => 1}). |
|
'<span class="LC_error">'.&mt('You do not have permission to view queued requests from other domains for assignment of roles to users from this domain.').'</span>'); |
|
} |
} else { |
} else { |
$bread_crumbs_component = 'User Management'; |
$bread_crumbs_component = 'User Management'; |
$args = { bread_crumbs => $brcrum, |
$args = { bread_crumbs => $brcrum, |
Line 5549 sub print_main_menu {
|
Line 5826 sub print_main_menu {
|
listusers => 'Show and manage users in this community.', |
listusers => 'Show and manage users in this community.', |
}, |
}, |
); |
); |
|
|
if ($linkcontext eq 'domain') { |
if ($linkcontext eq 'domain') { |
unless ($permission->{'cusr'}) { |
unless ($permission->{'cusr'}) { |
$links{'domain'}{'singleuser'} = 'View a User'; |
$links{'domain'}{'singleuser'} = 'View a User'; |
Line 5670 sub print_main_menu {
|
Line 5948 sub print_main_menu {
|
groups => 'Community Groups', |
groups => 'Community Groups', |
}, |
}, |
); |
); |
|
$linktext{'Placement'} = $linktext{'Course'}; |
|
|
my %linktitle = ( |
my %linktitle = ( |
'Course' => { |
'Course' => { |
Line 5684 sub print_main_menu {
|
Line 5963 sub print_main_menu {
|
}, |
}, |
); |
); |
|
|
|
$linktitle{'Placement'} = $linktitle{'Course'}; |
|
|
push(@{ $menu[0]->{items} }, #Category: Single Users |
push(@{ $menu[0]->{items} }, #Category: Single Users |
{ |
{ |
linktext => $linktext{$crstype}{'single'}, |
linktext => $linktext{$crstype}{'single'}, |
Line 5711 sub print_main_menu {
|
Line 5992 sub print_main_menu {
|
icon => 'helpdesk-access.png', |
icon => 'helpdesk-access.png', |
#help => 'Course_Helpdesk_Access', |
#help => 'Course_Helpdesk_Access', |
url => '/adm/createuser?action=helpdesk', |
url => '/adm/createuser?action=helpdesk', |
permission => ($permission->{'owner'} || $permission->{'co-owner'}), |
permission => (($permission->{'owner'} || $permission->{'co-owner'}) && |
|
($permission->{'view'} || $permission->{'cusr'})), |
linktitle => 'Helpdesk access options', |
linktitle => 'Helpdesk access options', |
}, |
}, |
{ |
{ |
Line 5790 sub print_main_menu {
|
Line 6072 sub print_main_menu {
|
}, |
}, |
); |
); |
} |
} |
|
push(@{ $menu[2]->{items} }, |
|
{ |
|
linktext => 'Role Requests (other domains)', |
|
icon => 'edit-find.png', |
|
#help => 'Role_Requests', |
|
url => '/adm/createuser?action=rolerequests', |
|
permission => $permission->{'cusr'}, |
|
linktitle => 'Role requests for users in other domains', |
|
}, |
|
); |
|
if (&show_role_requests($context,$env{'request.role.domain'})) { |
|
push(@{ $menu[2]->{items} }, |
|
{ |
|
linktext => 'Queued Role Assignments (this domain)', |
|
icon => 'edit-find.png', |
|
#help => 'Role_Approvals', |
|
url => '/adm/createuser?action=queuedroles', |
|
permission => $permission->{'cusr'}, |
|
linktitle => "Role requests for this domain's users", |
|
}, |
|
); |
|
} |
return Apache::lonhtmlcommon::generate_menu(@menu); |
return Apache::lonhtmlcommon::generate_menu(@menu); |
# { text => 'View Log-in History', |
# { text => 'View Log-in History', |
# help => 'Course_User_Logins', |
# help => 'Course_User_Logins', |
Line 6186 ENDSCRIPT
|
Line 6490 ENDSCRIPT
|
} elsif ($curr_types eq '') { |
} elsif ($curr_types eq '') { |
$add_domtitle = &mt('Users in other domain:'); |
$add_domtitle = &mt('Users in other domain:'); |
} |
} |
|
my ($trusted,$untrusted) = &Apache::lonnet::trusted_domains('enroll',$cdom); |
$output .= &Apache::loncommon::start_data_table_row() |
$output .= &Apache::loncommon::start_data_table_row() |
.'<td colspan="2"><span class="LC_nobreak">'.$add_domtitle.'</span><br />' |
.'<td colspan="2"><span class="LC_nobreak">'.$add_domtitle.'</span><br />' |
.&Apache::loncommon::select_dom_form('','selfenroll_newdom', |
.&Apache::loncommon::select_dom_form('','selfenroll_newdom', |
$includeempty,$showdomdesc,'','','',$readonly) |
$includeempty,$showdomdesc,'',$trusted,$untrusted,$readonly) |
.'<input type="hidden" name="selfenroll_types_total" value="'.$num.'" />' |
.'<input type="hidden" name="selfenroll_types_total" value="'.$num.'" />' |
.'</td>'.&Apache::loncommon::end_data_table_row() |
.'</td>'.&Apache::loncommon::end_data_table_row() |
.&Apache::loncommon::end_data_table(); |
.&Apache::loncommon::end_data_table(); |
Line 7077 ENDSCRIPT
|
Line 7382 ENDSCRIPT
|
my ($nav_script,$nav_links); |
my ($nav_script,$nav_links); |
|
|
# table header |
# table header |
my $tableheader = '<h3>'. |
my $heading = '<h3>'. |
&mt('User access logs for: [_1]', |
&mt('User access logs for: [_1]', |
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom),$uname,$udom)).'</h3>' |
&Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom),$uname,$udom)).'</h3>'; |
|
my $tableheader = $heading |
.&Apache::loncommon::start_data_table_header_row() |
.&Apache::loncommon::start_data_table_header_row() |
.'<th> </th>' |
.'<th> </th>' |
.'<th>'.&mt('When').'</th>' |
.'<th>'.&mt('When').'</th>' |
Line 7197 ENDSCRIPT
|
Line 7503 ENDSCRIPT
|
$r->print(&Apache::loncommon::end_data_table(). |
$r->print(&Apache::loncommon::end_data_table(). |
&userlogdisplay_navlinks(\%curr,$more_records)); |
&userlogdisplay_navlinks(\%curr,$more_records)); |
} else { # No content displayed above |
} else { # No content displayed above |
$r->print('<p class="LC_info">' |
$r->print($heading.'<p class="LC_info">' |
.&mt('There are no records to display.') |
.&mt('There are no records to display.') |
.'</p>'); |
.'</p>'); |
} |
} |
Line 7334 sub userlogdisplay_navlinks {
|
Line 7640 sub userlogdisplay_navlinks {
|
|
|
sub role_display_filter { |
sub role_display_filter { |
my ($context,$formname,$cdom,$cnum,$curr,$version,$crstype) = @_; |
my ($context,$formname,$cdom,$cnum,$curr,$version,$crstype) = @_; |
my $lctype; |
|
if ($context eq 'course') { |
|
$lctype = lc($crstype); |
|
} |
|
my $nolink = 1; |
my $nolink = 1; |
my $output = '<table><tr><td valign="top">'. |
my $output = '<table><tr><td valign="top">'. |
'<span class="LC_nobreak"><b>'.&mt('Changes/page:').'</b></span><br />'. |
'<span class="LC_nobreak"><b>'.&mt('Changes/page:').'</b></span><br />'. |
Line 7365 sub role_display_filter {
|
Line 7667 sub role_display_filter {
|
if ($curr->{'role'} eq 'any') { |
if ($curr->{'role'} eq 'any') { |
$output .= ' selected="selected"'; |
$output .= ' selected="selected"'; |
} |
} |
$output .= '>'.&mt('Any').'</option>'."\n"; |
$output .= '>'.&mt('Any').'</option>'."\n"; |
my @roles = &Apache::lonuserutils::roles_by_context($context,1,$crstype); |
my @roles = &Apache::lonuserutils::roles_by_context($context,1,$crstype); |
foreach my $role (@roles) { |
foreach my $role (@roles) { |
my $plrole; |
my $plrole; |
Line 7386 sub role_display_filter {
|
Line 7688 sub role_display_filter {
|
&mt('Context:').'</b><br /><select name="chgcontext">'; |
&mt('Context:').'</b><br /><select name="chgcontext">'; |
my @posscontexts; |
my @posscontexts; |
if ($context eq 'course') { |
if ($context eq 'course') { |
@posscontexts = ('any','automated','updatenow','createcourse','course','domain','selfenroll','requestcourses'); |
@posscontexts = ('any','automated','updatenow','createcourse','course','domain','selfenroll','requestcourses','chgtype'); |
} elsif ($context eq 'domain') { |
} elsif ($context eq 'domain') { |
@posscontexts = ('any','domain','requestauthor','domconfig','server'); |
@posscontexts = ('any','domain','requestauthor','domconfig','server'); |
} else { |
} else { |
@posscontexts = ('any','author','domain'); |
@posscontexts = ('any','author','domain'); |
} |
} |
foreach my $chgtype (@posscontexts) { |
foreach my $chgtype (@posscontexts) { |
my $selstr = ''; |
my $selstr = ''; |
if ($curr->{'chgcontext'} eq $chgtype) { |
if ($curr->{'chgcontext'} eq $chgtype) { |
Line 7435 sub rolechg_contexts {
|
Line 7737 sub rolechg_contexts {
|
%lt = &Apache::lonlocal::texthash ( |
%lt = &Apache::lonlocal::texthash ( |
any => 'Any', |
any => 'Any', |
automated => 'Automated Enrollment', |
automated => 'Automated Enrollment', |
|
chgtype => 'Enrollment Type/Lock Change', |
updatenow => 'Roster Update', |
updatenow => 'Roster Update', |
createcourse => 'Course Creation', |
createcourse => 'Course Creation', |
course => 'User Management in course', |
course => 'User Management in course', |
Line 7871 ENDJS
|
Line 8174 ENDJS
|
return; |
return; |
} |
} |
|
|
|
sub print_queued_roles { |
|
my ($r,$context,$permission,$brcrum) = @_; |
|
push (@{$brcrum}, |
|
{href => '/adm/createuser?action=rolerequests', |
|
text => 'Role Requests (other domains)', |
|
help => ''}); |
|
my $bread_crumbs_component = 'Role Requests'; |
|
my $args = { bread_crumbs => $brcrum, |
|
bread_crumbs_component => $bread_crumbs_component}; |
|
# print page header |
|
$r->print(&header('',$args)); |
|
my ($dom,$cnum); |
|
$dom = $env{'request.role.domain'}; |
|
if ($context eq 'course') { |
|
if ($env{'request.course.id'}) { |
|
if (&Apache::loncommon::course_type() eq 'Community') { |
|
$context = 'community'; |
|
} |
|
$cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
} |
|
} elsif ($context eq 'author') { |
|
$cnum = $env{'user.name'}; |
|
} |
|
$r->print(&Apache::loncoursequeueadmin::display_queued_requests('othdomqueue',$dom,$cnum,$context)); |
|
return; |
|
} |
|
|
|
sub print_pendingroles { |
|
my ($r,$context,$permission,$brcrum) = @_; |
|
push (@{$brcrum}, |
|
{href => '/adm/createuser?action=queuedroles', |
|
text => 'Queued Role Assignments (users in this domain)', |
|
help => ''}); |
|
my $bread_crumbs_component = 'Queued Role Assignments'; |
|
my $args = { bread_crumbs => $brcrum, |
|
bread_crumbs_component => $bread_crumbs_component}; |
|
# print page header |
|
$r->print(&header('',$args)); |
|
$r->print(&Apache::loncoursequeueadmin::display_queued_requests('othdomaction',$env{'request.role.domain'},'','domain')); |
|
return; |
|
} |
|
|
|
sub process_pendingroles { |
|
my ($r,$context,$permission,$brcrum) = @_; |
|
push (@{$brcrum}, |
|
{href => '/adm/createuser?action=queuedroles', |
|
text => 'Queued Role Assignments (users in this domain)', |
|
help => ''}, |
|
{href => '/adm/createuser?action=processrolereq', |
|
text => 'Process Queue', |
|
help => ''}); |
|
my $bread_crumbs_component = 'Queued Role Assignments'; |
|
my $args = { bread_crumbs => $brcrum, |
|
bread_crumbs_component => $bread_crumbs_component}; |
|
# print page header |
|
$r->print(&header('',$args)); |
|
$r->print(&Apache::loncoursequeueadmin::update_request_queue('othdombydc', |
|
$env{'request.role.domain'})); |
|
return; |
|
} |
|
|
sub domain_adhoc_access { |
sub domain_adhoc_access { |
my ($roles,$domcurrent,$accesstypes,$usertypes,$othertitle) = @_; |
my ($roles,$domcurrent,$accesstypes,$usertypes,$othertitle) = @_; |
my %domusage; |
my %domusage; |
Line 8499 sub user_search_result {
|
Line 8863 sub user_search_result {
|
my $domd_chk = &domdirectorysrch_check($srch); |
my $domd_chk = &domdirectorysrch_check($srch); |
$response .= '<span class="LC_warning">'.$instd_chk.'</span><br />'; |
$response .= '<span class="LC_warning">'.$instd_chk.'</span><br />'; |
if ($domd_chk eq 'ok') { |
if ($domd_chk eq 'ok') { |
$response .= &mt('You may want to search in the LON-CAPA domain instead of the institutional directory.'); |
$response .= &mt('You may want to search in the LON-CAPA domain instead of in the institutional directory.'); |
} |
} |
$response .= '<br />'; |
$response .= '<br />'; |
} |
} |
Line 8510 sub user_search_result {
|
Line 8874 sub user_search_result {
|
my $instd_chk = &instdirectorysrch_check($srch); |
my $instd_chk = &instdirectorysrch_check($srch); |
$response .= '<span class="LC_warning">'.$domd_chk.'</span><br />'; |
$response .= '<span class="LC_warning">'.$domd_chk.'</span><br />'; |
if ($instd_chk eq 'ok') { |
if ($instd_chk eq 'ok') { |
$response .= &mt('You may want to search in the institutional directory instead of the LON-CAPA domain.'); |
$response .= &mt('You may want to search in the institutional directory instead of in the LON-CAPA domain.'); |
} |
} |
$response .= '<br />'; |
$response .= '<br />'; |
} |
} |
Line 8611 sub user_search_result {
|
Line 8975 sub user_search_result {
|
$response = '<span class="LC_warning">'. |
$response = '<span class="LC_warning">'. |
&mt('Institutional directory search is not available in domain: [_1]',$showdom). |
&mt('Institutional directory search is not available in domain: [_1]',$showdom). |
'</span><br />'. |
'</span><br />'. |
&mt('You may want to search in the LON-CAPA domain instead of the institutional directory.'). |
&mt('You may want to search in the LON-CAPA domain instead of in the institutional directory.'). |
'<br />'; |
'<br />'; |
} |
} |
} |
} |
Line 8684 sub user_search_result {
|
Line 9048 sub user_search_result {
|
$response = '<span class="LC_warning">'. |
$response = '<span class="LC_warning">'. |
&mt('Institutional directory search is not available in domain: [_1]',$showdom). |
&mt('Institutional directory search is not available in domain: [_1]',$showdom). |
'</span><br />'. |
'</span><br />'. |
&mt('You may want to search in the LON-CAPA domain instead of the institutional directory.'). |
&mt('You may want to search in the LON-CAPA domain instead of in the institutional directory.'). |
'<br />'; |
'<br />'; |
} |
} |
} |
} |