Class DefaultPrincipalService

Description

Default implementation of the BIGACE PrincipalService.

  • author: Kevin Papst
  • version: $Id: DefaultPrincipalService.php,v 1.8 2008/01/26 16:26:29 kpapst Exp $
  • copyright: Copyright (C) 2002-2006 Kevin Papst
  • license: GNU Public License
PrincipalService
   |
   --DefaultPrincipalService
Method Summary
DefaultPrincipalService DefaultPrincipalService ()
mixed createPrincipal ( $name,  $password,  $language)
boolean deleteAttributes ( $principal)
boolean deletePrincipal ( $principal)
array getAllPrincipals ()
array getAttributes ( $principal)
mixed getParameter ( $principal,  $parameter)
mixed lookup ( $principalName)
array lookupByAttribute ( $attribute,  $value)
mixed lookupByID ( $principalID)
boolean setAttribute ( $principal,  $attribute,  $value)
boolean setParameter ( $principal,  $parameter,  $value)
Methods
Constructor DefaultPrincipalService (line 41)
DefaultPrincipalService DefaultPrincipalService ()
createPrincipal (line 174)

Creates a Principal.

Returns false if the Principal could not be created.

  • return: the Principal or false
mixed createPrincipal ( $name,  $password,  $language)
  • $name
  • $password
  • $language

Redefinition of:
PrincipalService::createPrincipal()
Creates a Principal.
deleteAttributes (line 87)

Deletes the attributes for the given Principal.

  • return: true on success otherwise false
boolean deleteAttributes ( $principal)
  • $principal

Redefinition of:
PrincipalService::deleteAttributes()
Deletes all attributes for the given Principal.
deletePrincipal (line 200)

Deletes a Principal.

Returns false if the Principal could not be deleted.

This will not work for the BIGACE and ANONYMOUS USER! We do not have to delete any right, because each is in a Group and the rights are group dependend.

  • return: true on success otherwise false
boolean deletePrincipal ( $principal)
  • $principal

Redefinition of:
PrincipalService::deletePrincipal()
Deletes a Principal.
getAllPrincipals (line 99)

Get an Array with all available Principals.

  • return: an array with Principal instances
array getAllPrincipals ()

Redefinition of:
PrincipalService::getAllPrincipals()
Get an Array with all available Principals.
getAttributes (line 51)

Returns an Array with the the Principal Attributes key-value mapped.

If no Attributes could be found it returns an empty array.

  • return: the Principal Attributes
array getAttributes ( $principal)
  • $principal

Redefinition of:
PrincipalService::getAttributes()
Returns the Principal Attributes as a key-value mapped Array.
getParameter (line 286)

Gets the given Parameter for the Principal.

If the passed Parameter could not be found or is invalid null will be returned.

The allowed Parameter are:

  • PRINCIPAL_PARAMETER_PASSWORD
  • PRINCIPAL_PARAMETER_ACTIVE
  • PRINCIPAL_PARAMETER_LANGUAGE

  • return: the value or null if not found
mixed getParameter ( $principal,  $parameter)
  • $principal
  • $parameter

Redefinition of:
PrincipalService::getParameter()
Gets the given Parameter for the Principal.
lookup (line 119)

Tries to find a Principal with the given Name.

Returns null if none could be found.

  • return: a Principal or null
mixed lookup ( $principalName)
  • $principalName

Redefinition of:
PrincipalService::lookup()
Tries to find a Principal with the given Name.
lookupByAttribute (line 150)

Returns an array with all Principals where the attribute-value pair matches.

The array can be empty if none could be found. The lookup will ONLY find EXACT matches of the value!

  • return: an array of Principals
array lookupByAttribute ( $attribute,  $value)
  • $attribute
  • $value
lookupByID (line 137)

Tries to find a Principal with the given ID.

Returns null if none could be found.

  • return: a Principal or null
mixed lookupByID ( $principalID)
  • $principalID

Redefinition of:
PrincipalService::lookupByID()
Tries to find a Principal with the given ID.
setAttribute (line 68)

Sets the attributes for the given Principal.

  • return: true on success otherwise false
boolean setAttribute ( $principal,  $attribute,  $value)
  • $principal
  • $attribute
  • $value

Redefinition of:
PrincipalService::setAttribute()
Sets the attribute-value mapping for the given Principal.
setParameter (line 231)

Sets the given Parameter for the Principal.

The allowed Parameter are:

  • PRINCIPAL_PARAMETER_PASSWORD
  • PRINCIPAL_PARAMETER_ACTIVE
  • PRINCIPAL_PARAMETER_LANGUAGE

  • return: true on success otherwise false
boolean setParameter ( $principal,  $parameter,  $value)
  • $principal
  • $parameter
  • $value

Redefinition of:
PrincipalService::setParameter()
Sets the given Parameter for the Principal.

Inherited Methods

Inherited From PrincipalService

PrincipalService::PrincipalService()
PrincipalService::createPrincipal()
PrincipalService::deleteAttributes()
PrincipalService::deletePrincipal()
PrincipalService::getAllPrincipals()
PrincipalService::getAttributes()
PrincipalService::getParameter()
PrincipalService::lookup()
PrincipalService::lookupByID()
PrincipalService::setAttribute()
PrincipalService::setParameter()

Documentation generated by phpDocumentor 1.4.0