Get Novell User login name 
Author Message
 Get Novell User login name

Does anybody know how to get the Novell user login name?  I am using VFP7.0
SP1.  I need to know who the Novell user is in order to set privileges
within my app.


Sat, 03 Sep 2005 04:37:57 GMT  
 Get Novell User login name
Hello, Don!
You wrote  on Mon, 17 Mar 2003 14:37:57 -0600:

 DC> Does anybody know how to get the Novell user login name?  I am using
 DC> VFP7.0 SP1.  I need to know who the Novell user is in order to set
 DC> privileges within my app.

If this Novell user name is the same as the Windows logon name, then you can
use the SYS(0) function. I don't have a novell server available at my
current location, but maybe you can also find an OS environment variable
that holds the user name. On the WinXX command prompt, enter SET to find out
more. The last option is to use the Novell networking api's. Sorry, I do not
have a sample.
---
Eric den Doop
www.foxite.com - The Home Of The Visual FoxPro Experts - Powered By VFP8



Sat, 03 Sep 2005 14:18:37 GMT  
 Get Novell User login name

Quote:

> Does anybody know how to get the Novell user login name?  I am using VFP7.0
> SP1.  I need to know who the Novell user is in order to set privileges
> within my app.

Maybe try this function:

FUNCTION Novell_UserID

        * Function Novell_UserID
        ** Usage:  l_cUserID = Novell_UserID()
        UserID = ""
        TempCH = 0
        DECLARE LONG NWDSCreateContextHandle IN netwin32 ;

        DECLARE LONG NWDSFreeContext IN netwin32 ;
        LONG newHandle


        IF M.RetCode = 0
          * CREATED A CONTEXT HANDLE OK
          UserID = SPACE(255)
          Declare LONG NWDSWhoAmI IN netwin32 ;


          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

Best regards,
P.B.



Sat, 03 Sep 2005 20:09:07 GMT  
 Get Novell User login name
This code worked beautifully, thank you!


Quote:

> > Does anybody know how to get the Novell user login name?  I am using
VFP7.0
> > SP1.  I need to know who the Novell user is in order to set privileges
> > within my app.

> Maybe try this function:

> FUNCTION Novell_UserID

> * Function Novell_UserID
> ** Usage:  l_cUserID = Novell_UserID()
> UserID = ""
> TempCH = 0
> DECLARE LONG NWDSCreateContextHandle IN netwin32 ;

> DECLARE LONG NWDSFreeContext IN netwin32 ;
> LONG newHandle


> IF M.RetCode = 0
>   * CREATED A CONTEXT HANDLE OK
>   UserID = SPACE(255)
>   Declare LONG NWDSWhoAmI IN netwin32 ;


>   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

> Best regards,
> P.B.



Sun, 04 Sep 2005 02:52:02 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Getting user name and domain name using VFP

2. Get Login name and User's NT Group

3. FPD2.6, How do I capture User login Name

4. How to get user login name ?

5. Changing a user's login name?

6. how to get user login name in VFP under NT Network

7. Getting NOVELL Queue Name FP 2.x

8. Novell User Name

9. Novell User Name -Reply

10. Novell User Name

11. Novell User Name -Reply

12. Novell User Name/Windows 2000

 

 
Powered by phpBB® Forum Software