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

Function GetEntryColor

tui/theme.go:214–234  ·  view source on GitHub ↗
(entry *ldap.Entry)

Source from the content-addressed store, hash-verified

212}
213
214func GetEntryColor(entry *ldap.Entry) (tcell.Color, bool) {
215 isDeleted := strings.ToLower(entry.GetAttributeValue("isDeleted")) == "true"
216 isRecycled := strings.ToLower(entry.GetAttributeValue("isRecycled")) == "true"
217
218 if isDeleted {
219 if isRecycled {
220 return DefaultTheme.RecycledNodeColor, true
221 } else {
222 return DefaultTheme.DeletedNodeColor, true
223 }
224 } else {
225 uac := entry.GetAttributeValue("userAccountControl")
226 uacNum, err := strconv.Atoi(uac)
227
228 if err == nil && uacNum&2 != 0 {
229 return DefaultTheme.DisabledNodeColor, true
230 }
231 }
232
233 return baseTheme.PrimaryTextColor, false
234}
235
236func GetAttrCellColor(cellName string, cellValue ldaputils.FormattedAttrValue) (string, bool) {
237 var color string = ""

Callers 3

createTreeNodeFromEntryFunction · 0.85
reloadSearchNodeFunction · 0.85
executeSearchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected