Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl
[MP2]mod_perl and index.html
 

Index | Next | Previous | View Flat


titetluc at gmail

Jun 24, 2008, 11:50 PM


Views: 1325
Permalink
[MP2]mod_perl and index.html

Hello all

I am writing a Perl module to authenticate users (using mod_perl2 and httpd
2.2.6.
I would like to display the user name (r->user) when accessing a directory
(/test_index/index.html)

I have the following httpd configuration

<Location /test_index>
DirectoryIndex index.html
Options +indexes
</Location>

PerlModule Test
<Location /test_index/index.html>
Require valid-user
AuthType basic
AuthName test_index
SetHandler perl-script

PerlAuthenHandler Apache2::AuthSSO::Test->set_user

PerlResponseHandler Apache2::AuthSSO::Test->display_user
</Location>

In addition, I added an empty index.html file in the htdocs/test_index
directory

The Perl Test module is

package Test;
use warnings;
use strict;
use Carp;

use Apache2::Const qw(:common);

sub set_user {
my ($self, $r) = @_;
$r->user('myself');
return OK;
}
sub display_user {
my ($self, $r) = @_;
my $user = defined $r->user ? $r->user : 'user is not defined';
print $user;
return OK;
}

1;

When I access with my browser to http://localhost/test_index/index.html,
user is set to 'myself'
BUT when I access with my browser to http://localhost/test_index/ ... user
is not defined !!!

I don't know if the problem comes from mod_perl or from the httpd
configuration.
Any help would be appreciated.

Thanks

Subject User Time
[MP2]mod_perl and index.html titetluc at gmail Jun 24, 2008, 11:50 PM
    Re: [MP2]mod_perl and index.html titetluc at gmail Jun 25, 2008, 11:45 PM
    Re: [MP2]mod_perl and index.html torsten.foertsch at gmx Jun 26, 2008, 4:28 AM
        Re: [MP2]mod_perl and index.html titetluc at gmail Jun 26, 2008, 7:36 AM
    Re: [MP2]mod_perl and index.html torsten.foertsch at gmx Jun 26, 2008, 8:07 AM
        Re: [MP2]mod_perl and index.html titetluc at gmail Jun 27, 2008, 1:37 AM
    Re: [MP2]mod_perl and index.html torsten.foertsch at gmx Jun 27, 2008, 3:02 AM
        Re: [MP2]mod_perl and index.html titetluc at gmail Jun 27, 2008, 5:25 AM
    Re: [MP2]mod_perl and index.html rs at plusw Jun 27, 2008, 5:06 AM
        Re: [MP2]mod_perl and index.html titetluc at gmail Jun 27, 2008, 5:22 AM

  Index | Next | Previous | View Flat
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.