Class: DefaultPrincipalService

Source Location: /CORE/system/classes/principal/DefaultPrincipalService.php

Class DefaultPrincipalService

Class Overview

Default implementation of the BIGACE PrincipalService.

Located in /CORE/system/classes/principal/DefaultPrincipalService.php [line 40]

PrincipalService
   |
   --DefaultPrincipalService
Author(s):
  • Kevin Papst
Information Tags:
Version:  $Id: DefaultPrincipalService.php,v 1.10 2008/08/19 00:15:05 kpapst Exp $
Copyright:  Copyright (C) Kevin Papst
License:  GNU Public License

Methods

[ Top ]
Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From PrincipalService

PrincipalService::PrincipalService()
PrincipalService::createPrincipal()
Creates a Principal.
PrincipalService::deleteAttributes()
Deletes all attributes for the given Principal.
PrincipalService::deletePrincipal()
Deletes a Principal.
PrincipalService::getAllPrincipals()
Get an Array with all available Principals.
PrincipalService::getAttributes()
Returns the Principal Attributes as a key-value mapped Array.
PrincipalService::getParameter()
Gets the given Parameter for the Principal.
PrincipalService::lookup()
Tries to find a Principal with the given Name.
PrincipalService::lookupByID()
Tries to find a Principal with the given ID.
PrincipalService::setAttribute()
Sets the attribute-value mapping for the given Principal.
PrincipalService::setParameter()
Sets the given Parameter for the Principal.

[ Top ]
Method Summary
DefaultPrincipalService   DefaultPrincipalService()  
mixed   createPrincipal()   Creates a Principal.
boolean   deleteAttributes()   Deletes the attributes for the given Principal.
boolean   deletePrincipal()   Deletes a Principal.
array   getAllPrincipals()   Get an Array with all available Principals.
array   getAttributes()   Returns an Array with the the Principal Attributes key-value mapped.
mixed   getParameter()   Gets the given Parameter for the Principal.
mixed   lookup()   Tries to find a Principal with the given Name.
array   lookupByAttribute()   Returns an array with all Principals where the attribute-value pair matches.
mixed   lookupByID()   Tries to find a Principal with the given ID.
boolean   setAttribute()   Sets the attributes for the given Principal.
boolean   setParameter()   Sets the given Parameter for the Principal.

[ Top ]
Methods
Constructor DefaultPrincipalService  [line 43]

  DefaultPrincipalService DefaultPrincipalService( )



[ Top ]
createPrincipal  [line 176]

  mixed createPrincipal( $name, $password, $language  )

Creates a Principal.

Returns false if the Principal could not be created.

Parameters:
   $name: 
   $password: 
   $language: 

API Tags:
Return:  the Principal or false


Redefinition of:
PrincipalService::createPrincipal()
Creates a Principal.

[ Top ]
deleteAttributes  [line 89]

  boolean deleteAttributes( $principal  )

Deletes the attributes for the given Principal.

Parameters:
   $principal: 

API Tags:
Return:  true on success otherwise false


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

[ Top ]
deletePrincipal  [line 206]

  boolean deletePrincipal( $principal  )

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.

Parameters:
   $principal: 

API Tags:
Return:  true on success otherwise false


Redefinition of:
PrincipalService::deletePrincipal()
Deletes a Principal.

[ Top ]
getAllPrincipals  [line 101]

  array getAllPrincipals( )

Get an Array with all available Principals.


API Tags:
Return:  an array with Principal instances


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

[ Top ]
getAttributes  [line 53]

  array getAttributes( $principal  )

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

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

Parameters:
   $principal: 

API Tags:
Return:  the Principal Attributes


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

[ Top ]
getParameter  [line 295]

  mixed getParameter( $principal, $parameter  )

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

Parameters:
   $principal: 
   $parameter: 

API Tags:
Return:  the value or null if not found


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

[ Top ]
lookup  [line 121]

  mixed lookup( $principalName  )

Tries to find a Principal with the given Name.

Returns null if none could be found.

Parameters:
   $principalName: 

API Tags:
Return:  a Principal or null


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

[ Top ]
lookupByAttribute  [line 152]

  array lookupByAttribute( $attribute, $value  )

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!

Parameters:
   $attribute: 
   $value: 

API Tags:
Return:  an array of Principals


[ Top ]
lookupByID  [line 139]

  mixed lookupByID( $principalID  )

Tries to find a Principal with the given ID.

Returns null if none could be found.

Parameters:
   $principalID: 

API Tags:
Return:  a Principal or null


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

[ Top ]
setAttribute  [line 70]

  boolean setAttribute( $principal, $attribute, $value  )

Sets the attributes for the given Principal.

Parameters:
   $principal: 
   $attribute: 
   $value: 

API Tags:
Return:  true on success otherwise false


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

[ Top ]
setParameter  [line 237]

  boolean setParameter( $principal, $parameter, $value  )

Sets the given Parameter for the Principal.

The allowed Parameter are:

  • PRINCIPAL_PARAMETER_PASSWORD
  • PRINCIPAL_PARAMETER_ACTIVE
  • PRINCIPAL_PARAMETER_LANGUAGE

Parameters:
   $principal: 
   $parameter: 
   $value: 

API Tags:
Return:  true on success otherwise false


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

[ Top ]