diff options
| author | ckonstanski <ckonstanski@pippiandcarlos.com> | 2020-12-21 08:59:56 -0700 |
|---|---|---|
| committer | ckonstanski <ckonstanski@pippiandcarlos.com> | 2020-12-21 08:59:56 -0700 |
| commit | 0ed1cba1b39daaf8eef693233f081b455c88dece (patch) | |
| tree | 0322ba1444ef724d4613e3c26ed2679e71bf1882 /service/inetorg-modify-service.lisp | |
| parent | bac1df6134eee78b79810d13c71a2b22b4739a12 (diff) | |
stuff
Diffstat (limited to 'service/inetorg-modify-service.lisp')
| -rw-r--r-- | service/inetorg-modify-service.lisp | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/service/inetorg-modify-service.lisp b/service/inetorg-modify-service.lisp new file mode 100644 index 0000000..293c43b --- /dev/null +++ b/service/inetorg-modify-service.lisp @@ -0,0 +1,60 @@ +;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*- +(declaim (optimize (speed 0) (safety 3) (debug 3))) + +(in-package #:ldapadmin) + +(defclass inetorg-modify-service (auth-service) + ((form :initarg :form + :initform nil + :accessor form) + (title :initarg :title + :initform nil + :accessor title) + (location-p :initarg :location-p + :initform nil + :accessor location-p)) + (:documentation "")) + +(defmethod initialize-instance :after ((inetorg-modify-service inetorg-modify-service) &key) + (setf (form inetorg-modify-service) (make-form "inetorg-modify-form" + nil + t + '((:name "modify-givenname" :label "givenName" :field-type "text" :value ) + (:name "modify-sn" :label "sn" :field-type "text") + (:name "modify-mail" :label "mail" :field-type "text") + (:name "modify-postaladdress" :label "postalAddress" :field-type "text") + (:name "modify-postalcode" :label "postalCode" :field-type "text") + (:name "modify-st" :label "st" :field-type "text") + (:name "modify-l" :label "l" :field-type "text") + (:name "modify-telephonenumber" :label "telephoneNumber" :field-type "text") + (:name "modify-mobile" :label "mobile" :field-type "text") + (:name "modify-businesscategory" :label "businessCategory" :field-type "text") + (:label "Modify InetOrg Entry" :field-type "button"))) + +(defun inetorg-modify-json (cn) + (with-auth (instance inetorg-modify-service) + (with-ldap (ldap) + (setf (ldap-user-values instance) (get-ldap-user ldap cn))))) + +(defclass inetorg-modify-submit (auth-service) + ((location-p :initarg :location-p + :initform nil + :accessor location-p)) + (:documentation "")) + +(defun inetorg-modify-submit-json (givenname sn mail postaladdress postalcode st l telephonenumber mobile businesscategory) + (with-auth (instance inetorg-modify-submit) + (with-ldap (ldap) + (let ((ldap-user (make-instance 'ldap-user + :givenname givenname + :sn sn + :mail mail + :postaladdress postaladdress + :postalcode postalcode + :st st + :l l + :telephonenumber telephonenumber + :mobile mobile + :businesscategory businesscategory))) + (modify-ldap-user ldap-user ldap) + (setf (message instance) "InetOrg entry saved successfully."))))) |
