whoami

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

whoami

Postby emmetkelly » Tue Dec 01, 2009 4:37 am

Hi,

Do any of you know how to get the User Name from Novell, like the whoami command? Or is there another way to get this info (that I'm obviously not aware of)?

Thanks,
Emmet.
emmetkelly
 
Posts: 4
Joined: Tue Dec 01, 2009 4:33 am

Re: whoami

Postby klaus » Wed Dec 02, 2009 3:40 am

Hello Emmet,

as far as I remeber it is the whoami.exe command in a DOS box.

Kind regards

Klaus
Klaus Breker
Currently working for clearstream (Deutsche Börse Group)
klaus
 
Posts: 38
Joined: Fri Nov 28, 2008 1:16 am
Location: Bonn

Re: whoami

Postby emmetkelly » Wed Dec 02, 2009 4:52 am

Thanks for that, Klaus.

Unfortunately, I need the user name as per the Novell login, not the Windows user name.

If I use DOS whoami.exe command, I get: "AC0350\user" . . . whereas, in Novell it's: "kellye".

Thanks,
Emmet.
emmetkelly
 
Posts: 4
Joined: Tue Dec 01, 2009 4:33 am

Re: whoami

Postby marten » Wed Dec 02, 2009 6:07 am

Code: Select all
This tip was submitted by Ashley Levin.

The following code shows how to access the Novell API and get the usename.

Declare the following external functions:

function ulong NWInitialize() library "NWInfo"
function ulong NWGetInfo( Long Drv, Long info, ref string buffer ) Library "NWInfo"

Then declare a function and add the following code:

// i_sys=1 - novell
string login_name
string ls_temp
integer drv,info
long l_ret

login_name = "user_name_error"

if i_sys = 1 then   // novell login name.
   l_ret = NWInitialize()    // init the dll, check for client 32 ...
   if l_ret  = 0  then
      drv = 7 // network drive g:
      info = 35 // typeless user name
      ls_temp = Space( 129 )
      //  get the login name for specific drive
      l_ret = NWGetInfo( drv, info, ls_temp )
      if l_ret = 0 then
         login_name = Trim( ls_temp )
      end if
   end if         
end if

return login_name
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: whoami

Postby emmetkelly » Wed Dec 02, 2009 6:40 am

Thanks, Marten. I'll try that.

However, can it not just be done through Smalltalk?
emmetkelly
 
Posts: 4
Joined: Tue Dec 01, 2009 4:33 am

Re: whoami

Postby marten » Wed Dec 02, 2009 8:32 am

emmetkelly wrote:Thanks, Marten. I'll try that.

However, can it not just be done through Smalltalk?


Well, I even do not know, which Novell software has to be installed to get what you want to do !?!?!?!? I just googled around and found this tip. If you have the dynamic libraries mentioned in that example, you may wrap these calls in Smalltalk and then you have the solution.
Marten Feldtmann, Principal Smalltalk User, Private
SkypeMe callto://marten.feldtmann
marten
[|]
 
Posts: 641
Joined: Sat Oct 14, 2006 7:10 am
Location: Hamburg - Germany

Re: whoami

Postby emmetkelly » Wed Dec 02, 2009 9:54 am

Thanks again Marten.

I'm actually going to try a different approach. The reason I was trying to use Novell's whoami command, was to get the User Name. I was then going to use the User Name, to get all the user's details from LDAP. However, I believe that I can get the user's details from LDAP by using the Host Name. That is, I'll use the Socket Manager to get the Host Name, and then I'll get the User Info through an Ldap Session.

Thanks once again,
Emmet.
emmetkelly
 
Posts: 4
Joined: Tue Dec 01, 2009 4:33 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest