Diff for /loncom/interface/loncreateuser.pm between versions 1.406.2.11 and 1.406.2.13

version 1.406.2.11, 2017/01/24 05:35:35 version 1.406.2.13, 2017/03/26 23:33:46
Line 749  sub print_username_entry_form { Line 749  sub print_username_entry_form {
         }          }
     } else {      } else {
         my $actiontext = $lt{'srad'};          my $actiontext = $lt{'srad'};
           my $fixeddom;
         if ($env{'form.action'} eq 'singlestudent') {          if ($env{'form.action'} eq 'singlestudent') {
             if ($crstype eq 'Community') {              if ($crstype eq 'Community') {
                 $actiontext = $lt{'srme'};                  $actiontext = $lt{'srme'};
Line 757  sub print_username_entry_form { Line 758  sub print_username_entry_form {
             }              }
         } elsif ($env{'form.action'} eq 'accesslogs') {          } elsif ($env{'form.action'} eq 'accesslogs') {
             $actiontext = $lt{'srva'};              $actiontext = $lt{'srva'};
               $fixeddom = 1;
         } elsif (($env{'form.action'} eq 'singleuser') &&          } elsif (($env{'form.action'} eq 'singleuser') &&
                  ($context eq 'domain') && (!&Apache::lonnet::allowed('mau',$defdom))) {                   ($context eq 'domain') && (!&Apache::lonnet::allowed('mau',$defdom))) {
             $actiontext = $lt{'srvu'};              $actiontext = $lt{'srvu'};
Line 768  sub print_username_entry_form { Line 770  sub print_username_entry_form {
                          '<br clear="all" />');                           '<br clear="all" />');
             }              }
         }          }
         $r->print(&entry_form($defdom,$srch,$forcenewuser,$context,$response,$crstype,1));          $r->print(&entry_form($defdom,$srch,$forcenewuser,$context,$response,$crstype,$fixeddom));
     }      }
 }  }
   
Line 6672  sub print_useraccesslogs_display { Line 6674  sub print_useraccesslogs_display {
   
 # set breadcrumbs  # set breadcrumbs
     my %breadcrumb_text = &singleuser_breadcrumb('','domain',$udom);      my %breadcrumb_text = &singleuser_breadcrumb('','domain',$udom);
     push (@{$brcrum},      my $prevphasestr;
         {href => "javascript:backPage($form)",      if ($env{'form.popup'}) {
          text => $breadcrumb_text{'search'}});          $brcrum = [];
     my (@prevphases,$prevphasestr);      } else {
     if ($env{'form.prevphases'}) {          push (@{$brcrum},
         @prevphases = split(/,/,$env{'form.prevphases'});              {href => "javascript:backPage($form)",
         $prevphasestr = $env{'form.prevphases'};               text => $breadcrumb_text{'search'}});
     }          my @prevphases;
     if (($env{'form.phase'} eq 'userpicked') || (grep(/^userpicked$/,@prevphases))) {          if ($env{'form.prevphases'}) {
         push(@{$brcrum},              @prevphases = split(/,/,$env{'form.prevphases'});
               {href => "javascript:backPage($form,'get_user_info','select')",              $prevphasestr = $env{'form.prevphases'};
                text => $breadcrumb_text{'userpicked'}});          }
         if ($env{'form.phase'} eq 'userpicked') {          if (($env{'form.phase'} eq 'userpicked') || (grep(/^userpicked$/,@prevphases))) {
             $prevphasestr = 'userpicked';              push(@{$brcrum},
                     {href => "javascript:backPage($form,'get_user_info','select')",
                      text => $breadcrumb_text{'userpicked'}});
               if ($env{'form.phase'} eq 'userpicked') {
                   $prevphasestr = 'userpicked';
               }
         }          }
     }      }
     push(@{$brcrum},      push(@{$brcrum},
Line 6697  sub print_useraccesslogs_display { Line 6704  sub print_useraccesslogs_display {
                  bread_crumbs_component => 'User Management'};                   bread_crumbs_component => 'User Management'};
     if ($env{'form.popup'}) {      if ($env{'form.popup'}) {
         $args->{'no_nav_bar'} = 1;          $args->{'no_nav_bar'} = 1;
           $args->{'bread_crumbs_nomenu'} = 1;
     }      }
   
 # set javascript  # set javascript
Line 6722  ENDSCRIPT Line 6730  ENDSCRIPT
     unless ($permission->{'activity'}) {      unless ($permission->{'activity'}) {
         $r->print('<p class="LC_warning">'          $r->print('<p class="LC_warning">'
                  .&mt('You do not have rights to display user access logs.')                   .&mt('You do not have rights to display user access logs.')
                  .'</p>'                   .'</p>');
                  .&earlyout_accesslog_form($formname,$prevphasestr,$udom));          if ($env{'form.popup'}) {
               $r->print('<p><a href="javascript:window.close()">'.&mt('Close window').'</a></p>');
           } else {
               $r->print(&earlyout_accesslog_form($formname,$prevphasestr,$udom));
           }
         return;          return;
     }      }
   
Line 6743  ENDSCRIPT Line 6755  ENDSCRIPT
         return;          return;
     }      }
   
       if (&Apache::lonnet::privileged($uname,$udom,
                                       [$env{'request.role.domain'}],['dc','su'])) {
           unless (&Apache::lonnet::privileged($env{'user.name'},$env{'user.domain'},
                                               [$env{'request.role.domain'}],['dc','su'])) {
               $r->print('<p class="LC_warning">'
                    .&mt('You need to be a privileged user to display user access logs for [_1]',
                         &Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom),
                                                            $uname,$udom))
                    .'</p>');
               if ($env{'form.popup'}) {
                   $r->print('<p><a href="javascript:window.close()">'.&mt('Close window').'</a></p>');
               } else {
                   $r->print(&earlyout_accesslog_form($formname,$prevphasestr,$udom));
               }
               return;
           }
       }
   
 # set defaults  # set defaults
     my $now = time();      my $now = time();
     my $defstart = $now - (7*24*3600);      my $defstart = $now - (7*24*3600);
