LDAP - Base64 encoded name - Problem
I am trying to build a expired password notification script that alerts users thru mails. For this, i am scanning the ldap with ldapsearch.
I store the results in a file. I have a problem with the punctuation (accents ) in the name of some user.
So instead of having a regular name in the fullName field... I have a base64 encoded name.
So if i use the fullName field to generate my email the user actually gets garbage instead of his real name...
I found how to decode the fullName field :
echo fullName | base64 -d
With this command i would get this result:
My interrogation is how to validate if the fullName is encoded in base64 or not ? I can't pass everything in base64 decode since some fullName already show correctly...
I would require some method like
so i could do
if ( isBase64encoded($fullName) )then
fullName=`echo $fullname | decode -d`
Any ideas ???
Thank you guyrs