How to get the novell username

I want to get the novell username.
LVL 1
WiseGuyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lguiCommented:
Simple.

Go to developer.novell.com and download the Novell LIB for Delphi.

With it you can get the username and many other informations.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
intheCommented:
hi wiseguy ,
here some codes i saved form ages ago i think from "unoffical delphi developers faq" originally:

You can try this code. I've been using it on a Netware LAN for some time now with no problems. It depends on having the NWCALLS.DLL library already on the users machine; if users have a Netware connection, then they should already have that DLL.


--------------------------------------------------------------------------------

unit GetLogin;

{This unit is a wrapper for several external functions in the NWCALLS.DLL}
{Adapted by Ray Buck from code written by Gregory Trubetskoy}
{The unit contains a function that returns the Netware User ID}
{and one that returns the user's full name.}

interface
 uses
  SysUtils, Messages, Dialogs;
function GetUserLogin: string;
function GetUserFullName( SomeUser: string): string;

implementation
  type
    NWTimeStamp = record
      Year:      byte;
      Month:     byte;
      Day:       byte;
      Hour:      byte;
      Minute:    byte;
      Second:    byte;
      DayOfWeek: byte;
    end;

  {Netware API's - require NWCALLS.DLL}
  function NWGetDefaultConnectionID(var Connection: word): word;
           far; external 'NWCALLS';

  function NWGetConnectionNumber(Connection: word; var ConnectionNumber:
word): word;
           far; external 'NWCALLS';

  function NWGetConnectionInformation(Connection: word;
                                      ConnectionNumber: word;
                                      ObjectName: pchar;
                                      var ObjectType: word;
                                      var ObjectID: word;
                                      var LoginTime: NWTimeStamp):word;
           far; external 'NWCALLS';

  function NWReadPropertyValue(Connection:       word;
                               ObjectName:       pChar;
                               ObjectType:       word;
                               PropertyName:     pChar;
                               DataSetIndex:     byte;
                               DataBuffer:       pChar;
                               var More:             byte;
                               var Flags:            byte): word;
           far; external 'NWCALLS';
  { end of Netware API stuff }

function GetUserLogin: string;
var
  ConnectionID: word;
  ConnectionNumber: word;
  RC: word;
  Name: array[0..50] of Char;
  ObjectType: word;
  ObjectID: word;
  LoginTime: NWTimeStamp;
begin
  RC := NWGetDefaultConnectionID(ConnectionID);
  RC := NWGetConnectionNumber(ConnectionID, ConnectionNumber);
  RC := NWGetConnectionInformation( ConnectionID,
                                    ConnectionNumber,
                                    Name,
                                    ObjectType,
                                    ObjectID,
                                    LoginTime);

  Result := StrPas(Name);
end;

function GetUserFullName( SomeUser: string): string;
{The real user name is a 'property' called 'IDENTIFICATON'.
You have to call NWReadPropertyValue passing it (among other things) your ConnectionID,
the name of the object (same as the login of the user who's full name you need)
and the name property you want to retrieve, in this case 'IDENTIFICATION'
(which translated from Novellish to English means 'Full Name').}

var
  ConnectionID: word;
  RC: word;
  Name: array[0..50] of Char;
  ObjectType: word;
  PropName: array[0..14] of Char;
  DataSetIndex: byte;
  FullName: array[0..127] of Char;
  More: byte;
  Flags: byte;
begin
  RC := NWGetDefaultConnectionID(ConnectionID);
  ObjectType := 256; {user}
  StrPCopy(PropName, 'IDENTIFICATION');
  DataSetIndex := 1;
  StrPCopy(Name, SomeUser);
  RC := NWReadPropertyValue( ConnectionID,Name,ObjectType,PropName, DataSetIndex,FullName,More,Flags);
  if RC = 35324 then
    MessageDlg('No user ' + SomeUser + ' exists on this server!',
                mtError, [mbOK], 0);
  Result := StrPas(FullName);
end;

end.


hope it some help
Regards Barry
0
WiseGuyAuthor Commented:
Thanx Barry,

I am looking into this. If all goes well, you'll have your points before Christmas. Come to think of it: Best wishes and a succesfull 1900 (shoot, darn Y2k bug)
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

intheCommented:
:-) ok
0
WiseGuyAuthor Commented:
I didn't accept this answer.
0
lguiCommented:
Which answer you did not accepted?
0
intheCommented:
hi,
the auto-grader has been visiting again.
if it graded the question wrong then tell customer services should be able to help.
did you try the codes i put?
0
WiseGuyAuthor Commented:
Inthe,

I did try the codes you put. But I get a message stating the dll is corrupted and I need to reinstall.

I hate this autograder, I am entitled to my christmas holidays, right. :-)

CU
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.