;; -*- lisp -*- (in-package :it.bese.ucw) ;;;; ** Login Component (defclass login () ((username :accessor login.username :initform nil) (password :accessor login.password :initform nil) (message :accessor login.message :initform nil :initarg :message :documentation "A message which will be presented to the user before the login box.")) (:documentation "Generic login (input username and password) component. This component, which must be embedded in another component, presents the user with a simple two fielded login form. When the user attempts a login the action try-login is called, try-login calls the generic function check-credentials passing it the login component. If check-credentials returns true then the login-successful action is called, otherwise the message slot of the login component is set (to a generic \"bad username\" message). The default implementaion of login-successful simply answers t, no default implementation of check-credentials is provided. Developers should use sub-classes of login for which all the required methods have been definined.") (:metaclass standard-component-class)) (defmethod render ((l login)) (<:div :id "ucw-login" (when (login.message l) (<:div :id "ucw-login-message" (<:as-html (login.message l)))) (