"<div style='width:400px;'><img src='data:image/jpg;base64," + b64.StdEncoding.EncodeToString(attrE.ByteValues[0]) + "'/></div>"
This is the code that iterates through all of the returned AD attributes and creates the HTML text:
var sHTML string
var sA []string
for _, entry := range strcAttrs.Entries {
for _, attr := range entry.Attributes {
sA = append(sA, attr.Name)
}
}
sort.Strings(sA)
for _, attE := range sA {
for _, entry := range strcAttrs.Entries {
for _, attrE := range entry.Attributes {
if attrE.Name == attE {
if ldapAccess.IncSlcStdAttrs(attrE.Name) {
sHTML = sHTML + "<span style='text-decoration: bold; background-color: green'>"
} else {
sHTML = sHTML + "<span style='text-decoration: bold;'>"
}
sHTML = sHTML + "attribute: " + attrE.Name + "</span><br />"
var attr string = ""
for _, attr = range attrE.Values {
if ldapAccess.Include(attrE.Name) {
if ldapAccess.IsDate64(attrE.Name) {
sHTML = sHTML + "Date: " + ldapAccess.ConvertStringToDate64(attr)
} else {
if ldapAccess.IsDateZ(attrE.Name) {
sHTML = sHTML + "Date: " + ldapAccess.ConvertStringToDateZ(attr)
} else {
sHTML = sHTML + attr
}
}
} else {
if (attrE.Name) == "thumbnailPhoto" {
sHTML = sHTML + "<div style='width:400px;'><img src='data:image/jpg;base64," + b64.StdEncoding.EncodeToString(attrE.ByteValues[0]) + "'/></div>"
} else {
sHTML = sHTML + "Not Displayed"
}
}
sHTML = sHTML + "<br/>"
}
}
}
}
sHTML = sHTML + "<br/>"
}
No comments:
Post a Comment
Thank you for commenting!