Re: [OT] Can anyone recommend a good flavour of Cookie?

2002-03-07 Thread Marcel Weber

I prefer Chips Ahoi chocolate chips cookies, but the really chunky ones;-)

(sorry I could not help it...)

Marcel


Jeff wrote:
> Please forgive a mod_perl wannabie [aka woza.PHP4.user]
> 
> I have googled two differing flavoured cookies in the
> mod_perl recipe library:
>   Apache::Cookie
>   Apache::RequestNotes
> 
> and of course, there is the 'Why not hack the HTTP_COOKIE 
> env all by your lonesome?' peppermint flavour too!
> 
> So which is it folks? Please vote for your favourite
> flavour of cookie for poor woza.PHP4.user
> 
> Thanks in advance!
> 
> Jeff.
> 
> PS Any kind Debian soul might also include the name of the 
> .deb containing said flavour?
> 
> PPS Not too keen on the taste of hysterical raisins.
> 
> 
> 
> 
> 






OT Re: Installing Perl::Magick

2002-02-19 Thread Marcel Weber

Sorry, I did not meant giving silly comments ;-) I just saw your email 
[EMAIL PROTECTED] so I thought you would usually work as root.

Marcel



Am Dienstag den, 19. Februar 2002, um 17:22, schrieb Jonathan M. Hollin:

> :: I don't know anything about your problem. I just wanted to
> :: give you a
> :: hint, as you said, that you were a complete linux newbie:
> ::
> :: Do not work as root. It is dangerous! The root account should be for
> :: installation, configuration of the system and where it cannot be
> :: avoided. I always have some regular user account for working on my
> :: servers and as soon that I want to change something I do a "su". The
> :: best is even to disable root logins on the console and
> :: especially via
> :: ssh / telnet. It gives you some extra security as everyone
> :: knows, that
> :: there must be a root account on a unix box.
>
> Marcel, I was working as root after an "su" as I couldn't install
> Image::Magick under my own account.
>
> As far as security goes - I /think/ I have configured my box with only
> the www and ssh services available, everything else is locked down (he
> says, hopefully).
>
> :: Best regards and enjoy linux!
>
> Thank you.  So far I'm enjoying Linux tremendously.  It's really
> challenging, but fun and intellectually stimulating.  I only wish I'd
> started years ago.
>
>
> Jonathan M. Hollin - WYPUG Co-ordinator
> West Yorkshire Perl User Group
> http://wypug.pm.org/
>
>
>
---

PGP / GPG Key:  http://www.ncpro.com/GPG/mmweber-at-ncpro-com.asc




Re: Installing Perl::Magick

2002-02-19 Thread Marcel Weber

Hi

I don't know anything about your problem. I just wanted to give you a 
hint, as you said, that you were a complete linux newbie:

Do not work as root. It is dangerous! The root account should be for 
installation, configuration of the system and where it cannot be 
avoided. I always have some regular user account for working on my 
servers and as soon that I want to change something I do a "su". The 
best is even to disable root logins on the console and especially via 
ssh / telnet. It gives you some extra security as everyone knows, that 
there must be a root account on a unix box.

Best regards and enjoy linux!

Marcel



Am Dienstag den, 19. Februar 2002, um 13:03, schrieb lamp:

> I'm not quite ready to give up on this yet.  Below is a screen grab of 
> my
> attempt(s) to install Perl::Magick.  As I have said previously, I am a
> complete Linux newbie - so what's happening here is lost on me (as yet).
>
> Image::Magick is installed.  What am I doing wrong?
>
---

PGP / GPG Key:  http://www.ncpro.com/GPG/mmweber-at-ncpro-com.asc




Re: Multiple authentication methods

2002-02-14 Thread Marcel Weber

Hi Darren

Would you submit the current version? If you need help with the 
Documentation just let me know. For the makefile, I do not have any 
experience.

Marcel

Am Mittwoch den, 13. Februar 2002, um 21:01, schrieb darren chamberlain:

