frameset.pl
上传用户:dostar
上传日期:2007-01-04
资源大小:21k
文件大小:3k
源码类别:

WEB邮件程序

开发平台:

Perl

  1. #!/usr/local/bin/perl
  2. BEGIN { $APP_PATH=$0; $APP_PATH=~s/(/*)[^/]+$/$1/g; }
  3. # @
  4. # ----------------------------------------------------------------------------------------------------------
  5. # @ This code is (c) 1999 Alexandre Aufrere and NikoSoft.
  6. # @ Published under NPL rights, meaning you have the right
  7. # @ to use and modify this code freely, provided it 
  8. # @ remains available and free. Any modified code should be
  9. # @ submitted to Nikopol Software Corp. or Alexandre Aufrere.
  10. # @ This code is protected by the French laws on Copyright.
  11. # @ Please note that there it comes with NO WARRANTY of any kind,
  12. # @ and especially for any damagbe it could cause to your computer
  13. # @ or network.
  14. # @ Using this code means you agree to this license agreement.
  15. # @ Further information at http://aufrere.citeweb.net/nsc/
  16. # @
  17. # ----------------------------------------------------------------------------------------------------------
  18. # @ 
  19. # @ Project     NS WebMail
  20. # @ 
  21. # @ Filename        inbox.pl
  22. # @ 
  23. # @ Description inbox manager for NS WebMail
  24. # @ 
  25. # @ Version     1.0
  26. # @ 
  27. # @
  28. # ----------------------------------------------------------------------------------------------------------
  29. use Mail::POP3Client;
  30. require $APP_PATH."config.pl";
  31. require $APP_PATH."common.pl";
  32. #use the $cgi object method param() to
  33. #acquire the FORM variables passed by
  34. #the client browser.
  35. &ReadParse;
  36. $loginname = $in{'loginname'};
  37. $password  = $in{'password'};
  38. $POPserver = $in{'POPserver'};
  39. $cache     = "No";
  40. print "Content-type:text/htmlnn";
  41. print "<html>";
  42. print "<frameset cols=90,* border=0 marginwidth=0>
  43.                 <frame
  44. src="$CGI_PATH_NSWM/menu.pl?loginname=$loginname&POPserver=$POPserver&cache=$cache&password=".cryptit($password)."" name=menu>
  45.                  <frame
  46. src="$CGI_PATH_NSWM/inbox.pl?loginname=$loginname&POPserver=$POPserver&cache=$cache&password=".cryptit($password)."" name=main>
  47.         </frameset>";
  48. print "</html>";
  49. exit;
  50. ###############################################################################
  51. sub ReadParse {
  52.   local(*in)=@_ if @_;
  53.   local ($i,$key,$val);
  54.   if ($ENV{'REQUEST_METHOD'} eq "GET") {
  55.     $in=$ENV{'QUERY_STRING'};
  56.   }
  57.   elsif ($ENV{'REQUEST_METHOD'} eq "POST") {
  58.     read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
  59.   }
  60.   @in=split(/&/,$in);
  61.   foreach $i (0 .. $#in) {
  62.     $in[$i] =~ s/+/ /g;
  63.     ($key,$val)=split(/=/,$in[$i],2);
  64.     $key =~ s/%(..)/pack("c",hex($1))/ge;
  65.     $val =~ s/%(..)/pack("c",hex($1))/ge;
  66.     $in{$key} .= "" if (defined($in{$key}));
  67.     $in{$key} .=$val;
  68.   }
  69.   return length($in);
  70. }