Diff for /loncom/interface/loncreateuser.pm between versions 1.12 and 1.18

version 1.12, 2001/04/12 19:43:49 version 1.18, 2001/08/24 21:09:53
Line 17 Line 17
 # 2/14 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  # 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 Gerd Kortemeyer 
 #  #
 package Apache::loncreateuser;  package Apache::loncreateuser;
   
Line 108  ENDENHEAD Line 110  ENDENHEAD
     my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain);      my $uhome=&Apache::lonnet::homeserver($ccuname,$ccdomain);
     my %incdomains;       my %incdomains; 
     my %inccourses;      my %inccourses;
     $incdomains{$ENV{'user.domain'}}=1;      map {
          $incdomains{$_}=1;
       } values %Apache::lonnet::hostdom;
     map {      map {
  if ($_=~/^user\.priv\.cm\.\/(\w+)\/(\w+)/) {   if ($_=~/^user\.priv\.cm\.\/(\w+)\/(\w+)/) {
     $inccourses{$1.'_'.$2}=1;      $inccourses{$1.'_'.$2}=1;
Line 123  function setkrb(vf) { Line 127  function setkrb(vf) {
        vf.login[0].checked=true;         vf.login[0].checked=true;
        vf.krbdom.value=vf.krbdom.value.toUpperCase();         vf.krbdom.value=vf.krbdom.value.toUpperCase();
        vf.intpwd.value='';         vf.intpwd.value='';
          vf.locarg.value='';
    }     }
 }  }
   
Line 130  function setint(vf) { Line 135  function setint(vf) {
     if (vf.intpwd.value!='') {      if (vf.intpwd.value!='') {
        vf.login[1].checked=true;         vf.login[1].checked=true;
        vf.krbdom.value='';         vf.krbdom.value='';
          vf.locarg.value='';
      }
   }
   
   function setloc(vf) {
       if (vf.locarg.value!='') {
          vf.login[2].checked=true;
          vf.krbdom.value='';
          vf.intpwd.value='';
    }     }
 }  }
   
 function clickkrb(vf) {  function clickkrb(vf) {
     vf.krbdom.value='$krbdefdom';      vf.krbdom.value='$krbdefdom';
     vf.intpwd.value='';      vf.intpwd.value='';
       vf.locarg.value='';
 }  }
   
 function clickint(vf) {  function clickint(vf) {
     vf.krbdom.value='';      vf.krbdom.value='';
       vf.locarg.value='';
   }
   
   function clickloc(vf) {
       vf.krbdom.value='';
       vf.intpwd.value='';
 }  }
 </script>  </script>
 <input type=hidden name=makeuser value=1>  <input type=hidden name=makeuser value=1>
Line 158  Kerberos authenticated with domain Line 179  Kerberos authenticated with domain
 <input type=radio name=login value=int onClick="clickint(this.form);">   <input type=radio name=login value=int onClick="clickint(this.form);"> 
 Internally authenticated (with initial password   Internally authenticated (with initial password 
 <input type=text size=10 name=intpwd onChange="setint(this.form);">)  <input type=text size=10 name=intpwd onChange="setint(this.form);">)
   <p>
   <input type=radio name=login value=loc onClick="clickloc(this.form);" />
   Local Authentication with argument
   <input type=text size=10 name=locarg onChange="setloc(this.form);" />
   </p>
 ENDNUSER  ENDNUSER
     } else {      } else {
  $r->print('<h2>Existing user '.$ccuname.' at '.$ccdomain.'</h2>');   $r->print('<h2>Existing user '.$ccuname.' at '.$ccdomain.'</h2>');
Line 194  ENDNUSER Line 220  ENDNUSER
                  $area=$carea;                   $area=$carea;
       } else {        } else {
                  if ($area=~/^\/(\w+)\//) {                   if ($area=~/^\/(\w+)\//) {
      $incdomains{$1}=1;  
                      if (&Apache::lonnet::allowed('c'.$trole,$1)) {                       if (&Apache::lonnet::allowed('c'.$trole,$1)) {
  $allows=1;   $allows=1;
                      }                       }
Line 228  ENDNUSER Line 253  ENDNUSER
    $r->print('</table>');     $r->print('</table>');
          }              }   
     }      }
     $r->print('<hr><h3>Add Roles</h3><h4>System Level</h4>');      $r->print('<hr><h3>Add Roles</h3>');
   #
   # Co-Author
   # 
   
       if (&Apache::lonnet::allowed('cca',$ENV{'user.domain'})) {
    my $cuname=$ENV{'user.name'};
           my $cudom=$ENV{'user.domain'};
          $r->print(<<ENDCOAUTH);
   <h4>Construction Space</h4>
   <table border=2><tr><th>Activate</th><th>Role</th><th>Extent</th>
   <th>Start</th><th>End</th></tr>
   <tr>
   <td><input type=checkbox name="act_$cudom\_$cuname\_ca"></td>
   <td>Co-Author</td>
   <td>$cudom\_$cuname</td>
   <td><input type=hidden name="start_$cudom\_$cuname\_ca" value=''>
   <a href=
   "javascript:pjump('date_start','Start Date Co-Author',document.cu.start_$cudom\_$cuname\_ca.value,'start_$cudom\_$cuname\_ca','cu.pres','dateset')">Set Start Date</a></td>
   <td><input type=hidden name="end_$cudom\_$cuname\_ca" value=''>
   <a href=
   "javascript:pjump('date_end','End Date Co-Author',document.cu.end_$cudom\_$cuname\_ca.value,'end_$cudom\_$cuname\_ca','cu.pres','dateset')">Set End Date</a></td>
   </tr>
   </table>
   ENDCOAUTH
       }
 #  #
 # Domain level  # Domain level
 #  #
