Main Table of Contents


Table of Contents

class PtIndividual
PtIndividual: class summary
PtIndividual::PtIndividual()
PtIndividual::~PtIndividual()
PtIndividual::Delete()
PtIndividual::IsPassword()
PtIndividual::SetPassword()
PtIndividual::Store()

class PtIndividual


Intro
PtIndividual: class summary
PtIndividual::PtIndividual()
PtIndividual::~PtIndividual()
PtIndividual::Delete()
PtIndividual::IsPassword()
PtIndividual::SetPassword()
PtIndividual::Store()

PtIndividual is used to assign rights to an individual user. A PtIndividual is basically equivalent to a user account on most operating systems; when you log into the database, you will do this as a PtIndividual, which means that a PtIndividual needs to have a password. Each PtIndividual will be a member of one or more PtGroups.

The PtIndividual class is pre-registered in every POET dictionary, and classes for ondemands, sets, allsets, and queries for PtIndividual have also been pre-registered. The following table lists the pre-registered classes, and shows the equivalent class declaration for each class:

PtIndividual persistent class PtIndividual
PtIndividualAllSet AllSet generated from above declaration
PtIndividualQuery Query class generated from above declaration
PtIndividualOnDemand typedef ondemand<PtIndividual> PtIndividualOnDemand
PtIndividualOnDemandCSet typedef cset<ondemand<PtIndividual>> PtIndividualOnDemandCSet;


PtIndividual: class summary


Intro

Files to include Class declaration Base class
poet.hxx ptuser.hxx ptuser.hxx PtUser

Member functions:

constructor PtIndividual(PtString& loginname, short userid, PtString& password, PtString& realname);
destructor virtual ~PtIndividual();
Delete virtual int Delete(PtDepthMode mode = PtSHALLOW);
IsPassword int IsPassword(PtString& );
SetPassword int SetPassword(PtString& oldPass, PtString& newPass);
Store int Store(PtDepthMode mode = PtDEEP);

PtIndividual::PtIndividual()


Intro

Declaration:

PtIndividual::PtIndividual(PtString& loginname, short userid, PtString& password, PtString& realname)

Description:

Constructor.

Parameters:

PtString& loginname A short name used to identify the PtIndividual.
short userid User ID for the PtIndividual. If this is 0, POET will generate a unique user ID.
PtString& password Password for the PtIndividual.
PtString& realname The real name of the individual. This is not used to log in, only for display purposes, so long names are appropriate.

Example:

PtIndividual Alfred( PtString("Alfred"), 0,
PtString("What, me worry?"),
PtString("Alfred E. Newmann"));

Discussion:

No rights are assigned until you assign users to the group, store the group in the database, and store the users.


PtIndividual::~PtIndividual()


Intro

Declaration:

virtual PtIndividual::~PtIndividual()

Description:

Destructor.


PtIndividual::Delete()


Intro

Declaration:

int PtIndividual::Delete(PtDepthMode mode = PtSHALLOW)

Description:

This method deletes an individual user. If the deleted user is the last one, all groups are also deleted, thus effectively disabling the user authorization.


PtIndividual::IsPassword()


Intro

Declaration:

int PtIndividual::IsPassword(PtString& ThatString)

Description:

Determines whether That String contains the correct password for the user. This can be useful if you are using POET's user authorization as the user authorization for your own program, or if you are writing utilities for POET.


PtIndividual::SetPassword()


Intro

Declaration:

int PtIndividual::SetPassword(PtString& oldPass, PtString& newPass)

Description:

Sets the password for the PtIndividual. If the old password is not correct, SetPassword() fails.


PtIndividual::Store()


Intro

Declaration:

int PtIndividual::Store(PtDepthMode mode = PtDEEP)

Description:

Stores the PtIndividual, making any changes effective in the database. If the individual is being stored for the first time (newly created) and it was not assigned to a group it is added to the default group.

Copyright (c) 1996 POET Software, Inc. All rights reserved. Reproduction in whole or in part in any form or medium without the express permission of POET Software, Inc. is prohibited.