Line 6789  ENDSCRIPT Line 6819  ENDSCRIPT
     my ($nav_script,$nav_links);      my ($nav_script,$nav_links);
   
 # table header  # table header
     my $tableheader =      my $tableheader = '<h3>'.
         &Apache::loncommon::start_data_table_header_row()          &mt('User access logs for: [_1]',
               &Apache::loncommon::aboutmewrapper(&Apache::loncommon::plainname($uname,$udom),$uname,$udom)).'</h3>'
          .&Apache::loncommon::start_data_table_header_row()
        .'<th>&nbsp;</th>'         .'<th>&nbsp;</th>'
        .'<th>'.&mt('When').'</th>'         .'<th>'.&mt('When').'</th>'
        .'<th>'.&mt('HostID').'</th>'         .'<th>'.&mt('HostID').'</th>'
Line 6827  ENDSCRIPT Line 6859  ENDSCRIPT
                 $showntableheader = 1;                  $showntableheader = 1;
             }              }
             my ($shown,$extra);              my ($shown,$extra);
             my ($event,$data) = split(/\s+/,&unescape($event));              my ($event,$data) = split(/\s+/,&unescape($event),2);
             if ($event eq 'Role') {              if ($event eq 'Role') {
                 my ($rolecode,$extent) = split(/\./,$data,2);                  my ($rolecode,$extent) = split(/\./,$data,2);
                 next if ($extent eq '');                  next if ($extent eq '');
Line 6879  ENDSCRIPT Line 6911  ENDSCRIPT
                 $shown = &mt('Role selection: [_1]',$rolename);                  $shown = &mt('Role selection: [_1]',$rolename);
             } else {              } else {
                 $shown = &mt($event);                  $shown = &mt($event);
                 if ($data ne '') {                  if ($data =~ /^webdav/) {
                    $extra = &mt('Client IP address: [_1]',$data);                      my ($path,$clientip) = split(/\s+/,$data,2);
                       $path =~ s/^webdav//;
                       if ($clientip ne '') {
                           $extra = &mt('Client IP address: [_1]',$clientip);
                       }
                       if ($path ne '') {
                           $shown .= ' '.&mt('(WebDAV access to [_1])',$path);
                       }
                   } elsif ($data ne '') {
                       $extra = &mt('Client IP address: [_1]',$data);
                 }                  }
             }              }
             $r->print(              $r->print(
Line 6989  sub activity_display_filter { Line 7030  sub activity_display_filter {
     # Update Display button      # Update Display button
     $output .= '<p>'      $output .= '<p>'
               .'<input type="submit" value="'.&mt('Update Display').'" />'                .'<input type="submit" value="'.&mt('Update Display').'" />'
               .'</p>';                .'</p><hr />';
     return $output;      return $output;
 }  }
   
Line 7183  sub print_helpdeskaccess_display { Line 7224  sub print_helpdeskaccess_display {
     my $confname = $cdom.'-domainconfig';      my $confname = $cdom.'-domainconfig';
     my $crstype = &Apache::loncommon::course_type();      my $crstype = &Apache::loncommon::course_type();
   
     my @accesstypes = ('all','none');      my @accesstypes = ('all','dh','da','none');
     my ($numstatustypes,@jsarray);      my ($numstatustypes,@jsarray);
     my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($cdom);      my ($othertitle,$usertypes,$types) = &Apache::loncommon::sorted_inst_types($cdom);
     if (ref($types) eq 'ARRAY') {      if (ref($types) eq 'ARRAY') {
Line 7194  sub print_helpdeskaccess_display { Line 7235  sub print_helpdeskaccess_display {
         }          }
     }      }
     my %customroles = &get_domain_customroles($cdom,$confname);      my %customroles = &get_domain_customroles($cdom,$confname);
     my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh']);      my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh','da']);
     if (keys(%domhelpdesk)) {      if (keys(%domhelpdesk)) {
        push(@accesstypes,('inc','exc'));         push(@accesstypes,('inc','exc'));
        push(@jsarray,('notinc','notexc'));         push(@jsarray,('notinc','notexc'));
Line 7392  ENDJS Line 7433  ENDJS
                     'rou'    => 'Role usage',                      'rou'    => 'Role usage',
                     'whi'    => 'Which helpdesk personnel may use this role?',                      'whi'    => 'Which helpdesk personnel may use this role?',
                     'udd'    => 'Use domain default',                      'udd'    => 'Use domain default',
                     'all'    => 'All',                      'all'    => 'All with domain helpdesk or helpdesk assistant role',
                       'dh'     => 'All with domain helpdesk role',
                       'da'     => 'All with domain helpdesk assistant role',
                     'none'   => 'None',                      'none'   => 'None',
                     'status' => 'Determined based on institutional status',                      'status' => 'Determined based on institutional status',
                     'inc'    => 'Include all, but exclude specific personnel',                      'inc'    => 'Include all, but exclude specific personnel',
Line 7579  sub domain_adhoc_access { Line 7622  sub domain_adhoc_access {
             my $access = $domcurrent->{$role}{'access'};              my $access = $domcurrent->{$role}{'access'};
             if (($access eq '') || (!grep(/^\Q$access\E$/,@{$accesstypes}))) {              if (($access eq '') || (!grep(/^\Q$access\E$/,@{$accesstypes}))) {
                 $access = 'all';                  $access = 'all';
                 $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh'));                  $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role',&Apache::lonnet::plaintext('dh'),
                                                                                             &Apache::lonnet::plaintext('da'));
             } elsif ($access eq 'status') {              } elsif ($access eq 'status') {
                 if (ref($domcurrent->{$role}{$access}) eq 'ARRAY') {                  if (ref($domcurrent->{$role}{$access}) eq 'ARRAY') {
                     my @shown;                      my @shown;
Line 7595  sub domain_adhoc_access { Line 7639  sub domain_adhoc_access {
                     }                      }
                     if (@shown) {                      if (@shown) {
                         my $shownstatus = join(' '.&mt('or').' ',@shown);                          my $shownstatus = join(' '.&mt('or').' ',@shown);
                         $domusage{$role} = &mt('Any user in domain with active [_1] role, and institutional status: [_2]',                          $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role, and institutional status: [_3]',
                                                &Apache::lonnet::plaintext('dh'),$shownstatus);                                                 &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'),$shownstatus);
                     } else {                      } else {
                         $domusage{$role} = &mt('No one in the domain');                          $domusage{$role} = &mt('No one in the domain');
                     }                      }
Line 7610  sub domain_adhoc_access { Line 7654  sub domain_adhoc_access {
                     }                      }
                     my $showninc = join(', ',@dominc);                      my $showninc = join(', ',@dominc);
                     if ($showninc ne '') {                      if ($showninc ne '') {
                         $domusage{$role} = &mt('Include any user in domain with active [_1] role, except: [_2]',                          $domusage{$role} = &mt('Include any user in domain with active [_1] or [_2] role, except: [_3]',
                                                &Apache::lonnet::plaintext('dh'),$showninc);                                                 &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'),$showninc);
                     } else {                      } else {
                         $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh'));                          $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role',
                                                  &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'));
                     }                      }
                 }                  }
             } elsif ($access eq 'exc') {              } elsif ($access eq 'exc') {
Line 7626  sub domain_adhoc_access { Line 7671  sub domain_adhoc_access {
                 }                  }
                 my $shownexc = join(', ',@domexc);                  my $shownexc = join(', ',@domexc);
                 if ($shownexc ne '') {                  if ($shownexc ne '') {
                     $domusage{$role} = &mt('Only the following in the domain with active [_1] role: [_2]',                      $domusage{$role} = &mt('Only the following in the domain with active [_1] or [_2] role: [_3]',
                                            &Apache::lonnet::plaintext('dh'),$shownexc);                                             &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'),$shownexc);
                 } else {                  } else {
                     $domusage{$role} = &mt('No one in the domain');                      $domusage{$role} = &mt('No one in the domain');
                 }                  }
             } elsif ($access eq 'none') {              } elsif ($access eq 'none') {
                 $domusage{$role} = &mt('No one in the domain');                  $domusage{$role} = &mt('No one in the domain');
             } elsif ($access eq 'all') {              } elsif ($access eq 'dh') {
                 $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh'));                  $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh'));
               } elsif ($access eq 'da') {
                   $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('da'));
               } elsif ($access eq 'all') {
                   $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role',
                                          &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'));
             }              }
         } else {          } else {
             $domusage{$role} = &mt('Any user in domain with active [_1] role',&Apache::lonnet::plaintext('dh'));              $domusage{$role} = &mt('Any user in domain with active [_1] or [_2] role',
                                      &Apache::lonnet::plaintext('dh'),&Apache::lonnet::plaintext('da'));
         }          }
     }      }
     return %domusage;      return %domusage;
Line 7818  sub update_helpdeskaccess { Line 7869  sub update_helpdeskaccess {
         $r->print('<p class="LC_error">'.&mt('You do not have permission to change helpdesk access.').'</p>');          $r->print('<p class="LC_error">'.&mt('You do not have permission to change helpdesk access.').'</p>');
         return;          return;
     }      }
     my @accesstypes = ('all','none','status','inc','exc');      my @accesstypes = ('all','dh','da','none','status','inc','exc');
     my $cdom = $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 $cnum = $env{'course.'.$env{'request.course.id'}.'.num'};
     my $confname = $cdom.'-domainconfig';      my $confname = $cdom.'-domainconfig';
Line 7828  sub update_helpdeskaccess { Line 7879  sub update_helpdeskaccess {
     my (%settings,%overridden);      my (%settings,%overridden);
     &get_adhocrole_settings($env{'request.course.id'},\@accesstypes,      &get_adhocrole_settings($env{'request.course.id'},\@accesstypes,
                             $types,\%customroles,\%settings,\%overridden);                              $types,\%customroles,\%settings,\%overridden);
     my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh']);      my %domhelpdesk = &Apache::lonnet::get_active_domroles($cdom,['dh','da']);
     my (%changed,%storehash,@todelete);      my (%changed,%storehash,@todelete);
   
     if (keys(%customroles)) {      if (keys(%customroles)) {
Line 8069  sub update_helpdeskaccess { Line 8120  sub update_helpdeskaccess {
                         if ($env{'form.'.$role.'_incrs'}) {                          if ($env{'form.'.$role.'_incrs'}) {
                             if ($newsettings{$role}{'access'} eq 'all') {                              if ($newsettings{$role}{'access'} eq 'all') {
                                 $r->print(&mt('All helpdesk staff can access '.lc($crstype).' with this role.'));                                  $r->print(&mt('All helpdesk staff can access '.lc($crstype).' with this role.'));
                               } elsif ($newsettings{$role}{'access'} eq 'dh') {
                                   $r->print(&mt('Helpdesk staff can use this role if they have an active [_1] role',
                                                 &Apache::lonnet::plaintext('dh')));
                               } elsif ($newsettings{$role}{'access'} eq 'da') {
                                   $r->print(&mt('Helpdesk staff can use this role if they have an active [_1] role',
                                                 &Apache::lonnet::plaintext('da')));
                             } elsif ($newsettings{$role}{'access'} eq 'none') {                              } elsif ($newsettings{$role}{'access'} eq 'none') {
                                 $r->print(&mt('No helpdesk staff can access '.lc($crstype).' with this role.'));                                  $r->print(&mt('No helpdesk staff can access '.lc($crstype).' with this role.'));
                             } elsif ($newsettings{$role}{'access'} eq 'status') {                              } elsif ($newsettings{$role}{'access'} eq 'status') {

Removed from v.1.406.2.11  
changed lines
  Added in v.1.406.2.13


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>