Page 1 of 1 1
Topic Options
#111401 - 2004-01-07 03:09 PM Howard, I've done some mods to TranslateName()
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
I've made some mods to your UDF to make it a bit more simple for (my) typical use.

Code:
 

$ld = 'CN=MIS,CN=Users,DC=domain,DC=com'
? TranslateName($ld,1,3)

? TranslateName(@userid)

Function TranslateName($LookupName, optional $LookupNameType, optional $ReturnNameType, optional $InitType, optional $BindName)
Dim $NameTranslate

if not $LookupNameType and not instr($LookupName,'\') $LookupName = @domain+'\'+$LookupName endif
if not $LookupNameType $LookupNameType=3 endif
if not $ReturnNameType $ReturnNameType=1 endif
if not $InitType $InitType=1 endif
if not $BindName $BindName=@domain endif
if $InitType = 3 $BindName='' endif

$NameTranslate = CREATEOBJECT("NameTranslate") if @error Exit 1 endif
$NameTranslate.Init($InitType, $BindName) if @error Exit 2 endif
$NameTranslate.Set($LookupNameType, $LookupName) if @error Exit 3 endif
$TranslateName = $NameTranslate.Get($ReturnNameType)
Endfunction




I just thought I'd put it out here...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#111402 - 2004-01-07 04:57 PM Re: Howard, I've done some mods to TranslateName()
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Simplification for specific uses is a good thing. You are not the only person that has tweaked this UDF for their use. I think that I have to leave the UDF as generic as possible so that it is still applicable to all environments with maximum flexibility.

_________________________
Home page: http://www.kixhelp.com/hb/

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Ruud van Velsen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 1046 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.043 seconds in which 0.022 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org