--- loncom/interface/loncreateuser.pm 2002/08/30 22:06:56 1.39.4.1
+++ loncom/interface/loncreateuser.pm 2008/01/21 01:45:04 1.234
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Create a user
#
-# $Id: loncreateuser.pm,v 1.39.4.1 2002/08/30 22:06:56 albertel Exp $
+# $Id: loncreateuser.pm,v 1.234 2008/01/21 01:45:04 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -25,110 +25,361 @@
#
# http://www.lon-capa.org/
#
-# (Create a course
-# (My Desk
-#
-# (Internal Server Error Handler
-#
-# (Login Screen
-# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14,
-# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer)
-#
-# YEAR=2001
-# 3/1/1 Gerd Kortemeyer)
-#
-# 3/1 Gerd Kortemeyer)
-#
-# 2/14 Gerd Kortemeyer)
-#
-# 2/14,2/17,2/19,2/20,2/21,2/22,2/23,3/2,3/17,3/24,04/12 Gerd Kortemeyer
-# April Guy Albertelli
-# 05/10,10/16 Gerd Kortemeyer
-# 11/12,11/13,11/15 Scott Harrison
-# 02/11/02 Matthew Hall
-#
-# $Id: loncreateuser.pm,v 1.39.4.1 2002/08/30 22:06:56 albertel Exp $
###
package Apache::loncreateuser;
+=pod
+
+=head1 NAME
+
+Apache::loncreateuser - handler to create users and custom roles
+
+=head1 SYNOPSIS
+
+Apache::loncreateuser provides an Apache handler for creating users,
+ editing their login parameters, roles, and removing roles, and
+ also creating and assigning custom roles.
+
+=head1 OVERVIEW
+
+=head2 Custom Roles
+
+In LON-CAPA, roles are actually collections of privileges. "Teaching
+Assistant", "Course Coordinator", and other such roles are really just
+collection of privileges that are useful in many circumstances.
+
+Creating custom roles can be done by the Domain Coordinator through
+the Create User functionality. That screen will show all privileges
+that can be assigned to users. For a complete list of privileges,
+please see C.
+
+Custom role definitions are stored in the C'.$lt{'disk'}.'
'.
+ &Apache::loncommon::start_data_table().
+ &Apache::loncommon::start_data_table_row().
+ ''.$lt{'cuqu'}.': '.$currquota.' Mb. '.
+ $defaultinfo.' '.
+ &Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::start_data_table_row().
+ ''.$lt{'chqu'}.
+ ': '.
+ ' '.
+ ' Mb '.
+ &Apache::loncommon::end_data_table_row().
+ &Apache::loncommon::end_data_table();
+ return $output;
+}
+
# =================================================================== Phase one
sub print_username_entry_form {
- my $r=shift;
- my $defdom=$ENV{'request.role.domain'};
- my @domains = &Apache::loncommon::get_domains();
- my $domform = &Apache::loncommon::select_dom_form($defdom,'ccdomain');
- $r->print(<<"ENDDOCUMENT");
-
-
-Create User, Change User Privileges
-
-
-
-ENDDOCUMENT
+ENDCUSTOM
+ }
+ } else {
+ my $actiontext = $lt{'srad'};
+ if ($env{'form.action'} eq 'singlestudent') {
+ $actiontext = $lt{'srst'};
+ }
+ $r->print("
+$actiontext
");
+ if ($env{'form.origform'} ne 'crtusername') {
+ $r->print("\n".$response);
+ }
+ $r->print(&entry_form($defdom,$srch,$forcenewuser,$context,$response));
+ }
+ $r->print(&Apache::loncommon::end_page());
}
-# =================================================================== Phase two
-sub print_user_modification_page {
- my $r=shift;
- my $ccuname=$ENV{'form.ccuname'};
- my $ccdomain=$ENV{'form.ccdomain'};
-
- $ENV{'SERVER_NAME'}=~/(\w+\.\w+)$/;
- my $krbdefdom=$1;
- $krbdefdom=~tr/a-z/A-Z/;
- my %param = ( formname => 'document.cu',
- kerb_def_dom => $krbdefdom
- );
- $loginscript = &Apache::loncommon::authform_header(%param);
-
- my $defdom=$ENV{'request.role.domain'};
+sub entry_form {
+ my ($dom,$srch,$forcenewuser,$context,$responsemsg) = @_;
+ my %domconf = &Apache::lonnet::get_dom('configuration',['usercreation'],$dom);
+ my ($usertype,$inexact);
+ if (ref($srch) eq 'HASH') {
+ if (($srch->{'srchin'} eq 'dom') &&
+ ($srch->{'srchby'} eq 'uname') &&
+ ($srch->{'srchtype'} eq 'exact') &&
+ ($srch->{'srchdomain'} ne '') &&
+ ($srch->{'srchterm'} ne '')) {
+ my ($rules,$ruleorder) =
+ &Apache::lonnet::inst_userrules($srch->{'srchdomain'},'username');
+ $usertype = &Apache::lonuserutils::check_usertype($srch->{'srchdomain'},$srch->{'srchterm'},$rules);
+ } else {
+ $inexact = 1;
+ }
+ }
+ my $cancreate =
+ &Apache::lonuserutils::can_create_user($dom,$context,$usertype);
+ my $userpicker =
+ &Apache::loncommon::user_picker($dom,$srch,$forcenewuser,
+ 'document.crtuser',$cancreate,$usertype);
+ my $srchbutton = &mt('Search');
+ if ($env{'form.action'} eq 'singlestudent') {
+ $srchbutton = &mt('Search and Enroll');
+ } elsif ($cancreate && $responsemsg ne '' && $inexact) {
+ $srchbutton = &mt('Search or Add New User');
+ }
+ my $output = <<"ENDBLOCK";
+
+ENDBLOCK
+ if ($env{'form.phase'} eq '') {
+ my $defdom=$env{'request.role.domain'};
+ my $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain');
+ my %lt=&Apache::lonlocal::texthash(
+ 'enro' => 'Enroll one student',
+ 'admo' => 'Add/modify a single user',
+ 'crea' => 'create new user if required',
+ 'uskn' => "username is known",
+ 'crnu' => 'Create a new user',
+ 'usr' => 'Username',
+ 'dom' => 'in domain',
+ 'enrl' => 'Enroll',
+ 'cram' => 'Create/Modify user',
+ );
+ my $sellink=&Apache::loncommon::selectstudent_link('crtusername','srchterm','srchdomain');
+ my ($title,$buttontext,$showresponse);
+ if ($env{'form.action'} eq 'singlestudent') {
+ $title = $lt{'enro'};
+ $buttontext = $lt{'enrl'};
+ } else {
+ $title = $lt{'admo'};
+ $buttontext = $lt{'cram'};
+ }
+ if ($cancreate) {
+ $title .= ' ('.$lt{'crea'}.')';
+ } else {
+ $title .= ' ('.$lt{'uskn'}.')';
+ }
+ if ($env{'form.origform'} eq 'crtusername') {
+ $showresponse = $responsemsg;
+ }
+ $output .= <<"ENDDOCUMENT";
+
+
+ENDDOCUMENT
+ }
+ return $output;
+}
- $ccuname=~s/\W//g;
- $ccdomain=~s/\W//g;
- my $dochead =<<"ENDDOCHEAD";
-
-
-
");
+ $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context));
+ $r->print(''.$lt{'usel'}.'
');
+ } elsif ($env{'form.action'} eq 'singlestudent') {
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management',
+ 'Course_Add_Student'));
+ $r->print($jscript."$lt{'stusrch'}
");
+ $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context));
+ $r->print(''.$lt{'stusel'}.'
');
+ }
+ $r->print(''.&Apache::loncommon::end_page());
+}
+
+sub print_user_query_page {
+ my ($r,$caller) = @_;
+# FIXME - this is for a network-wide name search (similar to catalog search)
+# To use frames with similar behavior to catalog/portfolio search.
+# To be implemented.
+ return;
+}
+
+sub print_user_modification_page {
+ my ($r,$ccuname,$ccdomain,$srch,$response,$context,$permission) = @_;
+ if (($ccuname eq '') || ($ccdomain eq '')) {
+ my $usermsg = &mt('No username and/or domain provided.');
+ $env{'form.phase'} = '';
+ &print_username_entry_form($r,$context,$usermsg);
+ return;
+ }
+ my ($form,$formname);
+ if ($env{'form.action'} eq 'singlestudent') {
+ $form = 'document.enrollstudent';
+ $formname = 'enrollstudent';
+ } else {
+ $form = 'document.cu';
+ $formname = 'cu';
+ }
+ my %abv_auth = &auth_abbrev();
+ my (%rulematch,%inst_results,$newuser,%alerts,%curr_rules,%got_rules);
+ my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain);
+ if ($uhome eq 'no_host') {
+ my $usertype;
+ my ($rules,$ruleorder) =
+ &Apache::lonnet::inst_userrules($ccdomain,'username');
+ $usertype =
+ &Apache::lonuserutils::check_usertype($ccdomain,$ccuname,$rules);
+ my $cancreate =
+ &Apache::lonuserutils::can_create_user($ccdomain,$context,
+ $usertype);
+ if (!$cancreate) {
+ my $helplink = ' href="javascript:helpMenu('."'display'".')"';
+ my %usertypetext = (
+ official => 'institutional',
+ unofficial => 'non-institutional',
+ );
+ my $response;
+ if ($env{'form.origform'} eq 'crtusername') {
+ $response = ''.&mt('No match was found for the username ([_1]) in LON-CAPA domain: [_2]',$ccuname,$ccdomain).
+ '
';
+ }
+ $response .= ''.&mt("You are not authorized to create new $usertypetext{$usertype} users in this domain.").' '.&mt('Contact the helpdesk for assistance.',$helplink).'
';
+ $env{'form.phase'} = '';
+ &print_username_entry_form($r,$context,$response);
+ return;
+ }
+ $newuser = 1;
+ my $checkhash;
+ my $checks = { 'username' => 1 };
+ $checkhash->{$ccuname.':'.$ccdomain} = { 'newuser' => $newuser };
+ &Apache::loncommon::user_rule_check($checkhash,$checks,
+ \%alerts,\%rulematch,\%inst_results,\%curr_rules,\%got_rules);
+ if (ref($alerts{'username'}) eq 'HASH') {
+ if (ref($alerts{'username'}{$ccdomain}) eq 'HASH') {
+ my $domdesc =
+ &Apache::lonnet::domain($ccdomain,'description');
+ if ($alerts{'username'}{$ccdomain}{$ccuname}) {
+ my $userchkmsg;
+ if (ref($curr_rules{$ccdomain}) eq 'HASH') {
+ $userchkmsg =
+ &Apache::loncommon::instrule_disallow_msg('username',
+ $domdesc,1).
+ &Apache::loncommon::user_rule_formats($ccdomain,
+ $domdesc,$curr_rules{$ccdomain}{'username'},
+ 'username');
+ }
+ $env{'form.phase'} = '';
+ &print_username_entry_form($r,$context,$userchkmsg);
+ return;
+ }
+ }
+ }
+ } else {
+ $newuser = 0;
+ }
+ if ($response) {
+ $response = '
'.$response;
+ }
+
+ my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition();
+ my $dc_setcourse_code = '';
+ my $nondc_setsection_code = '';
+ my %loaditem;
+
+ my $groupslist = &Apache::lonuserutils::get_groupslist();
+
+ my $js = &validation_javascript($context,$ccdomain,$pjump_def,
+ $groupslist,$newuser,$formname,\%loaditem);
+ my $args = {'add_entries' => \%loaditem};
+ if ($env{'form.popup'}) {
+ $args->{'no_nav_bar'} = 1;
+ }
+ my $start_page =
+ &Apache::loncommon::start_page('User Management',$js,$args);
+ my %breadcrumb_text = &singleuser_breadcrumb();
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage($form)",
+ text=>$breadcrumb_text{'search'},
+ faq=>282,bug=>'Instructor Interface',});
+
+ if ($env{'form.phase'} eq 'userpicked') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage($form,'get_user_info','select')",
+ text=>$breadcrumb_text{'userpicked'},
+ faq=>282,bug=>'Instructor Interface',});
+ }
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>"javascript:backPage($form,'$env{'form.phase'}','modify')",
+ text=>$breadcrumb_text{'modify'},
+ faq=>282,bug=>'Instructor Interface',});
+ my $helpitem = 'Course_Change_Privileges';
+ if ($env{'form.action'} eq 'singlestudent') {
+ $helpitem = 'Course_Add_Student';
+ }
+ my $crumbs = &Apache::lonhtmlcommon::breadcrumbs('User Management',
+ $helpitem);
+
my $forminfo =<<"ENDFORMINFO";
-
$generalrule
-$authformkrb
-$authformint
-$authformfsys
-$authformloc
-ENDNEWUSER +first name | middle name | last name | generation | -
---|---|---|---|
-END - } else { - $r->print(' | '.$userenv{$_}.' | '); - } + if ($env{'form.action'} eq 'singlestudent') { + $r->print($lt{'ens'}); + } else { + $r->print($lt{'cup'}); } - $r->print(<
Revoke | Role | Extent | Start | End | -END - foreach my $area (keys(%rolesdump)) { - next if ($area =~ /^rolesdef/); - my $role = $rolesdump{$area}; - my $thisrole=$area; - $area =~ s/\_\w\w$//; - my ($role_code,$role_end_time,$role_start_time) = - split(/_/,$role); - my $bgcol='ffffff'; - my $allowed=0; - if ($area =~ /^\/(\w+)\/(\d\w+)/ ) { - my %coursedata= - &Apache::lonnet::coursedescription($1.'_'.$2); - my $carea='Course: '.$coursedata{'description'}; - $inccourses{$1.'_'.$2}=1; - if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) { - $allowed=1; - } - # Compute the background color based on $area - $bgcol=$1.'_'.$2; - $bgcol=~s/[^8-9b-e]//g; - $bgcol=substr($bgcol.$bgcol.$bgcol.'ffffff',0,6); - if ($area=~/^\/(\w+)\/(\d\w+)\/(\w+)/) { - $carea.='|
---|---|---|---|---|---|
';
- my $active=1;
- $active=0 if (($role_end_time) && ($now>$role_end_time));
- if (($active) && ($allowed)) {
- $row.= '';
- } else {
+ $r->print(' "'.$ccuname.'" '.$lt{'id'}.' "'.$ccdomain.'"'.
+ "\n".' ');
+ my ($personal_table,$showforceid) =
+ &personal_data_display($ccuname,$ccdomain,$newuser,$context,
+ $inst_results{$ccuname.':'.$ccdomain});
+ $r->print($personal_table);
+ if ($showforceid) {
+ $r->print(&Apache::lonuserutils::forceid_change($context));
+ }
+ $r->print(' ');
+ my $user_auth_text = &user_authentication($ccuname,$ccdomain,$formname);
+ my $user_quota_text;
+ if (&Apache::lonnet::allowed('mpq',$ccdomain)) {
+ # Current user has quota modification privileges
+ $user_quota_text = &portfolio_quota($ccuname,$ccdomain);
+ } elsif (&Apache::lonnet::allowed('mpq',$env{'request.role.domain'})) {
+ # Get the user's portfolio information
+ my %portq = &Apache::lonnet::get('environment',['portfolioquota'],
+ $ccdomain,$ccuname);
+
+ my %lt=&Apache::lonlocal::texthash(
+ 'dska' => "Disk space allocated to user's portfolio files",
+ 'youd' => "You do not have privileges to modify the portfolio quota for this user.",
+ 'ichr' => "If a change is required, contact a domain coordinator for the domain",
+ );
+ $user_quota_text = <'.$user_auth_text);
+ if ($user_quota_text ne '') {
+ $r->print($user_quota_text);
+ }
+ if ($env{'form.action'} eq 'singlestudent') {
+ $r->print(&date_sections_select($context,$newuser,$formname));
+ }
+ } elsif ($user_quota_text ne '') {
+ $r->print(' '.$user_quota_text);
+ if ($env{'form.action'} eq 'singlestudent') {
+ $r->print(&date_sections_select($context,$newuser,$formname));
+ }
+ } else {
+ if ($env{'form.action'} eq 'singlestudent') {
+ $r->print(' '.
+ &date_sections_select($context,$newuser,$formname));
+ }
+ }
+ $r->print(' ');
+ if ($env{'form.action'} ne 'singlestudent') {
+ &display_existing_roles($r,$ccuname,$ccdomain,\%inccourses);
+ }
+ } ## End of new user/old user logic
+
+ if ($env{'form.action'} eq 'singlestudent') {
+ $r->print(''."\n"); + } else { + $r->print(' '.&mt('Add Roles').''); + my $addrolesdisplay = 0; + if ($context eq 'domain' || $context eq 'author') { + $addrolesdisplay = &new_coauthor_roles($r,$ccuname,$ccdomain); + } + if ($context eq 'domain') { + my $add_domainroles = &new_domain_roles($r); + if (!$addrolesdisplay) { + $addrolesdisplay = $add_domainroles; + } + $r->print(&course_level_dc($env{'request.role.domain'},'Course')); + $r->print(''."\n"); + } elsif ($context eq 'author') { + if ($addrolesdisplay) { + $r->print(' print(' onClick="auth_check()" \>'."\n"); + } else { + $r->print('onClick="this.form.submit()" \>'."\n"); + } + } else { + $r->print(' '. + &mt('Back to previous page').''); + } + } else { + $r->print(&course_level_table(%inccourses)); + $r->print(' '."\n"); + } + } + $r->print(&Apache::lonhtmlcommon::echo_form_input(['phase','userrole','ccdomain','prevphase','currstate','ccuname','ccdomain'])); + $r->print(''); + $r->print(''); + $r->print("".&Apache::loncommon::end_page()); + return; +} + +sub singleuser_breadcrumb { + my %breadcrumb_text; + if ($env{'form.action'} eq 'singlestudent') { + $breadcrumb_text{'search'} = 'Enroll a student'; + $breadcrumb_text{'userpicked'} = 'Select a user', + $breadcrumb_text{'modify'} = 'Set section/dates', + } else { + $breadcrumb_text{'search'} = 'Create/modify a user'; + $breadcrumb_text{'userpicked'} = 'Select a user', + $breadcrumb_text{'modify'} = 'Set user role', + } + return %breadcrumb_text; +} + +sub date_sections_select { + my ($context,$newuser,$formname,$permission) = @_; + my $cid = $env{'request.course.id'}; + my ($cnum,$cdom) = &Apache::lonuserutils::get_course_identity($cid); + my $date_table = ' '.&mt('Starting and Ending Dates').''."\n". + &Apache::lonuserutils::date_setting_table(undef,undef,$context, + undef,$formname,$permission); + my $rowtitle = 'Section'; + my $secbox = ''.&mt('Section').''."\n". + &Apache::lonuserutils::section_picker($cdom,$cnum,'st',$rowtitle, + $permission); + my $output = $date_table.$secbox; + return $output; +} + +sub validation_javascript { + my ($context,$ccdomain,$pjump_def,$groupslist,$newuser,$formname, + $loaditem) = @_; + my $dc_setcourse_code = ''; + my $nondc_setsection_code = ''; + if ($context eq 'domain') { + my $dcdom = $env{'request.role.domain'}; + $loaditem->{'onload'} = "document.cu.coursedesc.value='';"; + $dc_setcourse_code = + &Apache::lonuserutils::dc_setcourse_js('cu','singleuser',$context); + } else { + my $checkauth; + if (($newuser) || (&Apache::lonnet::allowed('mau',$ccdomain))) { + $checkauth = 1; + } + if ($context eq 'course') { + $nondc_setsection_code = + &Apache::lonuserutils::setsections_javascript($formname,$groupslist, + undef,$checkauth); + } + if ($checkauth) { + $nondc_setsection_code .= + &Apache::lonuserutils::verify_authen($formname,$context); + } + } + my $js = &user_modification_js($pjump_def,$dc_setcourse_code, + $nondc_setsection_code,$groupslist); + my ($jsback,$elements) = &crumb_utilities(); + $js .= "\n". + ''; + return $js; +} + +sub display_existing_roles { + my ($r,$ccuname,$ccdomain,$inccourses) = @_; + my %rolesdump=&Apache::lonnet::dump('roles',$ccdomain,$ccuname); + # Build up table of user roles to allow revocation and re-enabling of roles. + my ($tmp) = keys(%rolesdump); + if ($tmp !~ /^(con_lost|error)/i) { + my $now=time; + my %lt=&Apache::lonlocal::texthash( + 'rer' => "Existing Roles", + 'rev' => "Revoke", + 'del' => "Delete", + 'ren' => "Re-Enable", + 'rol' => "Role", + 'ext' => "Extent", + 'sta' => "Start", + 'end' => "End", + ); + my (%roletext,%sortrole,%roleclass,%rolepriv); + foreach my $area (sort { my $a1=join('_',(split('_',$a))[1,0]); + my $b1=join('_',(split('_',$b))[1,0]); + return $a1 cmp $b1; + } keys(%rolesdump)) { + next if ($area =~ /^rolesdef/); + my $envkey=$area; + my $role = $rolesdump{$area}; + my $thisrole=$area; + $area =~ s/\_\w\w$//; + my ($role_code,$role_end_time,$role_start_time) = + split(/_/,$role); +# Is this a custom role? Get role owner and title. + my ($croleudom,$croleuname,$croletitle)= + ($role_code=~m{^cr/($match_domain)/($match_username)/(\w+)$}); + my $allowed=0; + my $delallowed=0; + my $sortkey=$role_code; + my $class='Unknown'; + if ($area =~ m{^/($match_domain)/($match_courseid)} ) { + $class='Course'; + my ($coursedom,$coursedir) = ($1,$2); + $sortkey.="\0$coursedom"; + # $1.'_'.$2 is the course id (eg. 103_12345abcef103l3). + my %coursedata= + &Apache::lonnet::coursedescription($1.'_'.$2); + my $carea; + if (defined($coursedata{'description'})) { + $carea=$coursedata{'description'}. + ''.&mt('Domain').': '.$coursedom.(' 'x8). + &Apache::loncommon::syllabuswrapper('Syllabus',$coursedir,$coursedom); + $sortkey.="\0".$coursedata{'description'}; + $class=$coursedata{'type'}; + } else { + $carea=&mt('Unavailable course').': '.$area; + $sortkey.="\0".&mt('Unavailable course').': '.$area; + } + $sortkey.="\0$coursedir"; + $inccourses->{$1.'_'.$2}=1; + if ((&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2)) || + (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) { + $allowed=1; + } + if ((&Apache::lonnet::allowed('dro',$1)) || + (&Apache::lonnet::allowed('dro',$ccdomain))) { + $delallowed=1; + } +# - custom role. Needs more info, too + if ($croletitle) { + if (&Apache::lonnet::allowed('ccr',$1.'/'.$2)) { + $allowed=1; + $thisrole.='.'.$role_code; + } + } + # Compute the background color based on $area + if ($area=~m{^/($match_domain)/($match_courseid)/(\w+)}) { + $carea.=' Section: '.$3; + $sortkey.="\0$3"; + if (!$allowed) { + if ($env{'request.course.sec'} eq $3) { + if (&Apache::lonnet::allowed('c'.$role_code,$1.'/'.$2.'/'.$3)) { + $allowed = 1; + } + } + } + } + $area=$carea; + } else { + $sortkey.="\0".$area; + # Determine if current user is able to revoke privileges + if ($area=~m{^/($match_domain)/}) { + if ((&Apache::lonnet::allowed('c'.$role_code,$1)) || + (&Apache::lonnet::allowed('c'.$role_code,$ccdomain))) { + $allowed=1; + } + if (((&Apache::lonnet::allowed('dro',$1)) || + (&Apache::lonnet::allowed('dro',$ccdomain))) && + ($role_code ne 'dc')) { + $delallowed=1; + } + } else { + if (&Apache::lonnet::allowed('c'.$role_code,'/')) { + $allowed=1; + } + } + if ($role_code eq 'ca' || $role_code eq 'au') { + $class='Construction Space'; + } elsif ($role_code eq 'su') { + $class='System'; + } else { + $class='Domain'; + } + } + if (($role_code eq 'ca') || ($role_code eq 'aa')) { + $area=~m{/($match_domain)/($match_username)}; + if (&Apache::lonuserutils::authorpriv($2,$1)) { + $allowed=1; + } else { + $allowed=0; + } + } + my $row = ''; + $row.= ' ';
+ my $active=1;
+ $active=0 if (($role_end_time) && ($now>$role_end_time));
+ if (($active) && ($allowed)) {
+ $row.= '';
+ } else {
+ if ($active) {
$row.=' ';
- }
- $row.= ' | '.&Apache::lonnet::plaintext($role_code).
- ' | '.$area.
- ' | '.($role_start_time?localtime($role_start_time)
- : ' ' ).
- ' | '.($role_end_time ?localtime($role_end_time)
- : ' ' )
- ." | |
$generalrule
-$authformkrb
-$authformint
-$authformfsys
-$authformloc
+$lt{'err'}: +$lt{'uuas'} ($currentauth). $lt{'sldb'}. +$authformint
\n". - "$authformfsys
$authformloc
"; - } - elsif ($currentauth=~/^internal:/) { - $authformcurrent=$authformint; - $authform_other="$authformkrb
". - "$authformfsys
$authformloc
"; - } - elsif ($currentauth=~/^unix:/) { - $authformcurrent=$authformfsys; - $authform_other="$authformkrb
". - "$authformint
$authformloc;
"; - } - elsif ($currentauth=~/^localauth:/) { - $authformcurrent=$authformloc; - $authform_other="$authformkrb
". - "$authformint
$authformfsys
"; - } - $authformcurrent=<$generalrule
-$authformnop
-$authformcurrent
-Activate | Role | Extent | -Start | End |
---|---|---|---|---|
- | Co-Author | -$cudom\_$cuname | --Set Start Date | --Set End Date | -
Activate | Role | Extent | '. - 'Start | End | - | $plrole | -$thisdomain | --Set Start Date | --Set End Date | - -ENDDROW + if ($show_override_msg) { + $authformcurrent = '
---|
'.$authformcurrent. + ' | ||
'. + ' | '.&mt('Currently in use').' | '. + ''. + &mt('will override current values'). + ' |