/includes/functions_privacy.php

Description

Privacy Functions

See http://www.phpgedview.net/privacy.php for more information on privacy in PhpGedView

phpGedView: Genealogy Viewer Copyright (C) 2002 to 2005 PGV Development Team

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

  • version: $Id: functions_privacy.php 981 2007-03-21 13:24:38Z fisharebest $
Functions
displayDetails (line 271)

check if the details of the GEDCOM record should be shown

This function checks if the details of the given GEDCOM record represented by $indirec should be shown. This function has been depricated and now all it does is looks up the GEDCOM XRef ID and type from the gedcom record and pass them as parameters to the displayDetailsByID function.

  • return: return true to show the persons details, return false to keep them private
  • deprecated: This function has been deprecated by the displayDetailsByID function, it is still provided for backwards compatibility but it should no longer be used in new code
boolean displayDetails (string $indirec)
  • string $indirec: the raw gedcom record to check privacy settings for
displayDetailsByID (line 309)

check if details for a GEDCOM XRef ID should be shown

This function uses the settings in the global variables above to determine if the current user has sufficient privileges to access the GEDCOM resource.

  • return: return true to show the persons details, return false to keep them private
  • author: yalnifj
boolean displayDetailsByID (string $pid, [string $type = "INDI"])
  • string $pid: the GEDCOM XRef ID for the entity to check privacy settings for
  • string $type: the GEDCOM type represented by the $pid. This setting is used so that different gedcom types can be handled slightly different. (ie. a source cannot be dead) The possible values of $type are:
    • "INDI" record is an individual
    • "FAM" record is a family
    • "REPO" record is a repository
FactEditRestricted (line 876)

Check fact record for editing restrictions

Checks if the user is allowed to change fact information, based on the existence of the RESN tag in the fact record.

  • return: Allowed or not allowed
int FactEditRestricted ( $pid,  $factrec)
  • $pid
  • $factrec
FactViewRestricted (line 906)

Check fact record for viewing restrictions

Checks if the user is allowed to view fact information, based on the existence of the RESN tag in the fact record.

  • return: Allowed or not allowed
int FactViewRestricted ( $pid,  $factrec)
  • $pid
  • $factrec
getUserAccessLevel (line 857)

get current user's access level

checks the current user and returns their privacy access level

  • return: their access level
int getUserAccessLevel ([ $username = ""])
  • $username
get_last_private_data (line 844)
void get_last_private_data ( $gid)
  • $gid
is_dead (line 70)

check if a person is dead

this function will read a person's gedcom record and try to determine whether the person is dead or not. It checks several parameters to determine death status in the following order:

  1. a DEAT record returns dead
  2. a BIRT record less than $MAX_ALIVE_AGE returns alive
  3. Any date in the record that would make them older than $MAX_ALIVE_AGE
  4. A date in the parents record that makes the parents older than $MAX_ALIVE_AGE+40
  5. A marriage record with a date greater than $MAX_ALIVE_AGE-10
  6. A date in the spouse record greater than $MAX_ALIVE_AGE
  7. A date in the children's record that is greater than $MAX_ALIVE_AGE-10
  8. A date in the grand childnren's record that is greater than $MAX_ALIVE_AGE-30
This function should only be called once per individual. In index mode this is called during the Gedcom import. In MySQL mode this is called the first time the individual is accessed and then the database table is updated.

  • return: true if dead false if alive
  • author: John Finlay (yalnifj)
bool is_dead (string $indirec, [ $cyear = ""])
  • string $indirec: the raw gedcom record
  • $cyear
privatize_gedcom (line 745)

remove all private information from a gedcom record

this function will analyze and gedcom record and privatize it by removing all private information that should be hidden from the user trying to access it.

  • return: the privatized gedcom record
string privatize_gedcom (string $gedrec)
  • string $gedrec: the raw gedcom record to privatize
showFact (line 677)

check if the given GEDCOM fact for the given individual, family, or source XRef ID should be shown

This function uses the settings in the global variables above to determine if the current user has sufficient privileges to access the GEDCOM resource. It first checks the $global_facts array for admin override settings for the fact.

  • return: return true to show the fact, return false to keep it private
  • author: yalnifj
boolean showFact (string $fact, string $pid)
  • string $fact: the GEDCOM fact tag to check the privacy settings
  • string $pid: the GEDCOM XRef ID for the entity to check privacy settings
showFactDetails (line 718)

check if the details of given GEDCOM fact for the given individual, family, or source XRef ID should be shown

This function uses the settings in the global variables above to determine if the current user has sufficient privileges to access the GEDCOM resource. It first checks the $global_facts array for admin override settings for the fact.

  • return: return true to show the fact details, return false to keep it private
  • author: yalnifj
boolean showFactDetails (string $fact, string $pid)
  • string $fact: the GEDCOM fact tag to check the privacy settings
  • string $pid: the GEDCOM XRef ID for the entity to check privacy settings
showLivingName (line 609)

check if the name of the GEDCOM record should be shown

This function checks if the name of the given GEDCOM record represented by $indirec should be shown. This function has been depricated and now all it does is looks up the GEDCOM XRef ID and type from the gedcom record and pass them as parameters to the

function.

  • return: return true to show the persons details, return false to keep them private
  • deprecated: This function has been deprecated by the showLivingNameByID function, it is still provided for backwards compatibility but it should no longer be used in new code
boolean showLivingName (string $indirec)
  • string $indirec: the raw gedcom record to check privacy settings for
showLivingNameByID (line 637)

check if the name for a GEDCOM XRef ID should be shown

This function uses the settings in the global variables above to determine if the current user has sufficient privileges to access the GEDCOM resource. It first checks the $SHOW_LIVING_NAMES variable to see if names are shown to the public. If they are then this function will always return true. If the name is hidden then all relationships connected with the individual are also hidden such that arriving at this record results in a dead end.

  • return: return true to show the person's name, return false to keep it private
  • author: yalnifj
boolean showLivingNameByID (string $pid)
  • string $pid: the GEDCOM XRef ID for the entity to check privacy settings for

Documentation generated on Wed, 28 Mar 2007 09:54:20 -0600 by phpDocumentor 1.3.1