Chapter 70. Person Record Definition

A person record contains information about a person. A Midgard login account can be attached to a person record by setting the username and password fields.

Some fields in Midgard's person records are especially protected from read and write access by the backend. Be sure to read and double-check the information given in the chapters about Sitegroups and Authentication, User Management and Persons as well as with the object definition and the person functions before hunting your own fake bugs for days or reporting a bug in Midgard!

Warning

Be careful when you rely on the datatypes mentioned below! Some of those fields are "implicit foreign keys" that are especially critical to the integrity of your database when using replication. The Midgard functions, object methods and repligard can deal with these dependencies -- so, if you do not really know what you do, use them.

Fields of a person record

id (integer)

The id of the person record.

username (string(16))

The username of the person. If this field is empty, the person doesn't have a Midgard account. This field cannot be changed by the normal ways to update a person record, see mgd_update_password() for details.

password (string(13))

The password of the person. It can be stored in the database either encrypted (which is the default) or in cleartext. This field cannot be changed by the normal ways to update a person record, see mgd_update_password() for details.

firstname (string(255))

The first name of the person.

lastname (string(255))

The last name of the person.

birthdate (date)

The date of birth of the person.

street (string(255))

The street address of the person

postcode (string(255))

The postal code (ZIP) of the person.

city (string(255))

The city the person lives in.

homephone (string(255))

The home phone number of the person.

workphone (string(255))

The work phone number of the person.

handphone (string(255))

The mobile phone number of the person.

homepage (string(255))

The URL of the person's homepage.

email (string(255))

The email address of the person.

extra (text)

A freeform information field.

img (integer)

A numeric field originally created to store an image id.

info (integer)

Bitfield of meta information about the record. Contains the bits address, phone, homepage, email and extra. These bits control which parts of the person record are public. This field cannot be changed by the normal ways to update a person record, see mgd_update_public() for details. The person objects do not offer direct (reading) access to the info field either, but encapsulate the access mask in five distinct fields of type bool.

topic (integer)

The id of an optional topic record the person is linked to.

subtopic (integer)

The id of an optional (sub) topic record the person is linked to.

department (integer)

The id of an optional topic describing the department the person is part of.

office (integer)

The id of an optional topic describing the office the person is part of.

sitegroup (integer)

The id of the sitegroup the person record belongs to.