summaryrefslogtreecommitdiff
path: root/service/inetorg-delete.lisp
blob: d01db5db8ee106d85b90b390888bdaacab230437 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10 -*-
(declaim (optimize (speed 0) (safety 3) (debug 3)))

(in-package #:ldapadmin)

;; ========================================================================== ;;
;; inetorg-delete

(defclass inetorg-delete (auth-service)
  ((cn :initarg :cn
       :initform nil
       :accessor cn)
   (location-p :initarg :location-p
               :initform nil
               :accessor location-p))
  (:documentation ""))

(defun inetorg-delete-json (cn)
  (with-auth (instance inetorg-delete)
    (setf (cn instance) cn)))

;; ========================================================================== ;;
;; inetorg-delete-submit

(defclass inetorg-delete-submit (auth-service)
  ()
  (:documentation ""))

(defun inetorg-delete-submit-json (cn)
  (with-auth (instance inetorg-delete-submit)
    (with-ldap (ldap)
      (let ((ldap-user (get-ldap-user ldap cn)))
        (delete-ldap-user ldap-user ldap)
        (setf (message instance) "InetOrg entry deleted successfully.")))))