> Quoting Marcel Weber <[EMAIL PROTECTED]> [13 Feb-02 14:53]:
>> Why not submitting this somewhere? I think this could be
>> usefull for quite a lot of people. I think this is cool, as you
>> do not have to worry wether the module returns DECLINED or
>> AUTH_REQUIRED.
>
> I can package this up and put it on CPAN as version 0.01 tomorrow
> morning, if that seems reasonable to everyone involved.  I'll
> need to add some docs and a Makefile.PL, of course.
>
> (darren)
>
> --
> To believe is very dull. To doubt is intensely engrossing. To be on
> alert is to live, to be lulled into security is to die.
> -- Oscar Wilde
>
>
---

PGP / GPG Key:  http://www.ncpro.com/GPG/mmweber-at-ncpro-com.asc




Re: Multiple authentication methods

2002-02-13 Thread Marcel Weber

I see. You're right, this is actually much nicer!

Sorry for the misinformation. On debian it return : also. I made a 
mistake checking it.

But with the suggested code by Per it works just fine:

sub load {
 my $module=@_[0];
 $module = File::Spec->catfile(split /::/, $module);
 $module .= '.pm';

 eval { require $module; };

 return $@ ? 1 : 0;
}

Of course one has to put a use File::Spec at the beginning and a Per 
Finar Ellefsen

Marcel



Am Donnerstag den, 14. Februar 2002, um 00:11, schrieb Stathy G. 
Touloumis:

> Interesting, one system is RedHat 7.2 and Suse 7.3 (custom built perl) 
> that
> returns
> a  ':' for $Config{'path_sep'}
>
>> It returns a arrayref, as far as I experienced. Well I'm really new to
>> mod_perl
>> and my eagle book waits still in  the library to be bought... But why 
>> is
>> this
>> version not nice?
>
> It's fine but I have become much more impressed with the mod_perl
> configuration features.  It provides a much cleaner interface for 
> specifying
> directives.
>
> THIS :
>
> 
> AuthName Test
> AuthType Basic
># These are AuthenSmb specific
> PerlSetVar myPDC SAMBA
> PerlSetVar myDOMAIN ARBEITSGRUPPE
>   # With PerlAddVar you pass an array
> PerlAddVar AuthModules Apache::AuthSybase
> PerlAddVar AuthModules Apache::AuthenSmb
> PerlAuthenHandler Apache::AuthMulti
> require valid-user
> 
>
> VS :
>
> 
> AuthName Test
> AuthType Basic
> # Now an actual apache conf
> myPDC SAMBA
> myDOMAIN ARBEITSGRUPPE
> # No need to specify twice
> AuthModules Apache::AuthSybase Apache::AuthenSmb
>
> PerlAuthenHandler Apache::AuthMulti
> require valid-user
> 
>
> Of course there will be some minor changes in the module
> and in the Makefile.PL
>
>
>
>
---

PGP / GPG Key:  http://www.ncpro.com/GPG/mmweber-at-ncpro-com.asc




Re: Multiple authentication methods

2002-02-13 Thread Marcel Weber

Sorry, this code does not work... Should test it better before sending 
it to to mailing list...

Marcel

Am Donnerstag den, 14. Februar 2002, um 00:05, schrieb Marcel Weber:

> So here comes the most actual code:
>
> Submitting it to CPAN would be fine!
>
> 
>
> package Apache::AuthMulti;
>
> # Stathy G. Touloumis
> # Marcel M. Weber
> # Darren Chamberlain
> #
> # Version 0.01-2 / 13.02.2002 / Marcel M. Weber
>
> use strict;
> use Apache::Constants qw(:common);
>
> sub handler {
> my $r = shift;
> my($res, $sent_pw) = $r->get_basic_auth_pw;
> return $res if $res != OK;
>
> my @auth_modules=$r->dir_config->get("AuthModules");
>
> for my $am (@auth_modules)
> {
> load($am);
> if ($@){
> $r->log_reason("Error loading module '$am':$@");
> next;
> }
>
> my $handler = $am->can('handler') or next;
> if ($handler->($r) == OK) {
> $r->warn("$am return OK");
> return OK;
> }
>
> $r->log_reason("$am not OK");
> }
>
> $r->note_basic_auth_failure;
> $r->log_reason("none of the handlers could authenticate this 
> user");
> return AUTH_REQUIRED;
> }
>
> sub load {
> my $module=@_[0];
> $module  =~ s[::][$Config{'path_sep'}]go;
> $module .= '.pm';
>
> eval { require $module; };
>
> return $@ ? 1 : 0;
> }
>
> 1;
> __END__
>
> -
>
> Am Mittwoch den, 13. Februar 2002, um 21:42, schrieb Stathy G. 
> Touloumis:
>
>>
>>
>>>> I would suggest changing the PerlSetVar variables
>>>> to actual apache configuration directives which would change this :
>>>>
>>>> my @auth_modules=$r->dir_config->get("AuthModules");
>>>>
>>>> I don't have an immediate patch for this but have done it before.
>>>> If you would like me to work on this code no prob, otherwise check
>>>> the eagle book for some samples if unfamiliar.
>>>
>>> *nod*  I'm not sure that the syntax would work; $r->dir_config()
>>> would probably return an arrayref, and such; this needs to be
>>> tested.
>>
>
> It returns a arrayref, as far as I experienced. Well I'm really new to 
> mod_perl
> and my eagle book waits still in  the library to be bought... But why 
> is this
> version not nice?
>
> ---
>
> Marcel
>
> PGP / GPG Key:http://www.ncpro.com/GPG/mmweber-at-ncpro-com.asc
>
>
>
---

PGP / GPG Key:  http://www.ncpro.com/GPG/mmweber-at-ncpro-com.asc




Re: Multiple authentication methods

2002-02-13 Thread Marcel Weber

On my woody system it's fine.

Marcel

Am Mittwoch den, 13. Februar 2002, um 23:51, schrieb Stathy G. Touloumis:

>> The easiest thing would be to use Config, and do:
>>
>>   $module =~ s[::][$Config{'path_sep'}]g;
>>
>> Right?
>
> Maybe not : )  When checking on 2 linux systems I got a path seperator 
> of
> ':'.  Can you let me know if you get similar results?
>
> Thanks,
>
>
>
>
>
>
---

PGP / GPG Key:  http://www.ncpro.com/GPG/mmweber-at-ncpro-com.asc




Re: Multiple authentication methods

2002-02-13 Thread Marcel Weber

So here comes the most actual code:

Submitting it to CPAN would be fine!



package Apache::AuthMulti;

# Stathy G. Touloumis
# Marcel M. Weber
# Darren Chamberlain
#
# Version 0.01-2 / 13.02.2002 / Marcel M. Weber

use strict;
use Apache::Constants qw(:common);

sub handler {
 my $r = shift;
 my($res, $sent_pw) = $r->get_basic_auth_pw;
 return $res if $res != OK;

 my @auth_modules=$r->dir_config->get("AuthModules");

 for my $am (@auth_modules)
 {
 load($am);
 if ($@){
 $r->log_reason("Error loading module '$am':$@");
 next;
 }

 my $handler = $am->can('handler') or next;
 if ($handler->($r) == OK) {
 $r->warn("$am return OK");
 return OK;
 }

 $r->log_reason("$am not OK");
 }

 $r->note_basic_auth_failure;
 $r->log_reason("none of the handlers could authenticate this 
user");
 return AUTH_REQUIRED;
}

sub load {
 my $module=@_[0];
 $module  =~ s[::][$Config{'path_sep'}]go;
 $module .= '.pm';

 eval { require $module; };

 return $@ ? 1 : 0;
}

1;
__END__

-

Am Mittwoch den, 13. Februar 2002, um 21:42, schrieb Stathy G. Touloumis:

>
>
>>> I would suggest changing the PerlSetVar variables
>>> to actual apache configuration directives which would change this :
>>>
>>> my @auth_modules=$r->dir_config->get("AuthModules");
>>>
>>> I don't have an immediate patch for this but have done it before.
>>> If you would like me to work on this code no prob, otherwise check
>>> the eagle book for some samples if unfamiliar.
>>
>> *nod*  I'm not sure that the syntax would work; $r->dir_config()
>> would probably return an arrayref, and such; this needs to be
>> tested.
>

It returns a arrayref, as far as I experienced. Well I'm really new to 
mod_perl
and my eagle book waits still in  the library to be bought... But why is 
this
version not nice?

---

Marcel

PGP / GPG Key:  http://www.ncpro.com/GPG/mmweber-at-ncpro-com.asc




Re: Multiple authentication methods

2002-02-13 Thread Marcel Weber

Fixed some errors. Here comes the working version:


-

package Apache::AuthMulti;

# Stathy G. Touloumis
# Marcel M. Weber
# Darren Chamberlain
#
# Version 0.1.0 / 2002.02.13 / Marcel M. Weber

use strict;
use Apache::Constants qw(:common);

sub handler {
 my $r = shift;
 my($res, $sent_pw) = $r->get_basic_auth_pw;
 return $res if $res != OK;

 my @auth_modules=$r->dir_config->get("AuthModules");

 for my $am (@auth_modules)
 {
 load($am);
 if ($@){
 $r->log_reason("Error loading module '$am':$@");
 next;
 }

 my $handler = \&{"$am\::handler"};
 if ($handler->($r) == OK) {
 $r->warn("$am return OK");
 return OK;
 }

 $r->log_reason("$am not OK");
 }

 $r->note_basic_auth_failure;
 $r->log_reason("none of the handlers could authenticate this 
user");
 return AUTH_REQUIRED;
}

sub load {
 my $module=@_[0];
 $module  =~ s[::][/]g;
 $module .= '.pm';

 eval { require $module; };

 return $@ ? 1 : 0;
}

1;
__END__


---

In the httpd.conf you have to put something like this:


AuthName Test
AuthType Basic
   # These are AuthenSmb specific
PerlSetVar myPDC SAMBA
PerlSetVar myDOMAIN ARBEITSGRUPPE
  # With PerlAddVar you pass an array
PerlAddVar AuthModules Apache::AuthSybase
PerlAddVar AuthModules Apache::AuthenSmb
PerlAuthenHandler Apache::AuthMulti
require valid-user


---

Works perfect...

Why not submitting this somewhere? I think this could be usefull for 
quite a lot of people. I think this is cool, as you do not have to worry 
wether the module returns DECLINED or AUTH_REQUIRED.

Marcel


Am Mittwoch den, 13. Februar 2002, um 15:02, schrieb darren chamberlain:

> Quoting Marcel Weber <[EMAIL PROTECTED]> [12 Feb-02 16:15]:
>> I don't get the point why it did not work the other way round,
>> but now everything is just fine now :
>
> Make it a little more generic:
>
> package Apache::MultiAuthen;
>
> use strict;
> use Apache::Constants qw(:common);
>
> sub handler {
> my $r = shift;
> my($res, $sent_pw) = $r->get_basic_auth_pw;
> return $res if $res != OK;
>
> # Tweak this; unsure about dir_config returning an array
> my @auth_modules = $r->dir_config("AuthModules");
>
> for my $am (@auth_modules) {
> load($am);
>
> if ($@) {
> $r->log("Error loading module '$am': $@");
> next;
> }
>
> my $handler = \&{"$am\::handler"};
> if ($handler->($r) == OK) {
> $r->log_reason("$am return OK");
> return OK
> }
>
> $r->log_reason("$am not OK");
> }
>
> $r->note_basic_auth_failure;
> return AUTH_REQUIRED;
> }
>
> sub load {
> my $module = @_;
> $module  =~ s[::][/]g;
> $module .= '.pm';
>
> eval { require $module; };
>
> return $@ ? 1 : 0;
> }
>
> 1;
>
> __END__
>
> (darren)
>
> --
> Never attribute to malice that which is adequately explained by
> incompetence.
> -- Napolean Bonaparte
>
>
---

PGP / GPG Key:  http://www.ncpro.com/GPG/mmweber-at-ncpro-com.asc




AW: Multiple authentication methods

2002-02-12 Thread Marcel Weber

It works

I don't get the point why it did not work the other way round, but now
everything is just fine now :

package Apache::AuthenIntra;

#use strict;
use Apache::AuthenSmb;
use Apache::AuthSybase;
use Apache::Constants;

sub handler {
my $r = shift;
my($res, $sent_pw) = $r->get_basic_auth_pw;
return $res if $res != OK;

if (  Apache::AuthenSmb::handler($r) == OK ) {
$r->log_reason("AuthenSmb is okay", $r->uri);
return OK;
} elsif ( Apache::AuthSybase::handler($r) == OK ) {
$r->log_reason("AuthSybase is okay", $r->uri);
return OK;
}
$r->note_basic_auth_failure;
return AUTH_REQUIRED;
}
1;
__END__


Like this, you may take every authentication module you'd like, wether it
returns DECLINE or AUTH_REQUIRED and it will give an OK if one of the two
works.

Thanks to all who helped me

Marcel



-Ursprüngliche Nachricht-
Von: Stathy G. Touloumis [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 12. Februar 2002 21:17
An: Marcel Weber; [EMAIL PROTECTED]
Betreff: RE: Multiple authentication methods


That is odd, I would check the interface for the authentication modules and
be sure that they are being used properly.  It may help to also put in some
debug/trace statements to figure out where things are failing or not working
as expected : )

> This way, I do not get any failure messages, but the
> authenication does not
> work at all. Say, it does not matter wat password your typing in, you get
> always authenticated. Even when one auf the handlers logs a violation and
> return AUTH_REQUIRED / DECLINED.
>
> package Apache::AuthenIntra;
>
> use strict;
> use Apache::AuthenSmb;
> use Apache::AuthSybase;
> use Apache::Constants;
>
> sub handler {
> my $r = shift;
> my($res, $sent_pw) = $r->get_basic_auth_pw;
> return $res if $res != OK;
>
> if (  Apache::AuthenSmb::handler($r) == Apache::Constants::OK ) {
> return Apache::Constants::OK;
> } elsif ( Apache::AuthSybase::handler($r) ==
> Apache::Constants::OK )
> {
> return Apache::Constants::OK;
> }
> $r->note_basic_auth_failure;
> return Apache::Constant::AUTH_REQUIRED;
> }
>
> Marcel
>
>
> -Ursprüngliche Nachricht-
> Von: Stathy G. Touloumis [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 12. Februar 2002 18:32
> An: Marcel Weber; [EMAIL PROTECTED]
> Betreff: RE: Multiple authentication methods
>
>
> > The get_handlers code is out of AuthenSmb as I do not have the slightest
> > idea of how to get the results of the called function.
> Hmmm, It would seem that it would be better to call the function directly
> from your handler.  I am not sure how the AuthenSmb handlers should be
> called but you should get the idea.
>
> sub handler {
>   my $r = shift;
>   my($res, $sent_pw) = $r->get_basic_auth_pw;
>   return $res if $res != OK;
>
>   if ( Apache::AuthSybase->handler($r) == Apache::Constants::OK ) {
> return Apache::Constants::OK;
>
>   } elsif ( Apache::AuthenSmb->handler($r) == Apache::Constants::OK ) {
> return Apache::Constants::OK;
>
>   } else {
> return Apache::Constant::DECLINED;
>
>   }
>
>
> }
>
> > I get just as far, as I can authenticate via AuthSybase, but the second
> > method is never executed. Well, probably some expirienced perl
> coder would
> > laugh at me...
>
> He he, we all had to start from the beginning ; )
>
>
> > Hmm, I fiddled a bit around whith this code but, it does not
> > really work the
> > way I want it to.
> >
> > This is what I coded:
> >
> > sub handler {
> > my $r = shift;
> > my($res, $sent_pw) = $r->get_basic_auth_pw;
> > return $res if $res != OK;
> >
> > $r->push_handlers( PerlAuthenHandler=> Apache::AuthSybase );
> > if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> > return OK;
> > }
> > $r->push_handlers( PerlAuthenHandler=> Apache::AuthenSmb );
> > if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> > return OK;
> > }
> > return DECLINED;
> > }
> >
> > The get_handlers code is out of AuthenSmb as I do not have the slightest
> > idea of how to get the results of the called function.
> >
> > What the code should do is: Call AuthSybase, check return value, if OK
> > return OK, else call AuthenSMB, return return value.
> >
>
>





