beautypg.com

Apple AppleShare 3.0 Users and Groups Programming Interface User Manual

Page 14

background image

Result Codes

noErr 0 No error.

ugUserNotFound 5 The user is not in the users and groups

file.

ugNotAUser 7 ugUserID is not the ID of a user.

ugBadParamErr 13 async is TRUE, the length of the password

is greater than 8, or the length of the

user name is greater than 31.

ugServerRunning 16 Server is running.

ugAdminRunning 17 Admin is running.

ugNotBtree 18 Users and groups file is not a B-Tree

file.

ugBadUID 21 The ID in ugAccessID is wrong. The users

and groups file may not be open.

ugFatalError 99 There is a problem with the users and

groups file. Delete it and re-create it.

UGAuthenticateUser

FUNCTION UGAuthenticateUser (thePB: UserGroupPBPtr; async: BOOLEAN): OSErr;

pascal OSErr UGAuthenticateUser (UserGroupPBPtr thePB, Boolean async);

Parameter Block 18 ugNamePtr long pointer to user name

24 ugRefNum word file reference number

30 ugAccessID long program access ID

34 ugUserID long user ID

50 ugPassword long pointer to user

password

UGAuthenticateUser authenticates the user's password. The user is specified

either by ugUserID or by ugNamePtr (a pointer to a Str31), and the password

is speci-fied in ugPassword (a pointer to a Str8). If ugUserID is used, then

ugNamePtr should be a pointer to a zero-length Str31. If ugNamePtr is used,

then ugUserID should be 0. If both fields have values, then ugUserID takes

precedence.

Result Codes

noErr 0 No error.

ugUserNotFound 5 The user is not in the users and groups

file.

ugNotAUser 7 ugUserID is not the ID of a user.