Previous | Next | Contents | Index |
Copy or rename an existing user account.FORMAT
int POPSTORE_user_copy_d (old_domain, old_domain_len, old_user, old_user_len, new_domain, new_domain_len, new_user, new_user_len, new_password, new_password_len, do_rename) char *old_domain; int old_domain_len; char *old_user; int old_user_len; char *new_domain; int new_domain_len; char *new_user; int new_user_len; char *new_password; int new_password_len; int do_rename; |
Name of the user domain for the old user account. To use the
old_domain
default
domain, supply a value ofNULL
. Used for input only.Length in bytes of the user domain name,
old_domain_len
old_domain
. To use thedefault
domain, supply a value of zero. Used for input only.Name of the popstore user to copy or rename. Used for input only.
old_user
Length in bytes of the string,
old_user_len
old_user
. Used for input only.Name of the user domain for the new user account. To use the
new_domain
default
domain, supply a value ofNULL
. Used for input only.Length in bytes of the user domain name,
new_domain_len
new_domain
. To use thedefault
domain, supply a value of zero. Used for input only.Name of the new popstore user to copy or rename the
new_user
old_user
account to. Used for input only.Length in bytes of the string,
new_user_len
new_user
. Used for input only.Optional argument specifying a new, plain text password to use for the new or renamed user profile. Used for input only.
new_password
Length in bytes of the new, plain text password string,
new_password_len
new_password
. Used for input only.Boolean flag indicating whether to do a rename or a copy operation. Used for input only.
do_rename
To duplicate an account or change the username associated with an existing account, use thePOPSTORE_user_copy_d
subroutine. A copy operation is performed whendo_rename
has a value of zero; otherwise, a change of username (i.e., rename) operation is performed. When an account is copied,do_rename
=0, the message list and accounting information is not copied to the new account. The name of the account to copy is specified withold_user
and the name of the new account to copy to is given bynew_user
. If an account already exists with the namenew_user
, an error is returned and no copy is made. When an account is renamed,do_rename
=1, the entire user account is copied over to the new account and then the old account is deleted. The stored message list and accounting information from the old account is copied over to the new account. An account copy operation is typically used to create new accounts: so as to effect default settings in the new account, thedefault
account is copied to create the new account. Non-default settings (e.g., the owner field) are then made withPOPSTORE_user_update
. Account rename operations a usually done for one reason only: to change the username associated with an account. As an example of performing a copy operation, see Example 12-2. Optionally, the password for the new or renamed account can be set. To set a new password, supply the new plain text password and length for thenew_password
andnew_password_len
arguments. If you do not want to set or change the password, supply a null value fornew_password
. When an error occurs, the new account is not created or the old account renamed or deleted.
POPSTORE_SUCCESS Normal, successful completion. POPSTORE_BADLENGTH The value of new_user_len
is less than 1.POPSTORE_FILOPNERR Unable to open the old profile file for reading or create the new profile file for writing. POPSTORE_INSUFPRIV The calling process lacks SYSLCK privilege (OpenVMS only). POPSTORE_LCKOPNERR Unable to obtain lock information for one of the profile files. POPSTORE_LOCKERROR Unable to obtain a lock for one of the profile files. POPSTORE_NOTINIT The API has not yet been initialized. POPSTORE_READERROR An error while attempting to read data from the old profile file. POPSTORE_SEEKERROR an error occurred while attempting to seek to a position in one of the profile files. POPSTORE_TOOLONG The length of the new_user
string exceeds POPSTORE_MAX_USER_LEN bytes or is otherwise too long; the length of thenew_password
string exceeds a length of POPSTORE_MAX_PWD_LEN bytes; or a resulting profile file name is too long.POPSTORE_USEREXISTS An account with the name new_user
already exists.POPSTORE_VMERROR Insufficient virtual memory to perform requested operation. POPSTORE_WRITERROR An error occurred while writing data to the new profile file.
Previous | Next | Contents | Index |