Line 265  ENDDROW Line 315  ENDDROW
     '<th>Group/Section</th><th>Start</th><th>End</th></tr>');      '<th>Group/Section</th><th>Start</th><th>End</th></tr>');
     map {      map {
  my $thiscourse=$_;   my $thiscourse=$_;
         $thiscourse=~s/\_/\//g;   my $protectedcourse=$_;
           $thiscourse=~s:_:/:g;
         my %coursedata=&Apache::lonnet::coursedescription($thiscourse);          my %coursedata=&Apache::lonnet::coursedescription($thiscourse);
         my $area=$coursedata{'description'};          my $area=$coursedata{'description'};
         my $bgcol=$thiscourse;          my $bgcol=$thiscourse;
Line 274  ENDDROW Line 325  ENDDROW
         map {          map {
             if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) {              if (&Apache::lonnet::allowed('c'.$_,$thiscourse)) {
                my $plrole=&Apache::lonnet::plaintext($_);                 my $plrole=&Apache::lonnet::plaintext($_);
                $r->print(<<ENDROW);                 $r->print("
 <tr bgcolor=#$bgcol>  <tr bgcolor=#$bgcol>
 <td><input type=checkbox name="act_$thiscourse\_$_"></td>  <td><input type=checkbox name=\"act_$protectedcourse\_$_\"></td>
 <td>$plrole</td>  <td>$plrole</td>
 <td>$area</td>  <td>$area</td>
 <td><input type=text size=5 name="sec_$thiscourse\_$_"></td>  <td>");
 <td><input type=hidden name="start_$thiscourse\_$_" value=''>         if ($_ ne 'cc') {
    $r->print("<input type=text size=5 name=\"sec_$protectedcourse\_$_\">");
          } else { $r->print("&nbsp"); }
          $r->print(<<ENDROW);
   <td><input type=hidden name="start_$protectedcourse\_$_" value=''>
 <a href=  <a href=
 "javascript:pjump('date_start','Start Date $plrole',document.cu.start_$thiscourse\_$_.value,'start_$thiscourse\_$_','cu.pres','dateset')">Set Start Date</a></td>  "javascript:pjump('date_start','Start Date $plrole',document.cu.start_$protectedcourse\_$_.value,'start_$protectedcourse\_$_','cu.pres','dateset')">Set Start Date</a></td>
 <td><input type=hidden name="end_$thiscourse\_$_" value=''>  <td><input type=hidden name="end_$protectedcourse\_$_" value=''>
 <a href=  <a href=
 "javascript:pjump('date_end','End Date $plrole',document.cu.end_$thiscourse\_$_.value,'end_$thiscourse\_$_','cu.pres','dateset')">Set End Date</a></td>  "javascript:pjump('date_end','End Date $plrole',document.cu.end_$protectedcourse\_$_.value,'end_$protectedcourse\_$_','cu.pres','dateset')">Set End Date</a></td>
 </tr>  </tr>
 ENDROW  ENDROW
   
             }              }
         } ('st','ta','ep','ad','in','cc');          } ('st','ta','ep','ad','in','cc');
     } sort keys %inccourses;      } sort keys %inccourses;
Line 323  ENDTHREEHEAD Line 377  ENDTHREEHEAD
         } elsif ($ENV{'form.login'} eq 'int') {          } elsif ($ENV{'form.login'} eq 'int') {
            $amode='internal';             $amode='internal';
            $genpwd=$ENV{'form.intpwd'};             $genpwd=$ENV{'form.intpwd'};
         }          } elsif ($ENV{'form.login'} eq 'loc') {
       $amode='localauth';
       $genpwd=$ENV{'form.locarg'};
       if (!$genpwd) { $genpwd=" "; }
    }
         if (($amode) && ($genpwd)) {          if (($amode) && ($genpwd)) {
           $r->print('Generating user: '.&Apache::lonnet::modifyuser(            $r->print('Generating user: '.&Apache::lonnet::modifyuser(
                       $ENV{'form.cdomain'},$ENV{'form.cuname'},                        $ENV{'form.cdomain'},$ENV{'form.cuname'},

Removed from v.1.12  
changed lines
  Added in v.1.18


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