PMDF popstore & MessageStore Manager's Guide


Previous Next Contents Index


POPSTORE_user_copy_d

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; 


Arguments

old_domain

Name of the user domain for the old user account. To use the default domain, supply a value of NULL. Used for input only.

old_domain_len

Length in bytes of the user domain name, old_domain. To use the default domain, supply a value of zero. Used for input only.

old_user

Name of the popstore user to copy or rename. Used for input only.

old_user_len

Length in bytes of the string, old_user. Used for input only.

new_domain

Name of the user domain for the new user account. To use the default domain, supply a value of NULL. Used for input only.

new_domain_len

Length in bytes of the user domain name, new_domain. To use the default domain, supply a value of zero. Used for input only.

new_user

Name of the new popstore user to copy or rename the old_user account to. Used for input only.

new_user_len

Length in bytes of the string, new_user. Used for input only.

new_password

Optional argument specifying a new, plain text password to use for the new or renamed user profile. Used for input only.

new_password_len

Length in bytes of the new, plain text password string, new_password. Used for input only.

do_rename

Boolean flag indicating whether to do a rename or a copy operation. Used for input only.

Description

To duplicate an account or change the username associated with an existing account, use the POPSTORE_user_copy_d subroutine. A copy operation is performed when do_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 with old_user and the name of the new account to copy to is given by new_user. If an account already exists with the name new_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, the default account is copied to create the new account. Non-default settings (e.g., the owner field) are then made with POPSTORE_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 the new_password and new_password_len arguments. If you do not want to set or change the password, supply a null value for new_password. When an error occurs, the new account is not created or the old account renamed or deleted.

Return Values

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 the new_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