Diff for /loncom/CrGenerate.pl between versions 1.7 and 1.9

version 1.7, 2004/07/02 10:19:59 version 1.9, 2009/02/02 13:27:45
Line 80  my $DEBUG = 0;   # 1 for on, 0 for off. Line 80  my $DEBUG = 0;   # 1 for on, 0 for off.
 #    $DEBUG - message is only written if this is true.  #    $DEBUG - message is only written if this is true.
 #  #
 sub Debug {  sub Debug {
     my $msg  = shift;      my ($msg)  = @_;
     if($DEBUG) {      if($DEBUG) {
  print STDERR "$msg\n";   print STDERR "$msg\n";
     }      }
Line 101  sub Debug { Line 101  sub Debug {
 sub DecodeEmailFromRequest {  sub DecodeEmailFromRequest {
     Debug("DecodeEmailFromRequest");      Debug("DecodeEmailFromRequest");
   
     my $RequestFile = shift;      my ($RequestFile) = @_;
     Debug("Request file is called $RequestFile");      Debug("Request file is called $RequestFile");
   
     # We need to look for the line that has a "/Email=" in it.      # We need to look for the line that has a "/Email=" in it.
   
     Debug("opening $RequestFile");      Debug("opening $RequestFile");
     open REQUEST, "< $RequestFile" or      open REQUEST, "< $RequestFile" or
  die "Unable to open $RequestFile to parse return email address";   die "Unable to open $RequestFile to parse return e-mail address";
   
     Debug("Parsing request file");      Debug("Parsing request file");
     my $line;      my $line;
Line 121  sub DecodeEmailFromRequest { Line 121  sub DecodeEmailFromRequest {
  }   }
     }      }
     if(!$found) {      if(!$found) {
  die "There does not appear to be an email address in $RequestFile";   die "There does not appear to be an e-mail address in $RequestFile";
     }      }
   
     close REQUEST;      close REQUEST;
Line 153  sub DecodeEmailFromRequest { Line 153  sub DecodeEmailFromRequest {
     Debug("Futher pulled out $addressequals");      Debug("Futher pulled out $addressequals");
   
     my ($junk, $address) = split(/=/, $addressequals);      my ($junk, $address) = split(/=/, $addressequals);
     Debug("Parsed final email addresss as $address");      Debug("Parsed final e-mail address as $address");
           
   
   
Line 260  sub GenerateRequest { Line 260  sub GenerateRequest {
     print "information.  Most of this information is for documentation\n";      print "information.  Most of this information is for documentation\n";
     print "purposes only, so it's not critical if you make a mistake.\n";      print "purposes only, so it's not critical if you make a mistake.\n";
     print "However:  The generated certificate will be sent to the \n";      print "However:  The generated certificate will be sent to the \n";
     print "Email address you provide, and you should leave the optional\n";      print "E-mail address you provide, and you should leave the optional\n";
     print "Challenge password blank.\n";      print "Challenge password blank.\n";
   
     my $requestcmd = $SSLCommand." req -newkey rsa:1024 "      my $requestcmd = $SSLCommand." req -newkey rsa:1024 "
Line 369  sub MailRequest { Line 369  sub MailRequest {
   
     my $FromEmail = DecodeEmailFromRequest("request.txt");      my $FromEmail = DecodeEmailFromRequest("request.txt");
     if(!$FromEmail) {      if(!$FromEmail) {
  die "From email address cannot be decoded from certificate request";   die "From e-mail address cannot be decoded from certificate request";
     }      }
     Debug("Certificate will be sent back to $FromEmail");      Debug("Certificate will be sent back to $FromEmail");
   

Removed from v.1.7  
changed lines
  Added in v.1.9


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