|
| |
Knowledgebase
>>ITEM : N00028 >>DATE: 02/29/96 >>TYPE: Information
>>TITLE: How to locate login scripts in NetWare
>>PRODUCT(S):
NetLib (all versions) for Clipper
NetLib (all versions) for FoxPro DOS
NetLib (all versions) for FoxPro Windows
>>PLATFORMS(S):
NetWare 2.x, 3.x
NetWare 4.x
>>SUMMARY:
How to locate user's login script.
>>MORE INFORMATION:
Under NetWare 2.x and 3.x, a user's login script is a
concatenation of the system login script and the individual
user's login script, if any.
The system login script is stored in file
"SYS:PUBLIC\NET$LOG.DAT".
The user's login script is stored in file "SYS:\MAIL\{id}\LOGIN", where {id} is the user's hexadecimal Bindery ID with leading zeros removed. Use N_B_ID() to get the user's Bindery ID and strip off the leading zeros. The use the standard file functions (FOPEN, FREAD, FCLOSE, etc.) to access the file. If using Clipper, you may alternatively use the MEMOREAD function. If using FoxPro, you may use the MEMOREAD UDF found in SNIPPETS.PRG.
Under NetWare 4.x, the login script is stored in a stream-type attribute (property) named "Login Script" attached to the user object.
Use N_D_PROPEN to open the file. If using Clipper, you may then use the standard file functions, FREAD, FCLOSE, etc., to access the file. If using FoxPro, you must use the file-UDFs found in SNIPPETS.PRG: _FREAD, FCLOSE, etc. This is because Clipper file functions use "true" DOS file handles, while FoxPro uses internal "pseudo" file handles.
>>RESOLUTION/FIX:
>>EXAMPLE(S):
* Netware 3.x - assume Z: is mapped to SYS:
* in FoxPro, MEMOREAD found in SNIPPETS.PRG
cScript = MEMOREAD("Z:\MAIL\1\LOGIN")
* supervisor's script
* Netware 4.x Clipper example
nHandle = N_D_PROPEN("ADMIN",1,"Login Script")
IF nHandle > 0
- nLen = FSEEK(nHandle,0,2) && get lenth of file
- FSEEK(nHandle,0,0) && go back to start
- cBuffer = SPACE(nLen)
- FREAD(nHandle,@cBuffer,nLen)
- FCLOSE(nHandle) && important!
- ? cBuffer && print script
* Netware 4.x FoxPro example
* _FSEEK, _FREAD, etc., in SNIPPETS.PRG
nHandle = N_D_PROPEN("ADMIN",1,"Login Script")
IF nHandle > 0
- nLen = _FSEEK(nHandle,0,2) && get lenth of file
- =_FSEEK(nHandle,0,0) && go back to start
- cBuffer = FREAD(nHandle,nLen)
- =FCLOSE(nHandle) && important!
- ? cBuffer && print script
>>SEE ALSO:
>>COPYRIGHT 1997 Communication Horizons
All rights reserved worldwide.
No distribution without specific consent of publisher.
Knowledgebase
Top Home
| | |
|