On Sun, Jan 23, 2011 at 20:57, Leslie P. Polzer <[email protected]> wrote:
> Here's a runnable example that will hopefully help you more:
>
> http://paste.lisp.org/display/118899#2
>
> It doesn't use the proper login widget but should show quite clearly
> what needs to be done.
>
> I can modify it so that it will use your login stuff, but perhaps you
> want to try first.

Well, I feel like an monkey typing stuff which I don't quite
understand. :-)  Like I have said, my understanding of what is
actually happening within weblocks widgets is actually quite limited.
I'm still waiting for that "a-ha!" moment that people are talking
about when they are talking about common lisp. :-)

Ok, I think I understand that in :user-fn you define ... a key value?
That will identify this session?

In the :login-widget-generator I have assumed that you are passing
something that is happening to the newly created widget, and when the
link is selected, the key value that identifies the session is set
with an value. And then your widget decides that it can now show the
menu because the user has been authenticated. I have tried to make
something of that, as you can see in the
http://paste.lisp.org/display/118899#3 but I'm getting an
"UNDEFINED-FUNCTION: The function VTS::LOGIN-MAYBE is undefined.". So,
in my case, regardless that I'm creating an nice login widget, it is
not accepted as such. I have also tried another version with

 ,(f-underscore:f0
   (f-underscore:f_%

and I'm getting the same error.

Should I pass there just an function that authenticates user and not
an widget? But what about login widget? Or is that actually solved
within the definition of the protected-widget? Should I put instead
something like this:

(defwidget protected-navigation (lazy-navigation)
  ((user-fn :type (or symbol function)
            :accessor user-fn
            :initarg :user-fn
            :initform #'authenticatedp)
   (login-widget :type (or widget null)
                 :accessor login-widget
                 :initform nil)
   (login-widget-generator :type (or symbol function)
                           :accessor login-widget-generator
                           :initarg :login-widget-generator
                           :initform (f0 (make-instance 'login
                                                        :view 'login-form-view
                                                        :on-login 
'authenticate-user
                                                        :on-success 
(f-underscore:f_%
                                                                 (setf 
(webapp-session-value 'session-user) *active-user*))))))

-- 
You received this message because you are subscribed to the Google Groups 
"weblocks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/weblocks?hl=en.

Reply via email to