On 9/26/05, Kieren Diment <[EMAIL PROTECTED]> wrote: > Quick question about authentication. > > I have things set up so that users have to log in to be able to > access the site. > > However, I'd like users who are not logged in to be automatically > logged in as a user with the fullname "guest" (which happens to be id > no 3, but that's not very human readable). > > I've tried this: > > $r->user = $r->objects([CokeWorks::User->retrieve (fullname => > "guest")]) unless $r->user; > > but it fails with the error: "caught authenticate error: Can't > modify non-lvalue subroutine call "... > > How can I modify $r so that there's an automatically assigned user > class? >
'user' is a Class::Accessor accessor, which Maypole uses for a lot of things. Use it like this: # get my $user = $r->user; #set $r->user( $new_user ); The non-lvalue error means you're trying to assign a value to something that cannot be assigned to. d. ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Maypole-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/maypole-users
