(node *tview.TreeNode)
| 499 | } |
| 500 | |
| 501 | func openPasswordChangeForm(node *tview.TreeNode) { |
| 502 | currentFocus := app.GetFocus() |
| 503 | changePasswordForm := NewXForm() |
| 504 | |
| 505 | baseDN := node.GetReference().(string) |
| 506 | changePasswordForm. |
| 507 | AddTextView("Object DN", baseDN, 0, 1, false, true). |
| 508 | AddPasswordField("New Password", "", 20, '*', nil). |
| 509 | AddButton("Go Back", func() { |
| 510 | app.SetRoot(appPanel, false).SetFocus(currentFocus) |
| 511 | }). |
| 512 | AddButton("Update", func() { |
| 513 | newPassword := changePasswordForm.GetFormItemByLabel("New Password").(*tview.InputField).GetText() |
| 514 | |
| 515 | err := lc.ResetPassword(baseDN, newPassword) |
| 516 | if err != nil { |
| 517 | handleLDAPError(err) |
| 518 | } else { |
| 519 | updateLog("Password changed: "+baseDN, "green") |
| 520 | } |
| 521 | |
| 522 | app.SetRoot(appPanel, false).SetFocus(currentFocus) |
| 523 | }) |
| 524 | |
| 525 | changePasswordForm.SetTitle("Password Editor").SetBorder(true) |
| 526 | |
| 527 | //assignFormTheme(changePasswordForm) |
| 528 | |
| 529 | changePasswordForm.SetInputCapture(handleEscape(treePanel)) |
| 530 | |
| 531 | app.SetRoot(changePasswordForm, true).SetFocus(changePasswordForm) |
| 532 | } |
| 533 | |
| 534 | func openMoveObjectForm(node *tview.TreeNode, done func(string)) { |
| 535 | baseDN := node.GetReference().(string) |
no test coverage detected