Diff for /loncom/interface/lonsupportreq.pm between versions 1.59 and 1.60

version 1.59, 2010/12/02 06:00:12 version 1.60, 2010/12/02 22:05:17
Line 37  use Apache::lonnet; Line 37  use Apache::lonnet;
 use Apache::lonlocal;  use Apache::lonlocal;
 use Apache::lonacc();  use Apache::lonacc();
 use Apache::courseclassifier;  use Apache::courseclassifier;
 use LONCAPA;  use LONCAPA qw(:DEFAULT :match);
     
   
 sub handler {  sub handler {
Line 57  sub handler { Line 57  sub handler {
         &Apache::lonacc::get_posted_cgi($r);          &Apache::lonacc::get_posted_cgi($r);
     }      }
     my $function = $env{'form.function'};      my $function = $env{'form.function'};
     my $origurl = &unescape($env{'form.origurl'});      my $origurl = $env{'form.origurl'};
     my $command = $env{'form.command'};      my $command = $env{'form.command'};
   
     if ($command eq 'process') {      if ($command eq 'process') {
Line 77  sub print_request_form { Line 77  sub print_request_form {
     $browser = $env{'browser.type'};      $browser = $env{'browser.type'};
     $bversion = $env{'browser.version'};      $bversion = $env{'browser.version'};
     $uhost = $env{'request.host'};      $uhost = $env{'request.host'};
     my ($uname,$udom);      my ($uname,$udom,$public);
     if (($env{'user.name'} ne 'public') && ($env{'user.domain'} ne 'public')) {      if (($env{'user.name'} eq 'public') && ($env{'user.domain'} eq 'public')) {
           $public = 1;
       } else {
         $uname = $env{'user.name'};          $uname = $env{'user.name'};
         $udom = $env{'user.domain'};          $udom = $env{'user.domain'};
     }      }
Line 175  END Line 177  END
         my ($sec,$grp) = split(/:/,$section);          my ($sec,$grp) = split(/:/,$section);
         $groupid{$sec} = $grp;          $groupid{$sec} = $grp;
     }      }
     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom']);      &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['codedom',
                                                    'useremail','useraccount']);
       if ($env{'form.origurl'} eq '/adm/createaccount') {
           if ($email eq '') {
               if ($env{'form.useremail'} =~ /^[^\@]+\@[^\@]+$/) {
                   $email = &HTML::Entities::encode($env{'form.useremail'},'"<>&');
               }
           }
           if ($uname eq '') {
               if ($env{'form.useraccount'} =~ /^$match_username$/) {
                   $uname = &HTML::Entities::encode($env{'form.useraccount'},'"<>&');
               }
           }
       }
     my $codedom = &get_domain();      my $codedom = &get_domain();
     my $details_title;      my $details_title;
     if ($codedom) {      if ($codedom) {
Line 269  function initialize_codes() { Line 284  function initialize_codes() {
                &Apache::lonhtmlcommon::row_closure();                 &Apache::lonhtmlcommon::row_closure();
     $num ++;      $num ++;
     $i = $num%2;      $i = $num%2;
     if (defined($uname)) {      if (($env{'user.name'} =~ /^$match_username$/) && (!$public)) {
         $output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]).          $output .= &Apache::lonhtmlcommon::row_title($lt{'emac'},undef,$css[$i]).
                    '<input type="text" size="50" name="cc" value="" /><br />'."\n".                     '<input type="text" size="50" name="cc" value="" /><br />'."\n".
                    &Apache::lonhtmlcommon::row_closure();                     &Apache::lonhtmlcommon::row_closure();
Line 281  function initialize_codes() { Line 296  function initialize_codes() {
                      &HTML::Entities::encode($udom,'"<>&').'" />';                       &HTML::Entities::encode($udom,'"<>&').'" />';
     my $uname_input = '<input type="hidden" name="uname" value="'.      my $uname_input = '<input type="hidden" name="uname" value="'.
                       &HTML::Entities::encode($uname,'"<>&').'" />';                         &HTML::Entities::encode($uname,'"<>&').'" />'; 
     if (defined($uname) && defined($udom)) {      if (($env{'user.name'} =~ /^$match_username$/) && 
           ($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) {
         $output .= '<i>'.$lt{'unme'}.'</i>:&nbsp;'.$uname.'&nbsp;&nbsp;<i>'.$lt{'doma'}.'</i>:&nbsp;'.$udom.$udom_input.$uname_input;          $output .= '<i>'.$lt{'unme'}.'</i>:&nbsp;'.$uname.'&nbsp;&nbsp;<i>'.$lt{'doma'}.'</i>:&nbsp;'.$udom.$udom_input.$uname_input;
     } else {      } else {
         my $udomform = '';          my $udomform = '';
         my $unameform = '';          my $unameform = '';
         if (defined($udom)) {          if (($env{'user.domain'} =~ /^$match_domain$/) && (!$public)) {
             $output .= $lt{'entu'};              $output .= $lt{'entu'};
         } elsif (defined($uname)) {          } elsif (($env{'user.name'} =~ /^$match_username$/) && (!$public)) { 
             $output .= $lt{'chdo'};              $output .= $lt{'chdo'};
         } else {          } else {
             $output .= $lt{'entr'};              $output .= $lt{'entr'};
         }          }
         $output .= '<br />';          $output .= '<br />';
         if (defined($udom)) {          if (!$public) {
             $udomform = '<i>'.$lt{'doma'}.'</i>:&nbsp;'.$udom.$udom_input;              if ($env{'user.domain'} =~ /^$match_domain$/) {
         } elsif (defined($uname)) {                  $udomform = '<i>'.$lt{'doma'}.'</i>:&nbsp;'.$udom.$udom_input;
             $unameform = '<i>'.$lt{'unme'}.'</i>:&nbsp;'.$uname.'&nbsp;&nbsp;'.$uname_input;              } elsif ($env{'user.name'} =~ /^$match_username$/) {
                   $unameform = '<i>'.$lt{'unme'}.'</i>:&nbsp;'.$uname.'&nbsp;&nbsp;'.$uname_input;
               }
         }          }
         if ($udomform eq '') {          if ($udomform eq '') {
             $udomform = '<i>'.$lt{'doma'}.'</i>:&nbsp;';              $udomform = '<i>'.$lt{'doma'}.'</i>:&nbsp;';
             $udomform .= &Apache::loncommon::select_dom_form($codedom,'udom');              $udomform .= &Apache::loncommon::select_dom_form($codedom,'udom');
         }          }
         if ($unameform eq '') {          if ($unameform eq '') {
             $unameform= '<i>'.$lt{'unme'}.'</i>:&nbsp;<input type="text" size="12" name="uname" value="'.$uname.'" />&nbsp;&nbsp;';              $unameform= '<i>'.$lt{'unme'}.'</i>:&nbsp;<input type="text" size="20" name="uname" value="'.$uname.'" />&nbsp;&nbsp;';
         }          }
         $output .= $unameform.$udomform;          $output .= $unameform.$udomform;
     }      }
Line 432  function initialize_codes() { Line 450  function initialize_codes() {
                &Apache::lonhtmlcommon::row_closure();                 &Apache::lonhtmlcommon::row_closure();
     $num ++;      $num ++;
     $i = $num%2;       $i = $num%2; 
     if (defined($uname)) {      if (($env{'user.name'} =~ /^$match_username$/) && (!$public)) {
         $output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]).          $output .= &Apache::lonhtmlcommon::row_title($lt{'opfi'},undef,$css[$i]).
                    ' <input type="file" name="screenshot" size="20" /><br />'.$lt{'uplf'}."\n".                     ' <input type="file" name="screenshot" size="20" /><br />'.$lt{'uplf'}."\n".
         &Apache::lonhtmlcommon::row_closure();          &Apache::lonhtmlcommon::row_closure();

Removed from v.1.59  
changed lines
  Added in v.1.60


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