Apple AppleShare 3.0 Users and Groups Programming Interface User Manual
Page 10

(user ID 1) cannot be deleted.
Result Codes
noErr 0 No error.
ugUserNotFound 5 User is not in the users and groups file.
ugNotAUser 7 ugUserID is not the ID of a user.
ugBadParamErr 13 async is TRUE.
ugServerRunning 16 Server is running.
ugAdminRunning 17 Admin is running.
ugNotBtree 18 Users and groups file is not a B-Tree file
ugBadUID 21 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.
UGRenameUser
FUNCTION UGRenameUser (thePB: UserGroupPBPtr; async: BOOLEAN): OSErr;
pascal OSErr UGRenameUser (UserGroupPBPtr thePB, Boolean async);
Parameter Block 18 ugNamePtr long pointer to current
user name
24 ugRefNum word file reference
number
30 ugAccessID long program access ID
34 ugUserID long user ID
44 ugMisc long pointer to new user
name
UGRenameUser can be used to change the name of any user except the
administrator user. The user can be specified either by the user's ID in
ugUserID or by the name
in ugNamePtr (a pointer to a Str31). 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 contain values, then ugUserID takes
precedence. The new name is specified by ugMisc (a pointer to a Str31).
Result Codes
noErr 0 No error.
ugUserAlreadyExists 1 User with the same name exists.