[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/ -> Identity.php (sommaire)

(pas de description)

Poids: 424 lignes (13 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Identity:: (16 méthodes):
  Identity()
  init()
  save()
  add()
  delete()
  getDefault()
  setDefault()
  getValue()
  getAll()
  setValue()
  isLocked()
  hasValue()
  verify()
  getDefaultFromAddress()
  factory()
  singleton()


Classe: Identity  - X-Ref

This class provides an interface to all identities a user might have. Its
methods take care of any site-specific restrictions configured in prefs.php
and conf.php.

$Horde: framework/Prefs/Identity.php,v 1.1.2.2 2006/06/28 20:52:53 jan Exp $

Copyright 2001-2006 Jan Schneider <jan@horde.org>

See the enclosed file COPYING for license information (LGPL). If you
did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.

Identity($user = null)   X-Ref
Reads all the user's identities from the prefs object or builds a new
identity from the standard values given in prefs.php.

param: string $user  If specified, we read another user's identities

init()   X-Ref
Creates a default identity if none exists yet and sets the preferences
up if the identities are locked.


save()   X-Ref
Saves all identities in the prefs backend.


add()   X-Ref
Adds a new empty identity to the array of identities.

return: integer  The pointer to the created identity

delete($identity)   X-Ref
Removes an identity from the array of identities.

param: integer $identity  The pointer to the identity to be removed
return: array  The removed identity

getDefault()   X-Ref
Returns a pointer to the current default identity.

return: integer  The pointer to the current default identity

setDefault($identity)   X-Ref
Sets the current default identity.
If the identity doesn't exist, the old default identity stays the same.

param: integer $identity  The pointer to the new default identity
return: boolean  True on success, false on failure

getValue($key, $identity = null)   X-Ref
Returns a property from one of the identities. If this value doesn't
exist or is locked, the property is retrieved from the prefs backend.

param: string $key        The property to retrieve.
param: integer $identity  The identity to retrieve the property from.
return: mixed  The value of the property.

getAll($key)   X-Ref
Returns an array with the specified property from all existing
identities.

param: string $key  The property to retrieve.
return: array  The array with the values from all identities

setValue($key, $val, $identity = null)   X-Ref
Sets a property with a specified value.

param: string $key        The property to set
param: mixed $val         The value to which the property should be set
param: integer $identity  The identity to set the property in.
return: boolean  True on success, false on failure (property was locked)

isLocked()   X-Ref
Returns true if all properties are locked and therefore nothing in the
identities can be changed.

return: boolean  True if all properties are locked, false otherwise

hasValue($key, $valueA)   X-Ref
Returns true if the given address belongs to one of the identities.

param: string $key    The identity key to search.
param: string $value  The value to search for in $key.
return: boolean  True if the $value was found in $key.

verify($identity = null)   X-Ref
Verifies and sanitizes all identity properties.

param: integer $identity  The identity to verify.
return: bool|object  True if the properties are valid or a PEAR_Error

getDefaultFromAddress($fullname = false)   X-Ref
Generates the from address to use for the default identity.

param: boolean $fullname  Include the fullname information.
return: string  The default from address.

factory($type = 'none', $user = null)   X-Ref
Attempts to return a concrete Identity instance based on $type.

param: mixed $type   The type of concrete Identity subclass to return.
param: string $user  If specified, we read another user's identities
return: Identity  The newly created concrete Identity instance, or false

singleton($type = 'none', $user = null)   X-Ref
Attempts to return a reference to a concrete Identity instance based on
$type. It will only create a new instance if no Identity instance with
the same parameters currently exists.

This should be used if multiple types of identities (and, thus,
multiple Identity instances) are required.

This method must be invoked as: $var = &Identity::singleton()

param: mixed $type   The type of concrete Identity subclass to return.
param: string $user  If specified, we read another user's identities
return: Identity  The concrete Identity reference, or false on an error.



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7