Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Eric den Doop
  Where is Eric den Doop?
 Houten
 Netherlands
 Eric den Doop
 To: Ellora Rakshit
  Where is Ellora Rakshit?
 Dhaka
 Bangladesh
 Ellora Rakshit
 Tags
Subject: RE: user name for netware login
Thread ID: 22099 Message ID: 22765 # Views: 18 # Ratings: 0
Version: Visual FoxPro 7 Category: Operating Systems
Date: Friday, April 25, 2003 7:27:26 AM         
   


Found this code. Can't test it because I do not have a netware network available.
FUNCTION Novell_UserID
 
 * Function Novell_UserID
 ** Usage:  l_cUserID = Novell_UserID()
 UserID = ""
 TempCH = 0
 DECLARE LONG NWDSCreateContextHandle IN netwin32 ;
 LONG @newHandle
 DECLARE LONG NWDSFreeContext IN netwin32 ;
 LONG newHandle
 
 RetCode = NWDSCreateContextHandle(@TempCH)
 IF M.RetCode = 0
   * CREATED A CONTEXT HANDLE OK
   UserID = SPACE(255)
   Declare LONG NWDSWhoAmI IN netwin32 ;
    LONG context, STRING @objectName
   RetCode = NWDSWhoAmI(M.TempCH, @UserID)
   IF M.RetCode = 0
       * got the WhoAmI info ok
     IF UserID = "CN="
      UserID = SUBSTR(UserID, 4)
     ENDIF
   UserID = STRTRAN(UserID, chr(0), " ") && kill off the null
   ELSE
     * had an error
   ENDIF M.RetCode = 0
   * release allocated context handle
   RetCode = NWDSFreeContext(M.TempCH)
   IF M.RetCode = 0
     * context handle released ok
   ELSE M.RetCode = 0
     * had an error
   ENDIF M.RetCode = 0
 ENDIF
 
 RETURN Alltrim(UserID)
 
ENDFUNC

--
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts

COMPLETE THREAD

user name for netware login Posted by Ellora Rakshit @ 4/9/2003 1:08:28 PM
RE: user name for netware login Posted by Boudewijn Lutgerink @ 4/9/2003 3:10:14 PM
RE: user name for netware login Posted by Ellora Rakshit @ 4/18/2003 7:37:01 AM
RE: user name for netware login Posted by Ellora Rakshit @ 4/25/2003 5:18:22 AM
RE: user name for netware login Posted by Eric den Doop @ 4/25/2003 7:27:26 AM
RE: user name for netware login "I tested" Posted by Pete Sass @ 4/25/2003 1:50:12 PM
RE: user name for netware login - Working perfect Posted by Ellora Rakshit @ 4/26/2003 10:50:10 AM
RE: user name for netware login - and Password?... Posted by Ellora Rakshit @ 4/27/2003 5:45:17 AM