MySQL User and Authentication functions
This file contains the MySQL specific functions for working with users and authenticating them. It also handles the internal mail messages, favorites, news/journal, and storage of MyGedView customizations. Assumes that a database connection has already been established.
You can extend PhpGedView to work with other systems by implementing the functions in this file. Other possible options are to use LDAP for authentication.
$Id: authentication.php 981 2007-03-21 13:24:38Z fisharebest $
phpGedView: Genealogy Viewer Copyright (C) 2002 to 2007 John Finlay and Others
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
stores a new favorite in the database
Adds a news item to the database
This function adds a news item represented by the $news array to the database. If the $news array has an ["id"] field then the function assumes that it is as update of an older news item.
add a message into the log-file
Add a new user
Adds a new user to the data store
does an admin user exits
Checks to see if an admin user has been created
authenticate a username and password
This function takes the given $username and $password and authenticates them against the database. The passwords are encrypted using the crypt() function. The username is stored in the $_SESSION["pgv_user"] session variable.
authenticate a username and password using Basic HTTP Authentication
This function uses authenticateUser(), for authentication, but retrives the userName and password provided via basic auth.
check if the user database tables exist
If the tables don't exist then create them If the tables do exist check if they need to be upgraded to the latest version of the database schema.
creates a user as reference for a gedcom export
deleteFavorite
deletes a favorite in the database
Deletes a news item from the database
deletes the user with the given username.
get blocks for the given username
retrieve the block configuration for the given user if no blocks have been set yet, and the username is a valid user (not a gedcom) then try and load the defaultuser blocks.
Gets the news item for the given news id
get a user array
finds a user from the given username and returns a user array of the form defined at http://www.phpgedview.net/devdocs/arrays.php#user
get a user from a gedcom id
finds a user from their gedcom id
Get a user's favorites
Return an array of a users messages
get the current username
gets the username for the currently active user
Gets the news items for the given user or gedcom
return a sorted array of user
returns a sorted array of the users in the system
Set Blocks
Sets the blocks for a gedcom or user portal the $setdefault parameter tells the program to also store these blocks as the blocks used by default
Update a user
Updates a user's record in the data store
Should user's changed automatically be accepted
Can user accept changes
takes a username and checks if the user has write privileges to change the gedcom data and accept changes
check if the given user has access privileges on this gedcom
takes a username and checks if the user has access privileges to view the private gedcom data.
check if the given user has write privileges on this gedcom
takes a username and checks if the user has write privileges to change the gedcom data. First check if the administrator has turned on editing privileges for this gedcom
check if given username is an admin for the current gedcom
takes a username and checks if the user has administrative privileges to change the configuration files for the currently active gedcom
check if given username is an admin
takes a username and checks if the user has administrative privileges to change the configuration files
logs a user out of the system
Updates the login time in the database of the given user
The login time is used to automatically logout users who have been inactive for the defined session time
Documentation generated on Wed, 28 Mar 2007 09:54:07 -0600 by phpDocumentor 1.3.1