menu.pl
上传用户:dostar
上传日期:2007-01-04
资源大小:21k
文件大小:3k
- #!/usr/local/bin/perl
- BEGIN { $APP_PATH=$0; $APP_PATH=~s/(/*)[^/]+$/$1/g; }
- # @ ----------------------------------------------------------------------------------------------------------
- # @ This code is (c) 1999 Alexandre Aufrere and NikoSoft.
- # @ Published under NPL rights, meaning you have the right
- # @ to use and modify this code freely, provided it
- # @ remains available and free. Any modified code should be
- # @ submitted to Nikopol Software Corp. or Alexandre Aufrere.
- # @ This code is protected by the French laws on Copyright.
- # @ Please note that there it comes with NO WARRANTY of any kind,
- # @ and especially for any damagbe it could cause to your computer
- # @ or network.
- # @ Using this code means you agree to this license agreement.
- # @ Further information at http://aufrere.citeweb.net/nsc/
- # @ ----------------------------------------------------------------------------------------------------------
- # @
- # @ Project NS WebMail
- # @
- # @ Filename menu.pl
- # @
- # @ Description menu frame of NS WebMail
- # @
- # @ Version 1.0
- # @
- # @ ----------------------------------------------------------------------------------------------------------
- use Mail::POP3Client;
- require $APP_PATH."config.pl";
- require $APP_PATH."common.pl";
- #use the $cgi object method param() to
- #acquire the FORM variables passed by
- #the client browser.
- &ReadParse;
- $loginname = $in{'loginname'};
- $password = $in{'password'};
- $POPserver = $in{'POPserver'};
- $cache = $in{'cache'};
- $|=1;
- # HTML Code
- print "Content-type:text/htmlnn";
- print "<HTML><HEAD><TITLE>NS WM Message Retrieval</TITLE>";
- print "<BODY BGCOLOR=$lightbgcolor LINK=$linkcolor TEXT=$linkcolor VLINK=$linkcolor ALINK=$linkcolor>n";
- print "<br>n<br>n";
- print "<a href="sendform.pl?loginname=$loginname&POPserver=$POPserver&cache=$cache&password=$password" target="main">$newmsgtext</a><br><br>n";
- print "<a href="inbox.pl?loginname=$loginname&POPserver=$POPserver&cache=$cache&password=$password" target="main">$inboxtext</a><br><br>n";
- print "<a href="sentmail.pl?loginname=$loginname&POPserver=$POPserver&cache=$cache&password=$password" target="main">$sentmsgtext</a><br><br>n";
- print "<a href="login.pl" target=dyna>$logouttext</a><BR>n";
- print "</BODY>n</HTML>n";
- exit;
- ###############################################################
- sub ReadParse {
- local(*in)=@_ if @_;
- local ($i,$key,$val);
- if ($ENV{'REQUEST_METHOD'} eq "GET") {
- $in=$ENV{'QUERY_STRING'};
- }
- elsif ($ENV{'REQUEST_METHOD'} eq "POST") {
- read(STDIN,$in,$ENV{'CONTENT_LENGTH'});
- }
- @in=split(/&/,$in);
- foreach $i (0 .. $#in) {
- $in[$i] =~ s/+/ /g;
- ($key,$val)=split(/=/,$in[$i],2);
- $key =~ s/%(..)/pack("c",hex($1))/ge;
- $val =~ s/%(..)/pack("c",hex($1))/ge;
- $in{$key} .= "