Apple AppleShare 3.0 Users and Groups Programming Interface User Manual

Apple Software

Advertising
background image

USERS AND GROUPS PROGRAMMING INTERFACE

UGLibrary is a set of functions that lets you implement users and groups

capabilities for your shared applications in a consistent way. Thus, you can

take advantage of existing system-software users and groups components to

authenticate users of your shared applications.

Additionally, your applications can use UGLibrary to manipulate the Users &

Groups Data File for the AppleShare Server 3.0, or for any Macintosh that is

using Macintosh File Sharing. These functions provide a simple programming

interface that allows your applications to add and delete users and groups,

and to set information on users, groups, the AppleShare File Server 3.0, or

Macintosh File Sharing. (Throughout the rest of this document, the term file

server is used to refer to both the AppleShare File Server 3.0 and Macintosh

File Sharing.)

Here are some examples of how UGLibrary can help you make use of users and

groups files from within your applications:

- The UGAuthenticateUser function can let server applications other than the

file server use the users and groups file to authenticate the applications'

remote users. (The password must be a Pascal string containing the Cleartext

value of the password. the application must use the appropriate encryption

methods if the password will be sent over the network.)

- A database application can use the UGGetUserInfo function to see if a

remote user is a member of a specific group before allowing the user access

to files.

- Classroom software can generate users and groups files for file servers,

using its student and class database.

- An application, running on a server Macintosh, that is communicating with a

remote application can be used to maintain the users and groups files

remotely. Apple events or the PPC Toolbox can be used for authenticated

communications between the applications.

The users and groups file

A users and groups file contains records that define file server

characteristics, the list of users, the list of groups, the mapping of users

into groups, and other information about users. Users and groups files can be

opened and closed. When a users and groups file is opened, a file reference

number is assigned to the access path and a program access ID is assigned to

the application that opened the file. The file reference number and program

access ID are passed to all UGLibrary functions that manipulate the open

users and groups file.

When your program creates a users and groups file, the file's server version

number is Sys7SrvrVer. (This is the value that the UGGetULInfo function

returns in the ugSrvrVersion field.) This version number indicates that the

file can be used only by Macintosh File Sharing. If the file is to be used

with the AppleShare File Server 3.0, the ugSrvrVersion field must be set to

AS3SrvrVer by means of the UGSetULInfo function.

The following UGLibrary functions are relevant to users and groups files and

are described in detail later in this document:

Advertising