phpPoA2
[ class tree: phpPoA2 ] [ index: phpPoA2 ] [ all elements ]

Class: InviteAuthzEngine

Source Location: /lib/authz/InviteAuthzEngine.php

Class Overview

GenericEngine
   |
   --AuthorizationEngine
      |
      --InviteAuthzEngine

Invitation based authorization engine.


Author(s):

Version:

  • 2.0

Copyright:

  • Copyright 2005-2010 RedIRIS, http://www.rediris.es/

    This file is part of phpPoA2.

    phpPoA2 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 3 of the License, or (at your option) any later version.

    phpPoA2 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 phpPoA2. If not, see <http://www.gnu.org/licenses/>.

Variables

Methods


Inherited Variables

Inherited Methods

Class: AuthorizationEngine

AuthorizationEngine::authorize()
AuthorizationEngine::getAuthorizedList()
AuthorizationEngine::isAuthorized()
Check authorization for the specified user.
AuthorizationEngine::revoke()

Class: GenericEngine

GenericEngine::__construct()
Main constructor for the engine.
GenericEngine::addHook()
Adds a function to the specified hook, which will be executed at some point of the code.
GenericEngine::configure()
Configure the engine.
GenericEngine::removeHook()
Removes a function fromt he specified hook.
GenericEngine::runHooks()
Run all hooks attached to an specific action.

Class Details

[line 55]
Invitation based authorization engine.



Tags:

author:  Jaime Perez <jaime.perez@rediris.es>
version:  2.0
copyright:  

Copyright 2005-2010 RedIRIS, http://www.rediris.es/

This file is part of phpPoA2.

phpPoA2 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 3 of the License, or (at your option) any later version.

phpPoA2 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 phpPoA2. If not, see <http://www.gnu.org/licenses/>.



[ Top ]


Class Variables

$authz_db =

[line 57]



Tags:

access:  protected

Type:   mixed


[ Top ]

$invites_db =

[line 58]



Tags:

access:  protected

Type:   mixed


[ Top ]

$valid_hooks = array(INVITES_BEFORE_AUTHORIZATION)

[line 59]



Tags:

access:  protected

Type:   mixed
Overrides:   Array


[ Top ]



Class Methods


method authorize [line 164]

boolean authorize( user $user, attrs $attrs, ref $ref, [expires $expires = 0])

Authorize the specified user.



Tags:

return:  true if the user was successfully authorized, false otherwise.
access:  public


Overrides AuthorizationEngine::authorize() (parent method not documented)

Parameters:

user   $user  
attrs   $attrs  
ref   $ref  
expires   $expires  

[ Top ]

method configure [line 66]

void configure( file $file, section $section)

Configure the authorization engine.



Tags:

access:  public


Overrides GenericEngine::configure() (Configure the engine.)

Parameters:

file   $file   The configuration file.
section   $section   The section of the configuration file to use.

[ Top ]

method emailVerify [line 341]

boolean emailVerify( mail $mail, attrs $attrs)

Perform e-mail verification for the current user according to the configuration for this site.



Tags:

return:  true if verification succeeds or was not performed, false otherwise.
access:  protected


Parameters:

mail   $mail   The e-mail of the user.
attrs   $attrs   The array of attributes of the user.

[ Top ]

method finish [line 389]

void finish( value $value)

Close databases and return the same value received as a parameter.



Tags:

access:  protected


Parameters:

value   $value   The value that must be returned.  @return mixed The first param.

[ Top ]

method getAuthorizedList [line 131]

array getAuthorizedList( )

Get a list of all authorized users.



Tags:

return:  The list of all users currently authorized. An empty array if none found.
access:  public


Overrides AuthorizationEngine::getAuthorizedList() (parent method not documented)

[ Top ]

method getPendingInvites [line 146]

array getPendingInvites( )

Get a list of all pending invitations.



Tags:

return:  The list of all pending invitations. An empty array if none found.
access:  public


[ Top ]

method invite [line 287]

boolean invite( mail $mail, [expires $expires = 0])

Send an invitation to an e-mail address (that is, send an e-mail to that address with instructions on how to get authorized and an URL to follow).



Tags:

return:  true if the invitation was correctly sent, false in any other case.
access:  public


Parameters:

mail   $mail   The e-mail of the user.
expires   $expires   The time (POSIX) when authorization will expire. Use 0 if authorization should never expire. Defaults to 0.

[ Top ]

method isAuthorized [line 88]

boolean isAuthorized( user $user, attrs $attrs)

Check if the specified user is authorized with the given attributes.



Tags:

return:  true if the user is authorized, false otherwise.
access:  public


Overrides AuthorizationEngine::isAuthorized() (Check authorization for the specified user.)

Parameters:

user   $user   The name of the user to check authorization for.
attrs   $attrs   The attributes of the user to match his identity.

[ Top ]

method removeInvite [line 323]

boolean removeInvite( ref $ref)

Remove an invitation from the database.



Tags:

return:  true if the invite was removed, false otherwise.
access:  public


Parameters:

ref   $ref   The reference to the invite to remove.

[ Top ]

method revoke [line 255]

boolean revoke( $mail)

Revoke authorization for the specified user.



Tags:

return:  true if authorization was successfully revoked, false otherwise.
access:  public


Overrides AuthorizationEngine::revoke() (parent method not documented)

Parameters:

   $mail  

[ Top ]


Documentation generated on Thu, 26 Aug 2010 13:38:50 +0200 by phpDocumentor 1.4.3