Class Login

A widget that provides basic login
functionality. Based on a view to be rendered (or a default of email
and password), and an authentication function, provides the UI for
login, and stores login information the session on success.

Part of:

package weblocks, class widget

Direct Superclass

widgetBase class for all widget objects.

Slot

class-store
Store where user data is being kept.
Initargs::class-store; Reader:login-class-store.
continuation
Stores the continuation object for widgets that were invoked via one of the do-* functions ('do-page', etc.). When 'answer' is called on a widget, this value is used to resume the computation.
Accessors:widget-continuation.
data
A data object to hold the registration information. Must match the view if provied. If not provided, a CLOS object will be generated holding the values of the input fields in the view in the corresponding slots.
Initargs::data; Reader:login-data.
dom-class
The DOM class (CSS class) of an object. Set this to a string if you'd like to add an additional CSS class to the ones generated from the class hierarchy by default.
Initargs::dom-class; Accessors:dom-class.
dom-id
The DOM id of an object. Can be a symbol, a string or nil. When accessed through the 'dom-id' accessor, will always become a string. Use ensure-dom-id or widget-name (for widgets) to access its underlying implementation.
Initargs::dom-id.
on-cancel
A function that accepts one paramets: a registration widget. It is called when the registration was cancelled.
Initargs::on-cancel; Accessors:login-on-cancel.
on-login
A function that must accept two parameters (a login widget object, and a CLOS object that contains information obtained from the user), and return an authentication object if login is successful, or nil if login failed. If the function returns a non-nil value, it will be stored in the session under *authentication-key*. If the function returns nil, it may return a string as a second value that will be used as an error message. Otherwise, *default-login-failure-error* will be used. Note, the object passed to the specified function is generated from the view provided in the 'login-view' slot. By default, it has email and password slots. The password is hashed using md5 by the publically accessible hash-password function. This should not be considered particularily secure, as it is not salted. If real security is desired, override the login-view to provide your own password handling, probably by passing it unchanged to the on-login function for serious processing there.
Initargs::on-login; Accessors:login-on-login.
on-success
A function that accepts two paramets: a registration widget and a CLOS object that contains information obtained from the user. It is called when the registration was successful.
Initargs::on-success; Accessors:login-on-success.
propagate-dirty
A list of widget paths (see 'find-widget-by-path') or widgets each of which will be made dirty when this widget is made dirty via a POST request. This slot allows setting up dependencies between widgets that will make multiple widgets update automatically during AJAX requests.
Initargs::propagate-dirty; Accessors:widget-propagate-dirty.
quickform
A quickform widget used by the login to provide UI.
Initargs::quickform; Accessors:login-quickform.
renderedp
This slot holds a boolean flag indicating whether the widget has been rendered at least once. Because marking unrendered widgets as dirty may cause JS problems, 'mark-dirty' will use this flag to determine the status of a widget.
Accessors:widget-rendered-p.
view
A mixin view to be used to render the field.
Initargs::view; Accessors:mixin-view-field-view.
widget-prefix-fn
A function called prior to rendering the widget body. The function should expect the widget as well as any additional arguments passed to the widget.
Initargs::widget-prefix-fn; Accessors:widget-prefix-fn.
widget-suffix-fn
A function called after rendering the widget body. The function should expect the widget as well as any additional arguments passed to the widget.
Initargs::widget-suffix-fn; Accessors:widget-suffix-fn.

Direct Method

per-class-dependenciesReturn a list of dependencies for an object of a
particular class. For widgets, this method is ...
render-widget-bodyA generic function that renders a widget in its current state. In
order to actually render the wi...

Other Method

composite-widgets
dom-classesReturns a string that represents all applicable CSS
classes for an object (usually a widget). Nor...
dom-idProvides a consistent interface to identifying widgets
by their DOM id. Returns a string or nil i...
ensure-dom-idEnsure that the object has a 'dom-id' and return
it. 'dom-id' is lazily generated on first read...
find-widget-by-path*Returns a widget object located at 'path', where 'path' is a list
of widget names starting from r...
mark-dirtyDefault implementation adds a widget to a list of dirty
widgets. Normally used during an AJAX req...
setfdom-id
setfwidget-name
setfwidget-parent
widget-nameAn interface to the DOM id of a widget. Provides
access to the underlying implementation, can r...