[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cgiapp] CGI::Application::Plugin::Authentication. How to log a user in after prerun?


On Tuesday 23 May 2006 00:50, Giannis Economou wrote:
> I'm doing the following now, have you tried it?
>
> Inside the runmode I want the login to happen:
>
> sub another_runmode {
>     ...
>     $self->query->param( -name => 'auth_usr_uname',  value => $uname);
>     $self->query->param( -name => 'auth_usr_passwd', value => $passwd);
>     $self->authen->initialize;
>     ...
> }
>

This is exactly what I'm doing. The problem is that 
CAP::Authentication::prerun_callback is called in the pre-run stage and that 
calls initialize. Subsequent calls to initialize have no effect - the code 
is:
sub initialize {
    my $self = shift;
    return 1 if $self->{initialized};

    $self->{initialized} = 1;
...etc...

prerun_callback seems to be executed irrespective of whether the run mode is 
protected.

Is there something I'm missing? I'm using version 0.10 although this aspect of 
the code hasn't changed since v0.09.

Currently I'm using the following hack to get around this:

		$this->authen->{initialized} = 0;
		$this->authen->initialize;

cheers Simon


-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Simon Rees  |  tech-lists @t zodiac2000 co uk  |
ORA-03113: end-of-file on communication channel
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.