Diff for /loncom/interface/loncreateuser.pm between versions 1.406.2.6 and 1.406.2.7

version 1.406.2.6, 2016/11/11 02:13:51 version 1.406.2.7, 2016/11/13 15:47:04
Line 751  sub print_username_entry_form { Line 751  sub print_username_entry_form {
     } elsif ($env{'form.action'} eq 'accesslogs') {      } elsif ($env{'form.action'} eq 'accesslogs') {
         $helpitem = 'Domain_User_Access_Logs';          $helpitem = 'Domain_User_Access_Logs';
     }      }
     my %breadcrumb_text = &singleuser_breadcrumb($crstype);      my %breadcrumb_text = &singleuser_breadcrumb($crstype,$context,$defdom);
     if ($env{'form.action'} eq 'custom') {      if ($env{'form.action'} eq 'custom') {
         push(@{$brcrum},          push(@{$brcrum},
                  {href=>"javascript:backPage(document.crtuser)",                          {href=>"javascript:backPage(document.crtuser)",       
Line 779  sub print_username_entry_form { Line 779  sub print_username_entry_form {
                     'srst' => 'Search for a user and enroll as a student',                      'srst' => 'Search for a user and enroll as a student',
                     'srme' => 'Search for a user and enroll as a member',                      'srme' => 'Search for a user and enroll as a member',
                     'srad' => 'Search for a user and modify/add user information or roles',                      'srad' => 'Search for a user and modify/add user information or roles',
                       'srvu' => 'Search for a user and view user information and roles',
                     'srva' => 'Search for a user and view access log information',                      'srva' => 'Search for a user and view access log information',
     'usr'  => "Username",      'usr'  => "Username",
                     'dom'  => "Domain",                      'dom'  => "Domain",
Line 834  sub print_username_entry_form { Line 835  sub print_username_entry_form {
             }              }
         } elsif ($env{'form.action'} eq 'accesslogs') {          } elsif ($env{'form.action'} eq 'accesslogs') {
             $actiontext = $lt{'srva'};              $actiontext = $lt{'srva'};
           } elsif (($env{'form.action'} eq 'singleuser') &&
                    ($context eq 'domain') && (!&Apache::lonnet::allowed('mau',$defdom))) {
               $actiontext = $lt{'srvu'};
         }          }
         $r->print("<h3>$actiontext</h3>");          $r->print("<h3>$actiontext</h3>");
         if ($env{'form.origform'} ne 'crtusername') {          if ($env{'form.origform'} ne 'crtusername') {
Line 927  ENDBLOCK Line 931  ENDBLOCK
     } else {      } else {
         $output = '<p>'.$userpicker.'</p>';          $output = '<p>'.$userpicker.'</p>';
     }      }
     if (($env{'form.phase'} eq '') && ($env{'form.action'} ne 'accesslogs')) {      if (($env{'form.phase'} eq '') && ($env{'form.action'} ne 'accesslogs') &&
           (!(($env{'form.action'} eq 'singleuser') && ($context eq '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 $domform = &Apache::loncommon::select_dom_form($defdom,'srchdomain');
         my %lt=&Apache::lonlocal::texthash(          my %lt=&Apache::lonlocal::texthash(
Line 1044  ENDSCRIPT Line 1050  ENDSCRIPT
                                        'stusrch'        => "User Search to enroll student",                                         'stusrch'        => "User Search to enroll student",
                                        'memsrch'        => "User Search to enroll member",                                         'memsrch'        => "User Search to enroll member",
                                        'srcva'          => "Search for a user and view access log information",                                         'srcva'          => "Search for a user and view access log information",
                                          'usrvu'          => "User Search to view user roles",
                                        'usel'           => "Select a user to add/modify roles",                                         'usel'           => "Select a user to add/modify roles",
                                          'suvr'           => "Select a user to view roles",
                                        'stusel'         => "Select a user to enroll as a student",                                         'stusel'         => "Select a user to enroll as a student",
                                        'memsel'         => "Select a user to enroll as a member",                                         'memsel'         => "Select a user to enroll as a member",
                                        'vacsel'         => "Select a user to view access log",                                         'vacsel'         => "Select a user to view access log",
Line 1057  ENDSCRIPT Line 1065  ENDSCRIPT
     if ($context eq 'requestcrs') {      if ($context eq 'requestcrs') {
         $r->print('<div>');          $r->print('<div>');
     } else {      } else {
         my %breadcrumb_text = &singleuser_breadcrumb($crstype);          my %breadcrumb_text = &singleuser_breadcrumb($crstype,$context,$srch->{'srchdomain'});
         my $helpitem;          my $helpitem;
         if ($env{'form.action'} eq 'singleuser') {          if ($env{'form.action'} eq 'singleuser') {
             $helpitem = 'Course_Change_Privileges';              $helpitem = 'Course_Change_Privileges';
Line 1077  ENDSCRIPT Line 1085  ENDSCRIPT
                   );                    );
         $r->print(&Apache::loncommon::start_page('User Management',$jscript,{bread_crumbs => $brcrum}));          $r->print(&Apache::loncommon::start_page('User Management',$jscript,{bread_crumbs => $brcrum}));
         if ($env{'form.action'} eq 'singleuser') {          if ($env{'form.action'} eq 'singleuser') {
             $r->print("<b>$lt{'usrch'}</b><br />");              my $readonly;
               if (($context eq 'domain') && (!&Apache::lonnet::allowed('mau',$srch->{'srchdomain'}))) {
                   $readonly = 1;
                   $r->print("<b>$lt{'usrvu'}</b><br />");
               } else {
                   $r->print("<b>$lt{'usrch'}</b><br />");
               }
             $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context,undef,$crstype));              $r->print(&entry_form($srch->{'srchdomain'},$srch,undef,$context,undef,$crstype));
             $r->print('<h3>'.$lt{'usel'}.'</h3>');              if ($readonly) {
                   $r->print('<h3>'.$lt{'suvr'}.'</h3>');
               } else {
                   $r->print('<h3>'.$lt{'usel'}.'</h3>');
               }
         } elsif ($env{'form.action'} eq 'singlestudent') {          } elsif ($env{'form.action'} eq 'singlestudent') {
             $r->print($jscript."<b>");              $r->print($jscript."<b>");
             if ($crstype eq 'Community') {              if ($crstype eq 'Community') {
Line 1273  sub print_user_modification_page { Line 1291  sub print_user_modification_page {
   
     my $js = &validation_javascript($context,$ccdomain,$pjump_def,$crstype,      my $js = &validation_javascript($context,$ccdomain,$pjump_def,$crstype,
                                $groupslist,$newuser,$formname,\%loaditem);                                 $groupslist,$newuser,$formname,\%loaditem);
     my %breadcrumb_text = &singleuser_breadcrumb($crstype);      my %breadcrumb_text = &singleuser_breadcrumb($crstype,$context,$ccdomain);
     my $helpitem = 'Course_Change_Privileges';      my $helpitem = 'Course_Change_Privileges';
     if ($env{'form.action'} eq 'singlestudent') {      if ($env{'form.action'} eq 'singlestudent') {
         $helpitem = 'Course_Add_Student';          $helpitem = 'Course_Add_Student';
Line 1648  ENDNOTOOLSPRIV Line 1666  ENDNOTOOLSPRIV
 }  }
   
 sub singleuser_breadcrumb {  sub singleuser_breadcrumb {
     my ($crstype) = @_;      my ($crstype,$context,$domain) = @_;
     my %breadcrumb_text;      my %breadcrumb_text;
     if ($env{'form.action'} eq 'singlestudent') {      if ($env{'form.action'} eq 'singlestudent') {
         if ($crstype eq 'Community') {          if ($crstype eq 'Community') {
Line 1656  sub singleuser_breadcrumb { Line 1674  sub singleuser_breadcrumb {
         } else {          } else {
             $breadcrumb_text{'search'} = 'Enroll a student';              $breadcrumb_text{'search'} = 'Enroll a student';
         }          }
         $breadcrumb_text{'userpicked'} = 'Select a user',          $breadcrumb_text{'userpicked'} = 'Select a user';
         $breadcrumb_text{'modify'} = 'Set section/dates',          $breadcrumb_text{'modify'} = 'Set section/dates';
     } elsif ($env{'form.action'} eq 'accesslogs') {      } elsif ($env{'form.action'} eq 'accesslogs') {
         $breadcrumb_text{'search'} = 'View access logs for a user';          $breadcrumb_text{'search'} = 'View access logs for a user';
         $breadcrumb_text{'userpicked'} = 'Select a user',          $breadcrumb_text{'userpicked'} = 'Select a user';
         $breadcrumb_text{'activity'} = 'Activity',          $breadcrumb_text{'activity'} = 'Activity';
       } elsif (($env{'form.action'} eq 'singleuser') && ($context eq 'domain') &&
                (!&Apache::lonnet::allowed('mau',$domain))) {
           $breadcrumb_text{'search'} = "View user's roles";
           $breadcrumb_text{'userpicked'} = 'Select a user';
           $breadcrumb_text{'modify'} = 'User roles';
     } else {      } else {
         $breadcrumb_text{'search'} = 'Create/modify a user';          $breadcrumb_text{'search'} = 'Create/modify a user';
         $breadcrumb_text{'userpicked'} = 'Select a user',          $breadcrumb_text{'userpicked'} = 'Select a user';
         $breadcrumb_text{'modify'} = 'Set user role',          $breadcrumb_text{'modify'} = 'Set user role';
     }      }
     return %breadcrumb_text;      return %breadcrumb_text;
 }  }
Line 1830  sub display_existing_roles { Line 1853  sub display_existing_roles {
         my $class='Unknown';          my $class='Unknown';
         my $credits='';          my $credits='';
         my $csec;          my $csec;
         if ($area =~ m{^/($match_domain)/($match_courseid)} ) {          if ($area =~ m{^/($match_domain)/($match_courseid)}) {
             $class='Course';              $class='Course';
             my ($coursedom,$coursedir) = ($1,$2);              my ($coursedom,$coursedir) = ($1,$2);
             my $cid = $1.'_'.$2;              my $cid = $1.'_'.$2;
             # $1.'_'.$2 is the course id (eg. 103_12345abcef103l3).              # $1.'_'.$2 is the course id (eg. 103_12345abcef103l3).
               next if ($envkey =~ m{^/$match_domain/$match_courseid/[A-Za-z0-9]+_gr$});
             my %coursedata=              my %coursedata=
                 &Apache::lonnet::coursedescription($cid);                  &Apache::lonnet::coursedescription($cid);
             if ($coursedir =~ /^$match_community$/) {              if ($coursedir =~ /^$match_community$/) {
Line 1994  sub display_existing_roles { Line 2018  sub display_existing_roles {
             $rolepriv{$envkey}='edit';              $rolepriv{$envkey}='edit';
         } else {          } else {
             if ($context eq 'domain') {              if ($context eq 'domain') {
                 if (&Apache::lonnet::allowed('vur',$ccdomain)) {                  if ((&Apache::lonnet::allowed('vur',$ccdomain)) &&
                       ($envkey=~m{^/$ccdomain/})) {
                     $rolepriv{$envkey}='view';                      $rolepriv{$envkey}='view';
                 }                  }
             } elsif ($context eq 'course') {              } elsif ($context eq 'course') {
Line 2680  sub update_user_data { Line 2705  sub update_user_data {
                   $jsback."\n".                    $jsback."\n".
                   '// ]]>'."\n".                    '// ]]>'."\n".
                   '</script>'."\n";                    '</script>'."\n";
     my %breadcrumb_text = &singleuser_breadcrumb($crstype);      my %breadcrumb_text = &singleuser_breadcrumb($crstype,$context,$env{'form.ccdomain'});
     push (@{$brcrum},      push (@{$brcrum},
              {href => "javascript:backPage(document.userupdate)",               {href => "javascript:backPage(document.userupdate)",
               text => $breadcrumb_text{'search'},                text => $breadcrumb_text{'search'},
Line 6800  sub print_useraccesslogs_display { Line 6825  sub print_useraccesslogs_display {
     my $form = 'document.accesslog';      my $form = 'document.accesslog';
   
 # set breadcrumbs  # set breadcrumbs
     my %breadcrumb_text = &singleuser_breadcrumb();      my %breadcrumb_text = &singleuser_breadcrumb('','domain',$udom);
     push (@{$brcrum},      push (@{$brcrum},
         {href => "javascript:backPage($form)",          {href => "javascript:backPage($form)",
          text => $breadcrumb_text{'search'}});           text => $breadcrumb_text{'search'}});
Line 7748  sub build_search_response { Line 7773  sub build_search_response {
                                 .&mt("Click 'Search'")                                  .&mt("Click 'Search'")
                                 .'</li></ul><br />';                                  .'</li></ul><br />';
                 } else {                  } else {
                     my $helplink = ' href="javascript:helpMenu('."'display'".')"';                      unless (($context eq 'domain') && ($env{'form.action'} eq 'singleuser')) {
                     $response .= '<br /><br />';                          my $helplink = ' href="javascript:helpMenu('."'display'".')"';
                     if ($context eq 'requestcrs') {                          $response .= '<br /><br />';
                         $response .= &mt("You are not authorized to define new users in the new course's domain - [_1].",$targetdom);                          if ($context eq 'requestcrs') {
                     } else {                              $response .= &mt("You are not authorized to define new users in the new course's domain - [_1].",$targetdom);
                         $response .= &mt("You are not authorized to create new users in your current role's domain - [_1].",$targetdom);                          } else {
                               $response .= &mt("You are not authorized to create new users in your current role's domain - [_1].",$targetdom);
                           }
                           $response .= '<br />'
                                        .&mt('Please contact the [_1]helpdesk[_2] if you need to create a new user.'
                                           ,' <a'.$helplink.'>'
                                           ,'</a>')
                                        .'<br />';
                     }                      }
                     $response .= '<br />'  
                                  .&mt('Please contact the [_1]helpdesk[_2] if you need to create a new user.'  
                                     ,' <a'.$helplink.'>'  
                                     ,'</a>')  
                                  .'<br />';  
                 }                  }
             }              }
         }          }

Removed from v.1.406.2.6  
changed lines
  Added in v.1.406.2.7


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