Diff for /loncom/interface/loncreateuser.pm between versions 1.198 and 1.202

version 1.198, 2007/12/05 16:49:55 version 1.202, 2007/12/05 21:23:14
Line 627  sub print_user_modification_page { Line 627  sub print_user_modification_page {
     }      }
 ENDSCRIPT  ENDSCRIPT
     } else {      } else {
         $nondc_setsection_code =          $nondc_setsection_code = 
             &Apache::lonuserutils::setsections_javascript('cu',$groupslist);              &Apache::lonuserutils::setsections_javascript('cu',$groupslist);
     }      }
     my $js = &user_modification_js($pjump_def,$dc_setcourse_code,      my $js = &user_modification_js($pjump_def,$dc_setcourse_code,
Line 718  $lt{'hs'}: $home_server_pick Line 718  $lt{'hs'}: $home_server_pick
         } else {          } else {
             $r->print($home_server_pick);              $r->print($home_server_pick);
         }          }
         if ($context eq 'domain') {  
             $r->print(&Apache::lonuserutils::forceid_change());  
         }  
         $r->print('</div>'."\n".'<div class="LC_left_float"><h3>'.          $r->print('</div>'."\n".'<div class="LC_left_float"><h3>'.
                   $lt{'lg'}.'</h3>');                    $lt{'lg'}.'</h3>');
         my ($fixedauth,$varauth,$authmsg);           my ($fixedauth,$varauth,$authmsg); 
Line 788  $forminfo Line 785  $forminfo
 ENDCHANGEUSER  ENDCHANGEUSER
         $r->print('<div class="LC_left_float">'.          $r->print('<div class="LC_left_float">'.
                   &personal_data_display($ccuname,$ccdomain,$newuser,                    &personal_data_display($ccuname,$ccdomain,$newuser,
                                          %inst_results).                                           %inst_results));
                   '</div>');          if ($context eq 'domain') {
               $r->print(&Apache::lonuserutils::forceid_change());
           }
           $r->print('</div>');
         my $user_auth_text =           my $user_auth_text = 
             &user_authentication($ccuname,$ccdomain,$krbdefdom,\%abv_auth);              &user_authentication($ccuname,$ccdomain,$krbdefdom,\%abv_auth);
         my $user_quota_text;          my $user_quota_text;