AW: Multiple authentication methods

2002-02-12 Thread Marcel Weber

Hi

This way, I do not get any failure messages, but the authenication does not
work at all. Say, it does not matter wat password your typing in, you get
always authenticated. Even when one auf the handlers logs a violation and
return AUTH_REQUIRED / DECLINED.

package Apache::AuthenIntra;

use strict;
use Apache::AuthenSmb;
use Apache::AuthSybase;
use Apache::Constants;

sub handler {
my $r = shift;
my($res, $sent_pw) = $r->get_basic_auth_pw;
return $res if $res != OK;

if (  Apache::AuthenSmb::handler($r) == Apache::Constants::OK ) {
return Apache::Constants::OK;
} elsif ( Apache::AuthSybase::handler($r) == Apache::Constants::OK )
{
return Apache::Constants::OK;
}
$r->note_basic_auth_failure;
return Apache::Constant::AUTH_REQUIRED;
}

Marcel


-Ursprüngliche Nachricht-
Von: Stathy G. Touloumis [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 12. Februar 2002 18:32
An: Marcel Weber; [EMAIL PROTECTED]
Betreff: RE: Multiple authentication methods


> The get_handlers code is out of AuthenSmb as I do not have the slightest
> idea of how to get the results of the called function.
Hmmm, It would seem that it would be better to call the function directly
from your handler.  I am not sure how the AuthenSmb handlers should be
called but you should get the idea.

sub handler {
  my $r = shift;
  my($res, $sent_pw) = $r->get_basic_auth_pw;
  return $res if $res != OK;

  if ( Apache::AuthSybase->handler($r) == Apache::Constants::OK ) {
return Apache::Constants::OK;

  } elsif ( Apache::AuthenSmb->handler($r) == Apache::Constants::OK ) {
return Apache::Constants::OK;

  } else {
return Apache::Constant::DECLINED;

  }


}

> I get just as far, as I can authenticate via AuthSybase, but the second
> method is never executed. Well, probably some expirienced perl coder would
> laugh at me...

He he, we all had to start from the beginning ; )


