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