Line 1198  ENDBADAUTH Line 1198  ENDBADAUTH
         }          }
     } else { # Authentication type is valid      } else { # Authentication type is valid
         &initialize_authen_forms($ccdomain,$currentauth);          &initialize_authen_forms($ccdomain,$currentauth);
           my $authformnop_row;      
           if (&Apache::lonnet::allowed('mau',$ccdomain)) {
               $authformnop_row = &Apache::loncommon::start_data_table_row();
           }
         my ($authformcurrent,$authform_other,$can_modify) =          my ($authformcurrent,$authform_other,$can_modify) =
             &modify_login_block($ccdomain,$currentauth);              &modify_login_block($ccdomain,$currentauth);
         if (&Apache::lonnet::allowed('mau',$ccdomain)) {          if (&Apache::lonnet::allowed('mau',$ccdomain)) {
Line 1213  ENDBADAUTH Line 1217  ENDBADAUTH
                        '</script>'."\n".                         '</script>'."\n".
                        '<h3>'.$lt{'ld'}.'</h3>'.                         '<h3>'.$lt{'ld'}.'</h3>'.
                        &Apache::loncommon::start_data_table().                         &Apache::loncommon::start_data_table().
                        &Apache::loncommon::start_data_table_row().                         $authformnop_row.
                        '<td>'.$authformnop;                         '<td>'.$authformnop;
             if ($can_modify) {              if ($can_modify) {
                 $outcome .= '</td>'."\n".                  $outcome .= '</td>'."\n".
Line 1222  ENDBADAUTH Line 1226  ENDBADAUTH
                             '<td>'.$authformcurrent.'</td>'.                              '<td>'.$authformcurrent.'</td>'.
                             &Apache::loncommon::end_data_table_row()."\n";                              &Apache::loncommon::end_data_table_row()."\n";
             } else {              } else {
                 $outcome .= '&nbsp;('.$authformcurrent.')</td>';                  $outcome .= '&nbsp;('.$authformcurrent.')</td>'.
                               &Apache::loncommon::end_data_table_row()."\n";
             }              }
             if ($authform_other ne '') {              if ($authform_other ne '') {
                 $outcome .= $authform_other;                  $outcome .= $authform_other;
Line 1695  sub update_user_data { Line 1700  sub update_user_data {
                              'prvs' => "Previous",                               'prvs' => "Previous",
                              'chto' => "Changed To"                               'chto' => "Changed To"
    );     );
                   $r->print('<h4>'.$lt{'uic'}.'</h4>'.
                             &Apache::loncommon::start_data_table().
                             &Apache::loncommon::start_data_table_header_row());
                 $r->print(<<"END");                  $r->print(<<"END");
 <table border="2">      <th>&nbsp;</th>
 <caption>$lt{'uic'}</caption>  
 <tr><th>&nbsp;</th>  
     <th>$lt{'frst'}</th>      <th>$lt{'frst'}</th>
     <th>$lt{'mddl'}</th>      <th>$lt{'mddl'}</th>
     <th>$lt{'lst'}</th>      <th>$lt{'lst'}</th>
     <th>$lt{'gen'}</th>      <th>$lt{'gen'}</th>
     <th>$lt{'id'}</th>      <th>$lt{'id'}</th>
     <th>$lt{'mail'}</th>      <th>$lt{'mail'}</th>
     <th>$lt{'disk'}</th></tr>      <th>$lt{'disk'}</th>
 <tr><td>$lt{'prvs'}</td>  END
                   $r->print(&Apache::loncommon::end_data_table_header_row().
                             &Apache::loncommon::start_data_table_row());
                   $r->print(<<"END");
       <td><b>$lt{'prvs'}</b></td>
     <td>$userenv{'firstname'}  </td>      <td>$userenv{'firstname'}  </td>
     <td>$userenv{'middlename'} </td>      <td>$userenv{'middlename'} </td>
     <td>$userenv{'lastname'}   </td>      <td>$userenv{'lastname'}   </td>
Line 1714  sub update_user_data { Line 1724  sub update_user_data {
     <td>$userenv{'id'}</td>      <td>$userenv{'id'}</td>
     <td>$userenv{'permanentemail'} </td>      <td>$userenv{'permanentemail'} </td>
     <td>$oldportfolioquota Mb</td>      <td>$oldportfolioquota Mb</td>
 </tr>  END
 <tr><td>$lt{'chto'}</td>                  $r->print(&Apache::loncommon::end_data_table_row().
                             &Apache::loncommon::start_data_table_row());
                   $r->print(<<"END");
       <td><b>$lt{'chto'}</b></td>
     <td>$env{'form.cfirstname'}  </td>      <td>$env{'form.cfirstname'}  </td>
     <td>$env{'form.cmiddlename'} </td>      <td>$env{'form.cmiddlename'} </td>
     <td>$env{'form.clastname'}   </td>      <td>$env{'form.clastname'}   </td>
     <td>$env{'form.cgeneration'} </td>      <td>$env{'form.cgeneration'} </td>
     <td>$env{'form.cid'} </td>      <td>$env{'form.cid'} </td>
     <td>$env{'form.cpermanentemail'} </td>      <td>$env{'form.cpermanentemail'} </td>
     <td>$newportfolioquota Mb $defquotatext </td></tr>      <td>$newportfolioquota Mb $defquotatext </td>
 </table>  
 END  END
                   $r->print(&Apache::loncommon::end_data_table_row().
                             &Apache::loncommon::end_data_table());
                 if (($forceid) && ($recurseid) && (!$disallowed_id) &&                  if (($forceid) && ($recurseid) && (!$disallowed_id) &&
                     (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) {                      (&Apache::lonnet::allowed('mau',$env{'form.ccdomain'}))) {
                     my %userupdate = (                      my %userupdate = (
Line 1802  END Line 1816  END
         $r->print(&mt('Revoking [_1] in [_2]: [_3]',          $r->print(&mt('Revoking [_1] in [_2]: [_3]',
       $role,$scope,'<b>'.$result.'</b>').'<br />');        $role,$scope,'<b>'.$result.'</b>').'<br />');
  if ($role eq 'st') {   if ($role eq 'st') {
                     my $result =      my $result = 
                         &Apache::lonuserutils::classlist_drop($scope,                          &Apache::lonuserutils::classlist_drop($scope,
                             $env{'form.ccuname'},$env{'form.ccdomain'},                              $env{'form.ccuname'},$env{'form.ccdomain'},
                             $now);      $now);
     $r->print($result);      $r->print($result);
  }   }
     }      }
Line 1829  END Line 1843  END
         $r->print(&mt('Deleting [_1] in [_2]: [_3]',$role,$scope,          $r->print(&mt('Deleting [_1] in [_2]: [_3]',$role,$scope,
       '<b>'.$result.'</b>').'<br />');        '<b>'.$result.'</b>').'<br />');
  if ($role eq 'st') {   if ($role eq 'st') {
                     my $result =      my $result = 
                         &Apache::lonuserutils::classlist_drop($scope,                          &Apache::lonuserutils::classlist_drop($scope,
                             $env{'form.ccuname'},$env{'form.ccdomain'},                              $env{'form.ccuname'},$env{'form.ccdomain'},
                             $now);      $now);
     $r->print($result);      $r->print($result);
  }   }
             }              }
Line 2379  sub handler { Line 2393  sub handler {
         $context = 'domain';          $context = 'domain';
     }      }
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
                                             ['action','state']);          ['action','state','callingform','roletype','showrole','bulkaction']);
     &Apache::lonhtmlcommon::clear_breadcrumbs();      &Apache::lonhtmlcommon::clear_breadcrumbs();
     &Apache::lonhtmlcommon::add_breadcrumb      if ($env{'form.action'} ne 'dateselect') {
         ({href=>"/adm/createuser",          &Apache::lonhtmlcommon::add_breadcrumb
           text=>"User Management"});              ({href=>"/adm/createuser",
                 text=>"User Management"});
       }
     my ($permission,$allowed) = &get_permission($context);      my ($permission,$allowed) = &get_permission($context);
     if (!$allowed) {      if (!$allowed) {
         $env{'user.error.msg'}=          $env{'user.error.msg'}=
Line 2433  sub handler { Line 2449  sub handler {
         if (! exists($env{'form.state'})) {          if (! exists($env{'form.state'})) {
             &Apache::lonuserutils::print_expire_menu($r,$context);              &Apache::lonuserutils::print_expire_menu($r,$context);
         } elsif ($env{'form.state'} eq 'done') {          } elsif ($env{'form.state'} eq 'done') {
             &Apache::lonuserutils::expire_user_list($r);              &Apache::lonuserutils::expire_user_list($r,$context);
         } else {          } else {
             &Apache::lonuserutils::print_expire_menu($r,$context);              &Apache::lonuserutils::print_expire_menu($r,$context);
         }          }
Line 2498  sub handler { Line 2514  sub handler {
             &custom_role_editor($r);              &custom_role_editor($r);
         }          }
     } elsif ($env{'form.action'} eq 'listusers' && $permission->{'view'}) {      } elsif ($env{'form.action'} eq 'listusers' && $permission->{'view'}) {
         my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles);          if ($env{'form.phase'} eq 'bulkchange') {
         my $formname = 'studentform';              &Apache::lonhtmlcommon::add_breadcrumb
         if ($context eq 'domain' && $env{'form.roletype'} eq 'course') {                  ({href=>'backPage(document.studentform)',
             ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles) =                     text=>"List Users"});
                 &Apache::lonuserutils::courses_selector($env{'request.role.domain'},              my $setting = $env{'form.roletype'};
                                                         $formname);              my $choice = $env{'form.bulkaction'};
             my $js = &add_script($jscript).$cb_jscript;              $r->print(&header());
             my $loadcode =               $r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users",
                 &Apache::lonuserutils::course_selector_loadcode($formname);                                                            'User_Management_List'));
             if ($loadcode ne '') {              if ($permission->{'cusr'}) {
                 $r->print(&header($js,{'onload' => $loadcode,}));                  &Apache::lonuserutils::update_user_list($r,$context,$setting,$choice);
               }
           } else {
               &Apache::lonhtmlcommon::add_breadcrumb
                   ({href=>'/adm/createuser?action=listusers',
                     text=>"List Users"});
               my ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles);
               my $formname = 'studentform';
               if ($context eq 'domain' && $env{'form.roletype'} eq 'course') {
                   ($cb_jscript,$jscript,$totcodes,$codetitles,$idlist,$idlist_titles) = 
                       &Apache::lonuserutils::courses_selector($env{'request.role.domain'},
                                                               $formname);
                   $jscript .= &verify_user_display();
                   my $js = &add_script($jscript).$cb_jscript;
                   my $loadcode = 
                       &Apache::lonuserutils::course_selector_loadcode($formname);
                   if ($loadcode ne '') {
                       $r->print(&header($js,{'onload' => $loadcode,}));
                   } else {
                       $r->print(&header($js));
                   }
             } else {              } else {
                 $r->print(&header($js));                  $r->print(&header(&add_script(&verify_user_display())));
             }              }
         } else {              $r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users",
             $r->print(&header());                                                            'User_Management_List'));
               &Apache::lonuserutils::print_userlist($r,undef,$permission,$context,
                            $formname,$totcodes,$codetitles,$idlist,$idlist_titles);
               $r->print(&Apache::loncommon::end_page());
         }          }
         &Apache::lonhtmlcommon::add_breadcrumb  
             ({href=>'/adm/createuser?action=listusers',  
               text=>"List Users"});  
         $r->print(&Apache::lonhtmlcommon::breadcrumbs("List Users",  
                                                       'User_Management_List'));  
         &Apache::lonuserutils::print_userlist($r,undef,$permission,$context,  
                      $formname,$totcodes,$codetitles,$idlist,$idlist_titles);  
         $r->print(&Apache::loncommon::end_page());  
     } elsif ($env{'form.action'} eq 'expire' && $permission->{'cusr'}) {      } elsif ($env{'form.action'} eq 'expire' && $permission->{'cusr'}) {
         $r->print(&header());          $r->print(&header());
         &Apache::lonhtmlcommon::add_breadcrumb          &Apache::lonhtmlcommon::add_breadcrumb
Line 2533  sub handler { Line 2564  sub handler {
         if (! exists($env{'form.state'})) {          if (! exists($env{'form.state'})) {
             &Apache::lonuserutils::print_expire_menu($r,$context);              &Apache::lonuserutils::print_expire_menu($r,$context);
         } elsif ($env{'form.state'} eq 'done') {          } elsif ($env{'form.state'} eq 'done') {
             &Apache::lonuserutiles::expire_user_list($r);              &Apache::lonuserutiles::expire_user_list($r,$context);
         } else {          } else {
             &print_expire_menu($r,$context);              &print_expire_menu($r,$context);
         }          }
         $r->print(&Apache::loncommon::end_page());          $r->print(&Apache::loncommon::end_page());
       } elsif ($env{'form.action'} eq 'dateselect') {
           if ($permission->{'cusr'}) {
               $r->print(&header(undef,undef,{'no_nav_bar' => 1}).
                         &Apache::lonuserutils::date_section_selector($context).
                         &Apache::loncommon::end_page());
           } else {
               $r->print(&header().
                        '<span class="LC_error">'.&mt('You do not have permission to modify dates or sections for users').'</span>'. 
                        &Apache::loncommon::end_page());
           }
     } else {      } else {
         $r->print(&header());          $r->print(&header());
         $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));            $r->print(&print_main_menu($permission));          $r->print(&Apache::lonhtmlcommon::breadcrumbs('User Management'));
           $r->print(&print_main_menu($permission));
         $r->print(&Apache::loncommon::end_page());          $r->print(&Apache::loncommon::end_page());
     }      }
     return OK;      return OK;
 }  }
   
 sub header {  sub header {
     my ($jscript,$loaditems) = @_;      my ($jscript,$loaditems,$args) = @_;
     my $start_page;      my $start_page;
     if (ref($loaditems) eq 'HASH') {      if (ref($loaditems) eq 'HASH') {
         $start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems,});          $start_page=&Apache::loncommon::start_page('User Management',$jscript,{'add_entries' => $loaditems});
     } else {      } else {
         $start_page=&Apache::loncommon::start_page('User Management',$jscript);          $start_page=&Apache::loncommon::start_page('User Management',$jscript,$args);
     }      }
     return $start_page;      return $start_page;
 }  }
