FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Network questions
Posts: 41
Joined: Thu Dec 22, 2005 07:39 AM
Network questions
Posted: Tue Aug 18, 2009 11:01 AM

Hello!
Does anybody know the answers on this two questions:
1. How can I get my current login in Novell Netware ( something like function WNetGetUser() for Win )
2. Function GetIP() on my PC returns "0.0.0.0", but I have the static IP in my XP system. What I do wrong?

Thank's a lot.

Best regards!

Sergey (Loach) Abelev

fwh 9.04/xHarbour 1.2.1 (Rev. 6406)/Bcc55
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Network questions
Posted: Tue Aug 18, 2009 11:42 AM
1. How can I get my current login in Novell Netware ( something like function WNetGetUser() for Win )

Did you try the command "WhoAmi"

Regards
Anser
Posts: 41
Joined: Thu Dec 22, 2005 07:39 AM
Re: Network questions
Posted: Tue Aug 18, 2009 12:25 PM

Hello, Anser!
Thank you, but I can't find the command "WhoAmi" in FWH, xHarbour or OS Windows and Novell NetWare :(
May be it's only for Linux...
Have you some example of usage this command?

Best regards!

Sergey (Loach) Abelev

fwh 9.04/xHarbour 1.2.1 (Rev. 6406)/Bcc55
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Network questions
Posted: Tue Aug 18, 2009 01:23 PM

Try netname( .t. )

Posts: 41
Joined: Thu Dec 22, 2005 07:39 AM
Re: Network questions
Posted: Tue Aug 18, 2009 01:34 PM
Try netname( .t. )

Thank's. But "netname" is return the name of current Windows User...
Best regards!

Sergey (Loach) Abelev

fwh 9.04/xHarbour 1.2.1 (Rev. 6406)/Bcc55
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Network questions
Posted: Tue Aug 18, 2009 01:48 PM

Wouldn't the user name be the same? If you are not using the integrated log in then how about netbios.sys. Novell NetWare Requester provides a NetBIOS driver (NETBIOS.SYS) that emulates the NetBIOS protocol so netname( .t. ) should return correct network name.

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Network questions
Posted: Tue Aug 18, 2009 03:09 PM

WnetGetUser() has always worked for me in both Novell and Microsoft networks .. NetName(.t.) works as well

Rick Lipkin

Posts: 824
Joined: Thu Oct 13, 2005 07:39 AM
Re: Network questions
Posted: Tue Aug 18, 2009 08:01 PM
Hello,

Loach wrote:
Does anybody know the answers on this two questions:
1. How can I get my current login in Novell Netware ( something like function WNetGetUser() for Win )


For clipper there was a lib called "netto", which has all functions especially for novell. It should be possible to adapt the functions to xHarbour. If you are interested, I can send it to you.
kind regards

Stefan
Posts: 41
Joined: Thu Dec 22, 2005 07:39 AM
Re: Network questions
Posted: Wed Aug 19, 2009 05:50 AM
Hi!
Wouldn't the user name be the same

In our network (more than 500 pc) each user have the unique Novell name, but in OS Windows everybody have only "Admin" and "User" records. Than, if you have the same passwords (in Novell and Windows) after the Novell password inputing, Windows registration comes automaticly.
WnetGetUser() has always worked for me in both Novell and Microsoft networks .. NetName(.t.) works as well

In my case WnetGetUser() and NetName(.t.) returns "User" instead of my Novell name...
For clipper there was a lib called "netto", which has all functions especially for novell. It should be possible to adapt the functions to xHarbour. If you are interested, I can send it to you.

Thank you so much! If it's possible, send it on Loach(at)mail.ru.
Best regards!

Sergey (Loach) Abelev

fwh 9.04/xHarbour 1.2.1 (Rev. 6406)/Bcc55
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Network questions
Posted: Wed Aug 19, 2009 02:02 PM

Netname() requires netbios to be turned on. You have to have either have NETBIOS.SYS for Netware Requester or in Windows have netbeui turned on.

Posts: 41
Joined: Thu Dec 22, 2005 07:39 AM
Re: Network questions
Posted: Wed Aug 19, 2009 02:19 PM
You have to have either have NETBIOS.SYS for Netware Requester

I have NETBIOS.SYS in windows\system32\drivers

in Windows have netbeui turned on.


Do you mean this flag in network connection properties?
Best regards!

Sergey (Loach) Abelev

fwh 9.04/xHarbour 1.2.1 (Rev. 6406)/Bcc55
Posts: 663
Joined: Mon Dec 05, 2005 11:22 PM
Re: Network questions
Posted: Wed Aug 19, 2009 06:48 PM

Sorry it has been a while since we moved from Netware. I would have to do some more checking to find out why the netname() function is not working right. Here is another idea, I remember the Netware login script used to set an evironment variable "UserName". Click "Start" then "Run" and enter "cmd" in box and press enter. Type "Set" into cmd window and press enter. You should see one of them have the user name. Then use gete("User Name Var").

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Network questions
Posted: Wed Aug 19, 2009 07:59 PM

There is a netware 3rd party 'legacy' clipper and 32 bit .dll from Blinker ( blinkink.com ) called 'NovLib' .. it is specifically for Novell networks. It is a legacy product and did work 'somewhat' in a NDS\eDir environment. When Novell went away from the 3x environment to 4x and beyond .. we found syncronizing the user profile ( desktop ) using ( novell ) Zenworks ( dynamic local user ) solved all the problems .. that way WNetGetUser() would work because the user profile and the user login were the same.

Rick

Posts: 41
Joined: Thu Dec 22, 2005 07:39 AM
Re: Network questions
Posted: Thu Aug 20, 2009 06:18 AM
the Netware login script used to set an evironment variable "UserName"

Great idea!!! I even didn't think about it!!! It's all work well. There are two the same variables I need: NWUSERNAME and USERLOGINNAME.
Also I found it in Windows register: HKEY_CURRENT_USER\Volatile Environment.
So, many thank's for everybody!!!
Best regards!

Sergey (Loach) Abelev

fwh 9.04/xHarbour 1.2.1 (Rev. 6406)/Bcc55
Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Network questions
Posted: Thu Aug 20, 2009 06:29 PM

Loach

I work for a VERY large State Agency ( over 5000 users and desktops ) and we used to be a Novell shop .. When I used Novlib to interogate the Novell environment it was very specific to Novell .. and guess what .. we changed from Novell to Microsoft .. which made all the Novell specific libraries useless.

Just be mindfull that 'best practice' for any network ( I am also a network admin for 400 local people ) is to have the users profile made the same as the network id .. I just can not imagine why such a 500 user customer like yours would chose to sync a desktop the local Admin .. very dangerious and a lazy practice .. If they are a Novell shop they need to be using zenworks to manage their desktops with dynamic local user enforced .. that way ( like microsoft ) when anyone logs into a worstation .. their profile is created ( dynamically ) on the local box to match their login username on the network ..

Then WNetGetUser() will work in both network environments .. and you don't have to do anything special .. no environmental variables or special network specific software.

Just my 2 cents there .. I realize you are not in any position to make suggestions to your customer.

Rick Lipkin