[cgiapp] cgiapp Digest, Vol 33, Issue 16

Jerry Kaidor jerry at tr2.com
Wed Jun 23 20:59:31 EDT 2010


> Jerry,
>
> Just focusing on this for a moment:
>
> "Error executing class callback in prerun stage: must call dbh_config()
> before calling dbh().
>
> What this seems to mean is that $options{DBH} is undefined."
>
>
> I assume you have had CGI::Application working with the standard DBH
> authentication driver.

*** You know, I don't remember if I tried that at all.  Right now, I'm not
aiming at getting the whole thing working, just to get it past this
particular error.  Basically, changes that my driver makes to the options
array ( which it must do, for the system to work without changing your
driver ) seem to be magically discarded when my driver calls your driver.

   The crux of the matter would be - does a Perl method get a private copy
of $self->whatever?  If so, can this behavior be changed or defeated?

   There is another feature that my homegrown session support has: session
timeout is dependant on the network of the user.  On the localnet,
timeouts are very long - on the order of weeks.  Out on the big wild
Internet,however, they are like a bank's - 15 minutes.

   If I get tired of fighting with it, I'll take you up on your kind offer.
But for now, I am learning useful things about perl data structures.

                            - Jerry Kaidor







 I am sure you have given previous conversations. If
> you have actually got DBH set up correctly then may be you could send me
> your code tarred up.
>
>
>> Message: 2
>> Date: Wed, 23 Jun 2010 08:31:59 -0700 (PDT)
>> From: "Jerry Kaidor" <jerry at tr2.com>
>> Subject: [cgiapp] CAP::Authentication Multi-Driver
>> To: "CGI Application" <cgiapp at lists.openlib.org>
>> Message-ID:
>> 	<61b4098ad54fc6d09e64363df827b6a4.squirrel at www.jm-properties.com>
>> Content-Type: text/plain;charset=iso-8859-1
>>
>> Hello,
>>
>>    Continuing to try to get my multiple DBI's driver working.   As you
>> may
>> remember, I needed my application to know which database my user
>> authenticated against.
>>
>>    With Nicholas Bamber's advice, I was off to a good start.  I created
>> a
>> driver ( MULTI_DBI.pm ) which subclasses the DBI driver using "use
>> base".
>>
>>    My driver iterates through a hash of labels and dhb's, sending each
>> dbh
>> to the DBI driver.
>>
>>    Right now, after calling __SUPER__::verify_credentials with
>>
>>    $super_output = $self->SUPER::verify_credentials( $self, @creds );
>>
>> I get the following error:
>>
>> Error executing class callback in prerun stage: must call dbh_config()
>> before calling dbh().
>>
>> What this seems to mean is that $options{DBH} is undefined.
>>
>> Using Data::Dumper -
>> before calling the superclass:
>>
>>   dumper says $VAR1 = 'DBH';
>>               $VAR2 = bless( {}, 'DBI::db' );
>>               $VAR3 = 'DBHS';
>>               $VAR4 = {'ST' => $VAR2,'IP' => bless({},'DBI::db'
>> ),'GLOBAL'
>> => bless( {}, 'DBI::db' ),'QR' => bless( {}, 'DBI::db' )};
>>               $VAR5 = 'TABLE';
>>               $VAR6 = 'users';
>>
>> ...The important part is $VAR1 and $VAR2, which together are a hash
>> element
>> defining "DBH" as some meaningful number ( that I got from the DBI
>> library
>> when opening the database ).  My MULTI_DBI driver added the DBH hash
>> member
>> so that the DBI driver would recognize it and verify against that
>> database.
>>
>> HOWEVER, after calling the superclass I get:
>>
>> dumper says   $VAR1 = 'DBHS';
>>               $VAR2 = { 'ST' => bless( {}, 'DBI::db' ), 'IP' => bless(
>> {},
>> 'DBI::db' ),'GLOBAL' => bless( {}, 'DBI::db' ),'QR' =>
>> bless( {}, 'DBI::db' )};
>>               $VAR3 = 'TABLE';
>>               $VAR4 = 'users';
>>
>> ...Note that there are only 4 VARs.  And there is no DBH hash.
>> Apparently,
>> Perl has kindly removed any changes that I made to the options
>> hash/array.
>>
>>   One thought I had was that $self had somehow changed.  But no:
>> (top of MULTI_DBI::verify_credentials )
>> CGI::Application::Plugin::Authentication::Driver::MULTI_DBI=HASH(0x89be0a8)
>>
>> (top of DBI::verify_credentials
>> CGI::Application::Plugin::Authentication::Driver::MULTI_DBI=HASH(0x89be0a8)
>> ....looks like the same number to me....
>>
>>
>>    Anybody know the magic to get new stuff to stick in $self->options?
>> (Mostly fighting my own ignorance here, I know )
>> Thanks in advance,
>>
>>                             - Jerry
>>
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>




More information about the cgiapp mailing list