
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Book 4-Appendices - <b>nnetlogin()</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
NNETLOGIN()
Log in a user on a file server
------------------------------------------------------------------------------
Syntax
NNETLOGIN(<cName>,<cPassword>,[<cServer>|<nConId>])
--> nConId
Netware: 2.2 and 3.11
Arguments
<cName> Designates the name of the user that is logged in.
<cPassword> Designates the corresponding password. If no password
is required, an empty string must be passed.
<cServer> Designates the name of the file server on which the user
is logged in.
<nConId> Designates the connection ID of the workstation on
<cServer>. A connection ID can be passed only if the file server is
attached to the workstation.
Returns
If a user has been logged in successfully, NNETLOGIN() returns a value
between 1 and 8. This value represents the connection ID that can be
used to address the file server on the workstation. If an error occurs,
the function returns 0.
Description
NNETLOGIN() allows you to log in a user on a file server within an
application. The file server must not be attached when you call this
function. When NNETLOGIN() is first called, it automatically attaches
the workstation to <cServer>. If no server is specified, the function
tries to log in the user on the default server.
If a user at the requesting workstation is already logged in on the
related file server, this user is logged out automatically. The log out
is performed even if the name of the logged in user is identical to the
user name passed with NNETLOGIN(). If the attempt to log in is
unsuccessful (for example, because of an incorrect password), the
previous log in is canceled. Any drives mapped to the related file
server are deleted and are not restored even if the log in is
successful.
Important! Before you attempt to log in on file servers where a
user is already logged in on the current workstation, make sure that all
files on the volumes of the related file server are closed correctly.
A return value that is greater than 0 indicates that the log in has been
successful. The value can be stored in a variable and used later to
identify the required file server. Alternatively, the identification of
the server is possible with the server name.
Notes
. The password is case sensitive.
. If the log in is unsuccessful (for example, because of an
invalid password or user name), the server remains attached.
. The function does not execute a login script. To get a login
script, the function must be called.
Examples
. Log in Paul on server NANGERTOOLS2:
IF (nConId:= NNETLOGIN('PAUL','190366','NANGERTOOLS2'))>0
? 'Login successful!'
ELSE
? 'Login failed!'
ENDIF
. Log in on an attached server:
IF (nConId:=NNETATTACH('NANGERTOOLS2'))>0
NNETLOGIN('PAUL','190366',nConId)
ENDIF
See Also: NNETATTACH() NNETFSLST() NNETLOGOUT()
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson