Josef Chladek wrote:
> i habe a strange error whenever i log in: my authenticate looks like this
>
> sub authenticate {
> my ($self, $r) = @_;
> return OK if $r->action ne "edit";
> $r->get_user;
> return OK if $r->user;
>
> $r->template("login");
> return OK;
> }
[[ This paragraph is an aside. Your authenticate() looks a little weird,
though I don't think it is the source of your problem. For example, you
allow people to create new records without logging in, but not to edit
them afterwards? Seems odd, but maybe that's what you want ]]
> so if i click on edit for the first time, i get a login screen, i login
> and am able to edit, if i try to edit another page, i get the error:
>
> caught authenticate error: Couldn't load user class BeerDB::Users at
> /usr/local/share/perl/5.8.4/Maypole/Plugin/Authentication/
> UserSessionCookie.pm line 170, <GEN0> line 3.
>
> line 170 is:
>
> $user_class->require || die "Couldn't load user class $user_class";
>
> if i comment that line, everything works fine and as excpected. is that
> ok to do so or will this break other things?
That error is what I'd expect if your BeerDB::Users class is NOT in a
separate some/path/BeerDB/Users.pm file. That is, I believe you will
get that error if the code for your class is either automatically
generated in the normal way by Maypole (with the help of
Class::DBI::Loader) or is in some other file that contains a
package BeerDB::Users;
statement.
It's a problem I've been trying to get fixed for a while. Just delete
the line; that's what I do.
IMHO, Maypole needs a more intelligent model-loading scheme.
Maypole::Plugin::Loader may be part of the solution. Plus a more
intelligent model-plugin loading scheme (e.g. to allow use of a
different form validation implementation). I may have some suggestions
in a few days.
Cheers, Dave
-- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.7.3 - Release Date: 24/01/05_______________________________________________ maypole mailing list maypole at lists.netthink.co.uk http://lists.netthink.co.uk/listinfo/maypole
This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT