On 6/9/06, Ron Savage <[EMAIL PROTECTED]> wrote:
Hi Cees

(1)
Here's how I'm calling CAP::Authentication in my cgiapp_init():

        $self -> authen() -> config
        (
                CREDENTIALS                     => [qw/username password/],
                DRIVER =>
                [
                        'DBI',
                        CONSTRAINTS     =>
                        {
                                'staff.username'                => 
'__CREDENTIAL_1__',
                                'sha1:staff.password'   => '__CREDENTIAL_2__',
                        },
                        DBH             => $self -> param('dbh'),
                        TABLE   => 'staff',
                ],
                POST_LOGIN_RUNMODE      => 'display',
                STORE                           => 'Session',
        );
        $self -> authen() -> protected_runmodes(':all');

Looks reasonable


(2)
When my app starts, I get this msg in Apache's error.log file:

[Fri Jun 09 15:07:07 2006] [error] [client 127.0.0.1] Color::Calc is required
when specifying a custom BASE_COLOUR, and leaving LIGHTER_COLOUR, LIGHT_COLOUR,
DARK_COLOUR or DARKER_COLOUR blank or when providing percentage based colour at
d:/Perl/site/lib/CGI/Application/Plugin/Authentication.pm line 1357., referer:
http://127.0.0.1/cgi-bin/menu.cgi

I'm not explicitly using color in any way, so I'm getting the warning /by
default/!

Bug.  Fixed in latest version

(3)
You module displays a nice log in form, which I fill in.
After I click your Sign in button, my app's first screen appears.
Then when I click a submit button, the app dies with:

[Fri Jun 09 15:08:18 2006] [error] [client 127.0.0.1] Error executing run mode
'authen_login': Undefined subroutine &CGI::start_html called at
d:/Perl/site/lib/CGI/Application/Plugin/Authentication.pm line 1641.\r, referer:
http://127.0.0.1/cgi-bin/aussi/aussi.cgi

Now lines 1641 to 1645 are:

        $html = join( "\n",
            CGI::start_html( -title => $login_options->{TITLE} || 'Sign In' ),
            $authen->login_box,
            CGI::end_html(),
        );

Another small bug.  I should have explicitly use'd CGI.pm.  I'll
refactor the dependancy on CGI.pm out at some point but for the next
version I will just add 'use CGI ();'  (patches welcome)

So there several problems here:
(a) Why is it calling this code? I ought to be logged in, but there's nothing in
the sessions table to indicate that I am

It should have caused a problem on the first load as well.  If you saw
the builtin login box, then it ran that bit of code, and hence CGI.pm
must have been loaded for that request.

(b) You don't do use or require CGI. Yes, I do have it installed :-).

fixed now.  see above comments.

(c) I don't /want/ to use CGI. I use CGI::Simple as in:

Which should be fine.

so methinks your CGI code should have tried something like $cgiapp -> query() ->
start_html().
That would not work with CGI::Simple, though :-).

right.  So for now I am explicitly loading CGI.pm, but will get rid of
it completely in the future as I was just too lazy to write out the
HTML myself (I only use CGI.pm for the start_html and end_html methods
which really is a waste if you don't normally use CGI.pm).

(4)
I certainly do have time available to help debug your module, but it's 3:30 pm
on a Friday here now...

And I am a little bit late answering...  But in a couple of months
I'll be in your timezone so I might be a little more timely in my
responses ;-)

The fixes are in SVN, but since they are fairly minor, I may hold off
on a new release for the time being.

http://cgiapp.crtconsulting.ca/svn/cgi/application/plugin/authentication/trunk/

Thanks for the bug reports, and let me know if you run into any other problems.

Cheers,

Cees

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

Reply via email to