Line 2562  sub add_script { Line 2604  sub add_script {
     return '<script type="text/javascript">'."\n".$js."\n".'</script>';      return '<script type="text/javascript">'."\n".$js."\n".'</script>';
 }  }
   
   sub verify_user_display {
       my $output = <<"END";
   
   function display_update() {
       document.studentform.action.value = 'listusers';
       document.studentform.phase.value = 'display';
       document.studentform.submit();
   }
   
   END
       return $output;
   
   }
   
 ###############################################################  ###############################################################
 ###############################################################  ###############################################################
 #  Menu Phase One  #  Menu Phase One
Line 3136  sub course_level_table { Line 3192  sub course_level_table {
 <td>'.$area.'<br />Domain: '.$domain.'</td>'."\n";  <td>'.$area.'<br />Domain: '.$domain.'</td>'."\n";
         if ($role ne 'cc') {          if ($role ne 'cc') {
                     if (%sections_count) {                      if (%sections_count) {
                         my $currsec =                          my $currsec = 
                             &Apache::lonuserutils::course_sections(\%sections_count,                              &Apache::lonuserutils::course_sections(\%sections_count,
                                                        $protectedcourse.'_'.$role);                                                          $protectedcourse.'_'.$role);
                         $table .=                           $table .= 
                     '<td><table class="LC_createuser">'.                      '<td><table class="LC_createuser">'.
                      '<tr class="LC_section_row">                       '<tr class="LC_section_row">
Line 3178  ENDTIMEENTRY Line 3234  ENDTIMEENTRY
 <td>'.$plrole.'</td>  <td>'.$plrole.'</td>
 <td>'.$area.'</td>'."\n";  <td>'.$area.'</td>'."\n";
                 if (%sections_count) {                  if (%sections_count) {
                     my $currsec =                      my $currsec = 
                         &Apache::lonuserutils::course_sections(\%sections_count,                          &Apache::lonuserutils::course_sections(\%sections_count,
                                                                $customrole);                                                                 $customrole);
                     $table.=                      $table.=

Removed from v.1.198  
changed lines
  Added in v.1.202


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