PMDF popstore & MessageStore Manager's Guide


Previous Contents Index


POPSTORE_user_begin_d

Access a user account.

format


int POPSTORE_user_begin_d (user_context, domain, domain_len, 
                           user, user_len, do_accounting, 
                           usage, usage_len) 
      POPSTORE_user_context **user_context; 
      char                   *domain; 
      int                     domain_len; 
      char                   *user; 
      int                     user_len; 
      int                     do_accounting; 
      char                   *usage; 
      int                     usage_len; 


Arguments

domain

Name of the user domain to use. Supply a value of NULL to indicate the default domain. Used for input only.

domain_len

Length in bytes of the user domain name, domain . Supply a value of zero to indicate the default domain. Used for input only.

user_context

User context returned by a successful call to this subroutine. Used for output only.

user

Name of the popstore user to obtain a user context for. Used for input only.

user_len

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

do_accounting

Boolean flag indicating whether or not to update accounting information for this user when the user context is disposed of. Used for input only.

usage

A short description identifying the usage being made by the caller. This description is passed to site-supplied logging subroutines for logging purposes. Used for input only.

usage_len

Length in bytes of the usage description, usage . Used for input only.

Description

User accounts are accessed with the POPSTORE_user_begin_d subroutine. On input, provide the username associated with the account you are interested in and an optional usage string describing the purpose for the access. On output, a pointer to a POPSTORE_user_context structure is returned. That structure will contain the profile information for the account as well as the list of stored messages for the account. See Section 12.11.3 for a description of that structure. When you are finished using the context, dispose of it with a call to POPSTORE_user_end . This call is important as it is during the call that accounting information is recorded and any manipulations of messages actually carried out (e.g., stored messages deleted). Fields in the returned POPSTORE_user_context must not be changed. Fields which you want to be changed should be changed by calling the appropriate API subroutines. For instance, POPSTORE_user_update to change profile fields, the POPSTORE_message_mark_ subroutines to change the disposition of a stored message, etc. When accessing an account, you must indicate whether or not accounting information should be recorded for the access. This indication is expressed with the do_accounting argument. Specify for that argument a value of POPSTORE_ACCOUNTING if accounting information should be recorded; otherwise, specify a value of POPSTORE_NOACCOUNTING . Accounting should only be recorded when the access is being done on the behalf of the actual user (i.e., is a billable event). For example, a POP server when accessing the account for a remote user would request accounting. A program doing account management would not. Accounting operations entail recording the time of attempted access and deaccess and updating the total connect time. The optional usage description, specified with the usage and usage_len arguments, are passed to any site-supplied logging subroutines. The popstore does not itself make any use of those strings.

Return Values

POPSTORE_SUCCESS Normal, successful completion.
POPSTORE_FILOPNERR Unable to open the profile file for reading.
POPSTORE_INSUFPRIV Insufficient privileges to access the profile file, or, on OpenVMS, the process lacks SYSLCK privilege.
POPSTORE_LCKOPNERR Unable to obtain lock information for the profile file.
POPSTORE_LOCKERROR Unable to obtain a lock for the profile file.
POPSTORE_NOSUCHUSR No such user account.
POPSTORE_READERROR An error while attempting to read data from the profile file.
POPSTORE_TOOLONG The resulting profile file name is too long.
POPSTORE_VMERROR Insufficient virtual memory.


Previous Next Contents Index