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; |
Files to include | Class declaration | Base class |
poet.hxx ptuser.hxx | ptuser.hxx | PtUser |
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(PtString& loginname, short userid, PtString& password, PtString& realname)
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. |
- PtIndividual Alfred( PtString("Alfred"), 0,
- PtString("What, me worry?"),
- PtString("Alfred E. Newmann"));
No rights are assigned until you assign users to the group, store the group in the database, and store the users.
- virtual PtIndividual::~PtIndividual()
- int PtIndividual::Delete(PtDepthMode mode = PtSHALLOW)
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.
- int PtIndividual::IsPassword(PtString& ThatString)
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.
- int PtIndividual::SetPassword(PtString& oldPass, PtString& newPass)
Sets the password for the PtIndividual. If the old password is not correct, SetPassword() fails.
- int PtIndividual::Store(PtDepthMode mode = PtDEEP)
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.