> Hmm, I fiddled a bit around whith this code but, it does not
> really work the
> way I want it to.
>
> This is what I coded:
>
> sub handler {
> my $r = shift;
> my($res, $sent_pw) = $r->get_basic_auth_pw;
> return $res if $res != OK;
>
> $r->push_handlers( PerlAuthenHandler=> Apache::AuthSybase );
> if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> return OK;
> }
> $r->push_handlers( PerlAuthenHandler=> Apache::AuthenSmb );
> if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> return OK;
> }
> return DECLINED;
> }
>
> The get_handlers code is out of AuthenSmb as I do not have the slightest
> idea of how to get the results of the called function.
>
> What the code should do is: Call AuthSybase, check return value, if OK
> return OK, else call AuthenSMB, return return value.
>





AW: Multiple authentication methods

2002-02-12 Thread Marcel Weber

Thank you!

I also tried something like this at first. But I get this error message in
my apache/error.log


[Tue Feb 12 20:20:59 2002] [error] Can't locate object method "handler" via
package "Apache::AuthenS
mb" (perhaps you forgot to load "Apache::AuthenSmb"?) at
/usr/share/perl5/Apache/AuthenIntra.pm line
 13.


resp. vice versa, when the AuthSybase method is first. Perhaps it is my
mod_perl installation. It is a stock Debian Woody installation.

