XV. Person Reference

Midgard uses person records to store information about people in. Persons are orgarnized in groups.

1. Person Record Definition

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

Fields of a person record

id

The id of the person record.

username

The username of the person. If this field is empty, the person doesn't have a Midgard account.

password

The password of the person.

firstname

The first name of the person.

lastname

The last name of the person.

birthdate

The date of birth of the person.

street

The street address of the person

postcode

The postal code (ZIP) of the person.

city

The city the person lives in.

homephone

The home phone number of the person.

workphone

The work phone number of the person.

handphone

The mobile phone number of the person.

homepage

The URL of the person's homepage.

email

The email address of the person.

extra

A freeform information field.

info

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.

topic

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

subtopic

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

department

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

office

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

sitegroup

The id of the sitegroup the person record belongs to.

2. Person Object Definition

This section describes the contents of person objects. Most object parameters map directly to the record fields described above.

The functions listed within the object definition are the object methods that are available for the object. Usage information about those methods can be found in Object Methods.

/* Person Object Prototype */

Class person {

  var $N;     # Only with mgd_list_XXX functions.
  var $id;
  var $username;
  var $password;
  var $firstname;
  var $lastname;
  var $birthdate;
  var $street;
  var $postcode;
  var $city;
  var $homephone;
  var $handphone;
  var $workphone;
  var $homepage;
  var $email;
  var $extra;
  var $img;
  var $info;
  var $topic;
  var $subtopic;
  var $department;
  var $office;
  var $created;
  var $creator;
  var $pgpkey;
  var $sitegroup;

  function fetch();    # Only with mgd_list_XXX functions.

  function create();
  function update();
  function delete();

  function createattachment();
  function updateattachment();
  function deleteattachment();
  function getattachment();
  function listattachments();
  function openattachment();
  function serveattachement();

  function listparameters();
  function parameter();
  function searchparameters();
 
  function getsitegroup();
  function setsitegroup();
}
Table of Contents
mgd_copy_person — Copy a person record
mgd_create_person — Create a person record
mgd_delete_person — Delete a person
mgd_get_person — Get a person
mgd_list_persons — List person records
mgd_list_persons_in_department — List persons linked to a department
mgd_list_persons_in_department_all — List persons linked to a department topic tree
mgd_list_persons_in_office — List persons linked to a office topic
mgd_update_person — Update a person record
mgd_update_password — Change username and password of a person
mgd_update_password_plain — Change username and plain text password of a person
mgd_update_public — Declare personal information public/hidden