[Initial authentication support clinton@unknownlamer.org**20080117032557 Enough to work for a few days until I can add a real user system ] { addfile ./src/authentication.lisp hunk ./src/authentication.lisp 1 +(in-package :com.tee-it-up-golf.auth) + +;;; Very simple hack authentication system until a real one can be +;;; written + +(defvar *user* "temp-admin") +(defvar *pass* "geK0onah") + +(defun find-user (name) + (if (string= name *user*) + *user*)) + +(defun check-password (name pass) + (and (find-user name) (string= pass *pass*))) hunk ./src/packages.lisp 48 +(defpackage :com.tee-it-up-golf.auth + (:use :common-lisp :elephant :com.tee-it-up-golf.db) + (:nicknames :golf-auth) + (:export)) + hunk ./src/packages.lisp 65 - :choose-show + :show-viewer + :standard-show-viewer + :full-show-viewer hunk ./src/web-common.lisp 6 + secure-application-mixin hunk ./src/web-common.lisp 8 - ()) + () + (:default-initargs :insecure-components '(error-message golf-frontend-window))) + +(defmethod application-find-user ((app golf-application) username) + (golf-auth::find-user username)) + +(defmethod application-check-password ((app golf-application) user pass) + (golf-auth::check-password user pass)) + +(defmethod application-authorize-call ((app golf-application) user + from to) + (if (typep (context.window-component *context*) 'golf-frontend-window) + t + (call-next-method))) }