(entry *ldap.Entry)
| 212 | } |
| 213 | |
| 214 | func 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 | |
| 236 | func GetAttrCellColor(cellName string, cellValue ldaputils.FormattedAttrValue) (string, bool) { |
| 237 | var color string = "" |
no outgoing calls
no test coverage detected