
Click above to get retro games delivered to your door ever month!
X-Hacker.org- NetLib for Clipper, Version 6.0 - n_b_create(<cobject>, <ntype> [,<nflag> [, <nsecurity>]])
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
N_B_CREATE(<cObject>, <nType> [,<nFlag> [, <nSecurity>]])
Parameters
<cObject>
Name of the object.
<nType>
Object type.
<nFlag>
Longevity of the object.
<nSecurity>
Defines who will be allowed to read or modify the object.
Returns
Logical true if successful, false otherwise. If the function returns
false, you can call N_ERROR(), which will return the NetWare error
code.
Description
A new object of the specified type will be created in the bindery. If
the object already exists, or if the name or type is invalid, no action
will be taken. (Use N_B_SCAN() to search for matching object names.)
<nType> defines the type of the object.
Value Object type
1 User
2 Group
3 Print queue
4 File server
6 Gateway
7 Print server
38 Remote bridge
<nFlag> defines the longevity of the object. Valid settings are listed
below. (Manifest constants are defined in BINDERY.CH.)
Value #define Longevity
0 NB_STATIC Permanent object.
(default)
1 NB_DYNAMIC Dynamic object that
will be removed
whenever the server
is rebooted.
<nSecurity> defines who will be allowed to read
and/or modify the object. The levels are:
Read Access
Value #define Access
0 NB_ANYONE_READ Anyone attached to
the server
1 NB_LOGGED_READ Anyone logged in to
the server
2 NB_OBJECT_READ Currently logged in
user only
3 NB_SUPERVISOR_READ Supervisor
4 NB_NETWARE_READ NetWare operating
system only
Write Access
Value #define Access
0 NB_ANYONE_WRITE Anyone attached to
the server
16 NB_LOGGED_WRITE Anyone logged in
to the server
32 NB_OBJECT_WRITE Currently logged
in user only
48 NB_SUPERVISOR_WRITE Supervisor
64 NB_NETWARE_WRITE NetWare operating
system only
To assign a read and write level, add a _READ and _WRITE value
together. For instance, NB_LOGGED_READ + NB_SUPERVISOR_WRITE (1 + 48 =
49)indicates that anyone logged into the server can access the object,
but only a supervisor (or equivalent) can modify or delete the object.
If <nSecurity> is omitted, a level of 0 + 0 (anyone attached to server)
is assigned.
Example
// Add a user to the system.
#include bindery.ch
N_READY()
nUser = 1
nGroup = 2
// First create an object, 'Neil'.
N_B_CREATE('NEIL', nUser, ;
NB_STATIC, ;
NB_LOGGED_READ + NB_SUPERVISOR_WRITE)
// Then give Neil an identity.
N_B_PRCREATE('NEIL', nUser, ;
'IDENTIFICATION', ;
NB_STATIC + NB_ITEM_PROPERTY)
N_B_PRWRITE('NEIL', nUser, ;
'IDENTIFICATION', ;
'NEIL WEICHER' )
// All user objects must have a GROUPS_I'M_IN set
// property even if the user isn't in any groups
N_B_PRCREATE('NEIL', nUser, ;
"GROUPS_I'M_IN", ;
NB_STATIC + NB_SET_PROPERTY)
// Add Neil to a group...
N_B_LINK('NEIL', nUser, ;
"GROUPS_I'M_IN", ;
'EVERYONE', nGroup)
// ...and the group to Neil.
N_B_LINK('EVERYONE', nGroup, ;
'GROUP_MEMBERS', ;
'NEIL', nUser )
// Create another NetWare-required set property
N_B_PRCREATE('NEIL', nUser, ;
'SECURITY_EQUALS', ;
NB_STATIC + NB_SET_PROPERTY)
N_B_LINK('NEIL', nUser, ;
'SECURITY_EQUALS', ;
'EVERYONE', nGroup )
// Create a password property, and let Neil read
// or modify it. (NetWare default)
N_B_PRCREATE('NEIL',nUser, ;
'PASSWORD', ;
NB_STATIC + NB_ITEM_PROPERTY, ;
NB_OBJECT_READ + NB_OBJECT_WRITE)
Files
BINDERY.CH
See Also: N_B_LINK() N_B_PRCREATE() N_B_SCAN()
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson