MCPcopy Create free account
hub / github.com/Macmod/godap / openDeleteObjectForm

Function openDeleteObjectForm

tui/explorer.go:138–162  ·  view source on GitHub ↗
(node *tview.TreeNode, done func())

Source from the content-addressed store, hash-verified

136}
137
138func openDeleteObjectForm(node *tview.TreeNode, done func()) {
139 currentFocus := app.GetFocus()
140 baseDN := node.GetReference().(string)
141 promptModal := tview.NewModal().
142 SetText("Do you really want to delete this object?\n" + baseDN).
143 AddButtons([]string{"No", "Yes"}).
144 SetDoneFunc(func(buttonIndex int, buttonLabel string) {
145 if buttonLabel == "Yes" {
146 err := lc.DeleteObject(baseDN)
147 if err != nil {
148 handleLDAPError(err)
149 } else {
150 if done != nil {
151 done()
152 }
153
154 updateLog("Object deleted: "+baseDN, "green")
155 }
156 }
157
158 app.SetRoot(appPanel, true).SetFocus(currentFocus)
159 })
160
161 app.SetRoot(promptModal, false).SetFocus(promptModal)
162}
163
164func openUpdateUacForm(node *tview.TreeNode, cache *EntryCache, done func()) {
165 currentFocus := app.GetFocus()

Callers 3

initADIDNSPageFunction · 0.85
initSearchPageFunction · 0.85
treePanelKeyHandlerFunction · 0.85

Calls 3

handleLDAPErrorFunction · 0.85
updateLogFunction · 0.85
DeleteObjectMethod · 0.80

Tested by

no test coverage detected