hi,
i'm moving a bunch of modules from machine 1 to machine 2 and having
some trouble. basically, the authorization scheme (taken from lincoln
stein's example code with a few trivial changes), which had been
working for some time on machine 1, is showing what appear to be some
strange (to me) dereferencing problems on the new machine. is this a
known issue?
the code was written some time ago so moving to the new machine means
upgrading the version of perl and CGI.pm at the same time, plus a
change of OS (sun to rh linux), all at once; i'm sort of stuck on
where to begin to attack the problem. i'm hoping someone can point me
in the right direction. i've been searching and reading all morning
with no luck.
DETAILS:
machine 1:
perl version 5.005_03 built for sun4-solaris
CGI.pm version 2.46
SunOS barney 5.7 Generic_106541-04 sun4m sparc SUNW,SPARCstation-20
Apache/1.3.12 (Unix) ApacheJServ/1.1 mod_perl/1.21 mod_ssl/2.6.2 OpenSSL/0.9.5
configured
machine 2 (the new machine):
This is perl, v5.6.0 built for i386-linux
CGI.pm version 3.02
Linux moe 2.4.2-2smp #1 SMP Sun Apr 8 20:21:34 EDT 2001 i686 unknown
Apache/1.3.20 (Unix) mod_gzip/1.3.19.1a mod_perl/1.25 configured
THE OUTPUT (on the new machine):
[prooney@homer prooney]$ lynx --mime_header http://www.olivesnyc.com/stafflogin2
HTTP/1.1 200 OK
Date: Fri, 06 Jul 2001 17:15:16 GMT
Server: Apache/1.3.20 (Unix) mod_gzip/1.3.19.1a mod_perl/1.25
Connection: close
Content-Type: text/html
<!DOCTYPE HTML PUBLIC "ARRAY(0x89fafcc)">
<HTML><HEAD><TITLE></TITLE>
<LINK REV=MADE HREF="mailto:CGI%3A%3AObject%3DHASH%280x8a434d8%29">
<LINK REL="stylesheet" HREF="/Common/css/restaurant.css">
</HEAD>
<BODY bgcolor white><H1>Please Log In</H1><H2>
<FONT>Error: TESTING MAKE LOGIN SUBROUTINE</FONT></H2><FORM METHOD="POST"
ACTION="/stafflogin2" ENCTYPE="text/css">
<TABLE>
<TR><TD>UserName</TD>
<TD><INPUT TYPE="text" NAME="user"></TD></TR>
<TR><TD>Password</TD>
<TD><INPUT TYPE="password" NAME="password"></TD></TR>
</TABLE><INPUT TYPE="hidden" NAME="" VALUE="">
<INPUT TYPE="submit" NAME="" VALUE=""><P></FORM>
<P><EM>Note:
</EM>You must set your browser to accept cookies in order for login to
succeed.
You will be asked to log in again after some period of time has elapsed.
----------------
THE CODE:
(stripped down to one subroutine call, which works fine -- i.e. produces a working
HTML form,
without the weird mailto: and DOCTYPE declarations, etc. -- on machine 1):
package Apache::TicketMaster2;
use strict;
use Apache::Constants qw(:common);
use Apache::TicketTool ();
use CGI '-autoload';
# This is the log-in screen that provides authentication cookies.
# There should already be a cookie named "request_uri" that tells
# the login screen where the original request came from.
sub handler {
my $r = shift;
my $msg = "TESTING MAKE LOGIN SUBROUTINE";
my $request_uri = "http://www.olivesnyc.com/staff.html";
make_login_screen($r, $msg, $request_uri);
return OK;
}
sub make_login_screen {
#added the $r var to get at stylesheet constant
my($r, $msg, $request_uri) = @_;
my $stylesheet = $r->dir_config('STYLESHEET') ;
print header(),
start_html(-title => 'Log In',
-style =>{-src=> $stylesheet },
-bgcolor => 'white'),
h1({-class => 'AuthTitle'},'Please Log In');
print h2(font({color => 'red'}, "Error: $msg")) if $msg;
print start_form(-action => script_name()),
table(Tr(td({-class => 'SimpleText'}, ['UserName', textfield(-name
=> 'user')])),
Tr(td({-class => 'SimpleText'}, ['Password',
password_field(-name => 'password')]))
),
hidden(-name => 'request_uri', -value => $request_uri),
submit('Log In'), p(),
end_form(),
p({-class => 'SimpleText'} ), em('Note: '),
"You must set your browser to accept cookies in order
for login to succeed.",
"You will be asked to log in again after some period of
time has elapsed.";
}
1;
__END__