Marcel


-Ursprüngliche Nachricht-
Von: Stathy G. Touloumis [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 12. Februar 2002 18:32
An: Marcel Weber; [EMAIL PROTECTED]
Betreff: RE: Multiple authentication methods


> The get_handlers code is out of AuthenSmb as I do not have the slightest
> idea of how to get the results of the called function.
Hmmm, It would seem that it would be better to call the function directly
from your handler.  I am not sure how the AuthenSmb handlers should be
called but you should get the idea.

sub handler {
  my $r = shift;
  my($res, $sent_pw) = $r->get_basic_auth_pw;
  return $res if $res != OK;

  if ( Apache::AuthSybase->handler($r) == Apache::Constants::OK ) {
return Apache::Constants::OK;

  } elsif ( Apache::AuthenSmb->handler($r) == Apache::Constants::OK ) {
return Apache::Constants::OK;

  } else {
return Apache::Constant::DECLINED;

  }


}

> I get just as far, as I can authenticate via AuthSybase, but the second
> method is never executed. Well, probably some expirienced perl coder would
> laugh at me...

He he, we all had to start from the beginning ; )


> Hmm, I fiddled a bit around whith this code but, it does not
> really work the
> way I want it to.
>
> This is what I coded:
>
> sub handler {
> my $r = shift;
> my($res, $sent_pw) = $r->get_basic_auth_pw;
> return $res if $res != OK;
>
> $r->push_handlers( PerlAuthenHandler=> Apache::AuthSybase );
> if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> return OK;
> }
> $r->push_handlers( PerlAuthenHandler=> Apache::AuthenSmb );
> if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
> return OK;
> }
> return DECLINED;
> }
>
> The get_handlers code is out of AuthenSmb as I do not have the slightest
> idea of how to get the results of the called function.
>
> What the code should do is: Call AuthSybase, check return value, if OK
> return OK, else call AuthenSMB, return return value.
>





AW: Multiple authentication methods

2002-02-11 Thread Marcel Weber

Hmm, I fiddled a bit around whith this code but, it does not really work the
way I want it to.

This is what I coded:

sub handler {
my $r = shift;
my($res, $sent_pw) = $r->get_basic_auth_pw;
return $res if $res != OK;

$r->push_handlers( PerlAuthenHandler=> Apache::AuthSybase );
if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
return OK;
}
$r->push_handlers( PerlAuthenHandler=> Apache::AuthenSmb );
if (@{ $r->get_handlers("PerlAuthenHandler") || []}) {
return OK;
}
return DECLINED;
}

The get_handlers code is out of AuthenSmb as I do not have the slightest
idea of how to get the results of the called function.

What the code should do is: Call AuthSybase, check return value, if OK
return OK, else call AuthenSMB, return return value.

I get just as far, as I can authenticate via AuthSybase, but the second
method is never executed. Well, probably some expirienced perl coder would
laugh at me...

Marcel


-Ursprüngliche Nachricht-
Von: Stathy G. Touloumis [mailto:[EMAIL PROTECTED]]
Gesendet: Montag, 11. Februar 2002 23:34
An: Marcel Weber
Cc: [EMAIL PROTECTED]
Betreff: RE: Multiple authentication methods


sub handler {
my $r = shift;

if ( $smbauthwhatever ) {
$r->push_handlers( PerlAuthenHandler=> Apache::AuthenSmb::handler );
} else {
$r->push_handlers( PerlAuthenHandler=> Apache::Foo::handler );
}
}


> I already thought of this.  But how can I call the first and second
> handler from within this "super"-handler?
>
> I'll do something like this:
>
> use Apache::AuthenSmb;
> use Apache::AuthSybase;
>
> sub handler {
>   if (smbauthwhatever)
> 
>   sybaseauthwhatever
> .
>
> }
>
> So how can I call the handler function of AuthenSmb?
>